Metadata-Version: 2.4
Name: driver-inspector
Version: 0.1.0
Summary: Trace hardware -> kernel driver -> device node on Linux. Great for debugging 'why isn't my board detected'.
Author-email: Maan Jain <maanjain25@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/yourusername/driver-inspector
Project-URL: Issues, https://github.com/yourusername/driver-inspector/issues
Keywords: linux,kernel,driver,embedded,usb,serial,sysfs,diagnostics
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: System :: Hardware
Classifier: Topic :: Utilities
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# driver-inspector

Trace hardware → kernel driver → device node, on Linux, from the command line.

If you've ever plugged in a USB-serial adapter, an Arduino, or a dev board and
wondered *"why isn't /dev/ttyUSB0 showing up"* or *"which kernel module is
actually handling this thing"*, this is for you.

It reads `/sys/class/tty`, `/sys/class/net`, and USB sysfs entries directly —
no root required for read-only inspection.

## Install

```bash
pip install driver-inspector
```

> Linux only — it depends on `/sys` and `/dev`, which don't exist on macOS/Windows.

## Usage

List all serial devices and the kernel driver behind each one:

```bash
driver-inspector list-serial
```

```
device          driver
--------------  ------------
/dev/ttyUSB0    ftdi_sio
/dev/ttyACM0    cdc_acm
```

Inspect one device in detail (kernel driver, sysfs path, USB vendor/product ID):

```bash
driver-inspector inspect /dev/ttyUSB0
```

```
device_node: /dev/ttyUSB0
exists: True
sys_path: /sys/class/tty/ttyUSB0
driver: ftdi_sio
usb_vendor_id: 0403
usb_product_id: 6001
```

List network interfaces and their drivers:

```bash
driver-inspector list-net
```

Show raw `lsusb` output for cross-reference:

```bash
driver-inspector usb
```

## Why

Linux's hardware → driver → device-node chain (USB descriptor → kernel module
via `lsmod`/`modinfo` → `udev` → `/dev/*`) is not obvious to newcomers, and
even experienced developers reach for a half-remembered chain of `lsusb`,
`dmesg`, and `readlink` commands. This wraps that chain into one command.

## Development

```bash
git clone https://github.com/yourusername/driver-inspector
cd driver-inspector
pip install -e .
driver-inspector list-serial
```

## Publishing to PyPI

```bash
pip install build twine
python -m build
twine upload dist/*
```

## License

MIT
