ISC DHCP Leases Filter Library for Python
This library provides a filter API on top of python-isc-dhcp-leases.
The goal is to make parsing ISC DHCP Leases files less repetitive. Leases are parsed once and then only filtered during runtime. In the underlying library actions such as
.active would involve parsing the leases file for each call. Since parsing of larger files is rather slow caching of the raw
Lease objects is desirable. This is what this library implements.
By storing the original leases and passing generators around the leases files only have to be parsed once.
- re-use parsed leases for usage with multiple filters
- Chainability of filters (
.v6filter which filter by address family
.filter(lambda lease: lease.active == True)to implement custom filters
.where_eq(key[, value])filter by
.inactivefilters which use the corresponding lease attributes
.count()returns the amount of leases
pip install isc-dhcp-filter