Skip to content
A filter API on top of python-isc-dhcp-leases
Branch: master
Clone or download
andir Merge pull request #3 from flokli/patch-1
travis: also check python 3.6
Latest commit 80c6723 Feb 14, 2017

README.md

ISC DHCP Leases Filter Library for Python

BuildStatus Test Coverage Issue Count

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 .current and .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.

Features

  • re-use parsed leases for usage with multiple filters
  • Chainability of filters (leases.active.v4.where_eq('foo', 'bar'))
  • .v4 and .v6 filter which filter by address family
  • .filter(lambda lease: lease.active == True) to implement custom filters
  • .where_eq(key[, value]) filter by set key/value
  • .valid, .invalid, .active, .inactive filters which use the corresponding lease attributes
  • .count() returns the amount of leases

Installation

pip install isc-dhcp-filter

You can’t perform that action at this time.