aiodhcpwatcher
Watch for DHCP packets with asyncio
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 on this page — 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
aiodhcpwatcher on PyPI
pip
pip install aiodhcpwatcheruv
uv add aiodhcpwatcherpoetry
poetry add aiodhcpwatcherInstalling 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 the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — scapy |
| Maintenance | actively maintained — 81 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 96,126/month — #13,228 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aiodhcpwatcher-1.2.7-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
aiohappyeyeballsImplements Happy Eyeballs (RFC 8305) connection…
permissive · top 100 on PyPI
aiousbwatcherWatches for USB devices being plugged in and…
permissive · top 15,000 on PyPI
aioouiPerforms asynchronous lookups of…
permissive · top 15,000 on PyPI
aiovlcControl VLC media player over a telnet…
permissive · top 15,000 on PyPI
aiozoneinfoFetches timezone information asynchronously…
permissive · top 15,000 on PyPI
aiovodafoneAsync Python library for controlling and…
permissive · top 15,000 on PyPI
kantokuKantoku runs and watches multiple processes and…
permissive · top 15,000 on PyPI
greeneye_monitorParses and processes binary data packets from…
permissive · top 15,000 on PyPI
pyenphaseProvides a Python library to communicate with…
permissive · top 15,000 on PyPI
aiopnsenseAn async Python client library that wraps…
permissive · top 15,000 on PyPI