skillfed

aiousbwatcher

Watch for USB devices to be plugged and unplugged

aiousbwatcher v1.1.2 104.3K downloads/30d#12,756 on PyPI2
Permissive license MIT Active released

What it is and what it does

aiousbwatcher is an asyncio-based library for monitoring USB device connections and disconnections in real time. It wraps file system event monitoring (via asyncinotify) to detect when USB devices are plugged in or removed, allowing Python applications to react immediately to hardware changes without polling.

The package is designed for developers building tools that need to respond to USB device events—such as device managers, firmware updaters, or hardware-aware applications. It integrates with asyncio's event loop, making it suitable for concurrent applications. The library is in pre-alpha status, actively maintained, and supports modern Python versions (3.12 and 3.13).

Use it for:

  • Detect when a specific USB device is connected to automatically initialize or configure it.
  • Monitor for device disconnections to clean up resources or alert users of unexpected removals.
  • Build a device manager UI that updates in real time as USB hardware is plugged and unplugged.
  • Trigger firmware updates or driver installations when compatible devices are detected.
  • Log USB device events for hardware audit or troubleshooting purposes.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Watches for USB devices being plugged in and unplugged using asyncio, enabling event-driven responses to hardware changes.

Yes, if you need asyncio-based USB device monitoring. Low install friction, permissive license, and active maintenance make it a straightforward choice. Pre-alpha status means the API may change, so pin the version in production. No known vulnerabilities. Verify that asyncinotify meets your platform requirements before committing.

Install

aiousbwatcher on PyPI

pip

pip install aiousbwatcher

uv

uv add aiousbwatcher

poetry

poetry add aiousbwatcher

Installing aiousbwatcher

Before you install

Low friction install with a single runtime dependency (asyncinotify). Active maintenance with a recent release (115 days ago) and current Python support (3.12, 3.13).

License in practice

MIT license is permissive—you can use, modify, and distribute this package freely with minimal restrictions.

Quickstart

pip install aiousbwatcher

import asyncio
from aiousbwatcher import USBWatcher

async def main():
    watcher = USBWatcher()
    async for event in watcher:
        print(event)

Requires Python 3.12 or later; depends on asyncinotify for file system event monitoring.

Verify before relying

  • Whether asyncinotify is available on all operating systems or limited to Linux/Unix-like systems.
  • Specific USB device attributes (vendor ID, product ID, serial number) exposed by the watcher.
  • Whether the watcher works with USB hubs or only direct connections.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.12)
Install friction low — pure-Python wheel
Runtime dependencies 1 — asyncinotify
Maintenance actively maintained — 115 days since the last release
Last repo commit
First released
Downloads 104,270/month — #12,756 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: aiousbwatcher-1.1.2-py3-none-any.whl

Development Status :: 2 - Pre-AlphaIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Software Development :: Libraries

Tags

usb device detection asynciowatch usb plug unplugasyncio usb watcherusb hotplug monitoringdevice insertion removal eventsusb device listenerhardware change notifications
usb-hardwareasyncioevent-monitoring

More Libraries packages