--- id: aiodhcpwatcher version: "1.2.7" license: Apache-2.0 license_treatment: permissive maintenance: active --- # aiodhcpwatcher — Watch for DHCP packets with asyncio License: permissive · Maintenance: active · Downloads: 96.1K/mo ## What it is and what it does aiodhcpwatcher is a Python library that monitors DHCP packets on your network using asyncio, the standard Python async framework. It wraps scapy to listen for DHCP traffic and invoke a callback whenever a DHCP packet arrives. The library is designed for developers who need to react to DHCP events in async Python applications—for example, detecting when devices join a network or tracking DHCP lease activity. The package is in pre-alpha status but actively maintained and supports Python 3.10 through 3.14. Installation is straightforward with low friction, and the API is minimal: you provide an async callback and call async_start() to begin listening. The single runtime dependency is scapy, which handles the actual packet capture. Use it for: - Monitor a local network for new device connections by watching DHCP request packets. - Track DHCP lease renewals and expirations for network diagnostics or device lifecycle management. - Integrate DHCP monitoring into an async Python service that needs to react to network events in real time. - Build a network discovery tool that logs DHCP activity for audit or troubleshooting purposes. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Watches for DHCP packets on the network using asyncio, allowing you to monitor and react to DHCP requests and responses asynchronously. Yes, if you need asyncio-based DHCP packet monitoring. The package is actively maintained, has low install friction, uses a permissive license, and supports current Python versions. Pre-alpha status suggests it is still maturing, but no known vulnerabilities exist. Best suited for developers building network monitoring or device discovery features in async Python applications. ## Install pip install aiodhcpwatcher uv add aiodhcpwatcher poetry add aiodhcpwatcher ## Installing aiodhcpwatcher Before you install: Low friction install with a single runtime dependency. Actively maintained with recent commits; marked pre-alpha but supports current Python versions. License in practice: Apache-2.0 permissive license allows commercial and private use with minimal restrictions. Quickstart: pip install aiodhcpwatcher import asyncio import aiodhcpwatcher async def handle_dhcp(response: aiodhcpwatcher.DHCPRequest) -> None: print(response) async def run(): cancel = await aiodhcpwatcher.async_start(handle_dhcp) await asyncio.Event().wait() asyncio.run(run()) Requires Python 3.10 or later; scapy may need system-level network access or elevated privileges to capture DHCP packets. Verify before relying: - Whether elevated privileges (root/admin) are required to capture DHCP packets on all platforms. - Scope and filtering capabilities for DHCP packet selection beyond basic monitoring. - Performance characteristics when handling high-volume DHCP traffic. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 96.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags dhcp packet monitoring, asyncio dhcp watcher, network dhcp listener, dhcp request detector, async dhcp observer, network-monitoring, asyncio, dhcp [View on SkillFed](https://skillfed.io/packages/aiodhcpwatcher) · [View on PyPI](https://pypi.org/project/aiodhcpwatcher/)