skillfed

aiodhcpwatcher

Watch for DHCP packets with asyncio

aiodhcpwatcher v1.2.7 96.1K downloads/30d#13,228 on PyPI3
Permissive license Apache-2.0 Active released

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 aiodhcpwatcher

uv

uv add aiodhcpwatcher

poetry

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 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

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

Tags

dhcp packet monitoringasyncio dhcp watchernetwork dhcp listenerdhcp request detectorasync dhcp observer
network-monitoringasynciodhcp

More Libraries packages