Metadata-Version: 2.2
Name: usbx
Version: 0.8.1
Summary: Modern and user-friendly library for working with USB devices
Author-email: "Manuel Bl." <manuel.bleichenbacher@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Manuel Bleichenbacher
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/manuelbl/usbx
Project-URL: Issues, https://github.com/manuelbl/usbx/issues
Keywords: usb,usb-host,usb-devices
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE

<h1 align="center">

![usbx](https://github.com/manuelbl/usbx/raw/main/docs/_static/usbx-github.svg)

</h1>


**usbx** is a modern, powerful and user-friendly Python library for working with USB devices.
It provides many useful features:

- Querying information about connected devices
- Communication with USB devices
- Notification when devices are connected and disconnected
- Single API for Windows, Linux and macOS
- Good documentation
- Thread-safe
- No need to install further software like *libusb*

**usbx** is easy to use:

```pycon
>>> from usbx import usb
>>> for device in usb.get_devices():
...     print(device)
...
USD device 4295171929, vid=0x1a40, pid=0x0801, manufacturer=None, product=USB 2.0 Hub, serial=None
USD device 4295171974, vid=0x0b0e, pid=0x0412, manufacturer=None, product=Jabra SPEAK 410 USB, serial=783F92B9DD3Cx011200
```


## Installing

**usbx** can be installed with [pip](https://pip.pypa.io):

```shell
python -m pip install usbx
```



## Usage

The [User Guide](https://usbx.readthedocs.io/en/stable/user-guide.html) will get you started with the library.
Also read [Platform-specific Considerations](https://usbx.readthedocs.io/en/stable/platform-specific.html)
as some operating systems might need extra steps to work with USB devices.

The [API Reference](https://usbx.readthedocs.io/en/stable/reference/index.html) documentation provides API-level documentation.

### Examples

Serveral examples demonstrate the use of the library:

- [enumerate.py](examples/enumerate.py): Enumerate all connected devices including details about the interfaces and endpoints
- [monitor.py](examples/monitor.py): Monitor USB devices being connected and disconnected
- [epaper.py](examples/epaper.py): Display an image on e-paper display with (with IT8951 controller)
- [stm32dfu](examples/stm32dfu): Upload firmware to an STM32 based device


## License

**usbx** is made available under the MIT License. For more details, see [The MIT License](https://opensource.org/licenses/MIT>).


## Contributing

This is an open-source project that happily accepts contributions.
Please see [Contributing](https://usbx.readthedocs.io/en/stable/contributing.html) for details.


## System Requirements

- Python 3.9 or higher
- Windows (x86-64 or ARM), Linux (x86-64 or ARM), macOS (x86-64 or ARM)
- 64-bit platform and Python interpreter
- For Linux: *udev* (usually goes together with *systemd*)
