--- id: isc-dhcp-leases version: "0.10.0" license: MIT license_treatment: permissive maintenance: dormant --- # isc-dhcp-leases — Small python module for reading /var/lib/dhcp/dhcpd.leases from isc-dhcp-server License: permissive · Maintenance: dormant · Downloads: 194.3K/mo ## What it is and what it does isc-dhcp-leases is a small parser for ISC DHCP server lease database files. It reads the dhcpd.leases file (or dhcpd6.leases for IPv6) and exposes lease records as Python objects with properties like IP address, MAC address, expiration time, binding state, and hostname. You instantiate IscDhcpLeases with a file path, then call get() to retrieve all leases or get_current() to filter only active, non-expired leases. The package supports both IPv4 (Lease objects) and IPv6 (Lease6 objects) lease formats. It can read plain text or gzip-compressed lease files. Its only runtime dependency is six, making it lightweight. The module is useful for monitoring DHCP server state, auditing active leases, or integrating lease data into network management tools. Use it for: - Monitor active DHCP leases on a server to track which devices are currently connected and their IP assignments. - Audit expired or abandoned leases to understand historical DHCP allocation patterns. - Integrate lease data into a network management dashboard or monitoring system. - Query lease information by MAC address to find the IP assigned to a specific device. - Parse IPv6 lease files to track temporary and delegated prefix assignments in dual-stack networks. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Reads and parses ISC DHCP server lease files (dhcpd.leases) for both IPv4 and IPv6, returning lease data as structured objects with expiration, binding state, and host information. Yes, if you need to read ISC DHCP lease files on a system running the isc-dhcp-server daemon. The package is stable, has no known vulnerabilities, and installs with minimal friction. However, be aware that maintenance is dormant (last update 1244 days ago); if you encounter issues with modern Python versions or need active support, you may need to fork or patch it yourself. ## Install pip install isc-dhcp-leases uv add isc-dhcp-leases poetry add isc-dhcp-leases ## Installing isc-dhcp-leases Before you install: Low friction: pure Python wheel with a single dependency (six). Maintenance is dormant—last release was 1244 days ago—but the package is marked Production/Stable and has no known vulnerabilities, so it is unlikely to require updates for basic use. License in practice: MIT license is permissive, allowing commercial and private use with minimal restrictions; you may use, modify, and distribute this package freely as long as you retain the license notice. Quickstart: from isc_dhcp_leases import IscDhcpLeases leases = IscDhcpLeases('/var/lib/dhcp/dhcpd.leases') current = leases.get_current() # dict keyed by MAC address for mac, lease in current.items(): print(f"{mac}: {lease.ip} (expires {lease.end})") The dhcpd.leases file must be readable by the Python process; typically requires running as root or the dhcp user, or adjusting file permissions on the lease file. Verify before relying: - Whether the package still works reliably with modern Python 3.x versions beyond 3.5, given the last release was in March 2023. - Whether gzip-compressed lease file support (mentioned in the description) is fully tested and maintained. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 194.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags dhcp lease file parser, isc dhcp leases reader, dhcpd.leases python, dhcp lease expiration check, ipv4 ipv6 dhcp parser, dhcp, network-admin, lease-parser [View on SkillFed](https://skillfed.io/packages/isc-dhcp-leases) · [View on PyPI](https://pypi.org/project/isc-dhcp-leases/)