Metadata-Version: 2.4
Name: comgrab3
Version: 1.0.0
Summary: Windows DirectShow camera enumerator with stable USB location IDs via CfgMgr32
License-Expression: MIT
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Video :: Capture
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: comtypes>=1.2.0

# comgrab3

Windows DirectShow camera enumerator with stable USB location IDs.

## Install

```bash
pip install comgrab3
```

**Windows only** — requires `comtypes`.

## Usage

```python
from comgrab3 import enumerate_cameras, get_usb_location

cams = enumerate_cameras()
for cam in cams:
    print(cam["index"], cam["name"], cam["location_id"])
```

CLI:
```bash
comgrab3
```

## What it returns

Each camera dict contains:
- `index` — OpenCV `cv2.VideoCapture(index)` index
- `name` — friendly name (e.g. `"USB Camera"`)
- `device_path` — full DirectShow device path
- `location_id` — stable USB port location (e.g. `PCIROOT(0)#PCI(1400)#USB(0001)#USB(0003)`)

`location_id` is stable across reboots as long as the camera stays in the same physical USB port.
