Metadata-Version: 2.2
Name: ioregistry
Version: 0.0.3
Summary: IORegistry exploration library
Author-email: doronz88 <doron88@gmail.com>
Maintainer-email: doronz88 <doron88@gmail.com>
License: GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
Project-URL: Homepage, https://github.com/doronz88/ioregistry
Project-URL: Bug Reports, https://github.com/doronz88/ioregistry/issues
Keywords: macos,osx,ioregistry,devicetree,automation,cli,ioservice
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE

# ioregistry

Python library for IORegistry exploration.

## Installation

```shell
python3 -m pip install -U ioregistry
```

## Usage

See the following example as an example to query the associated USB-ethernet interface with a connected iDevice:

```python
from ioregistry.exceptions import IORegistryException
from ioregistry.ioentry import get_io_services_by_type

for ethernet_interface_entry in get_io_services_by_type('IOEthernetInterface'):
    try:
        apple_usb_ncm_data = ethernet_interface_entry.get_parent_by_type('IOService', 'AppleUSBNCMData')
    except IORegistryException:
        continue

    if 'waitBsdStart' in apple_usb_ncm_data.properties:
        # RSD interface
        continue

    try:
        usb_host = ethernet_interface_entry.get_parent_by_type('IOService', 'IOUSBHostDevice')
    except IORegistryException:
        continue

    product_name = usb_host.properties['USB Product Name']
    usb_serial_number = usb_host.properties['USB Serial Number']
    print(product_name, usb_serial_number, ethernet_interface_entry.name)
```
