Fast IPv4 and IPv6 prefix aggregator written in Python.
Project description
aggregate-prefixes
Fast IPv4 and IPv6 prefix aggregator written in Pyrhon.
Gets a list of unsorted IPv4 or IPv6 prefixes from argument or SDTIN and returns a sorted list of aggregates to STDOUT Errors go to STDERR.
CLI Syntax for executable
usage: aggregate-prefixes [-h] [--max-length [LENGTH]] [--verbose] [--version] prefixes Aggregates IPv4 or IPv6 prefixes from file or STDIN positional arguments: prefixes Unsorted list of IPv4 or IPv6 prefixes. Use '-' for STDIN. optional arguments: -h, --help show this help message and exit --max-length [LENGTH], -m [LENGTH] Discard longer prefixes prior to processing --verbose, -v Display verbose information about the optimisations --version, -V show program's version number and exit
Usage as module
$ python
Python 2.7.14+ (default, Apr 2 2018, 04:16:25)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from aggregate_prefixes.aggregate_prefixes import aggregate_prefixes
>>> list(aggregate_prefixes(['192.0.2.0/32', '192.0.2.1/32', '192.0.2.2/32']))
['192.0.2.0/31', '192.0.2.2/32']
>>>
Python compatibility
Tested with:
- Python 2.7.15
- Python 3.6.5
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aggregate_prefixes-0.5.tar.gz
(5.2 kB
view hashes)
Built Distribution
aggregate_prefixes-0.5-py2.7.egg
(10.2 kB
view hashes)
Close
Hashes for aggregate_prefixes-0.5-py2.7.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd366e41a32c6a6b0678fbdc149e66ffc2e23377ccace6c034f6c3bbe1b3cc6b |
|
MD5 | 35a7792d21890e2fbe09cd7d745a9d7a |
|
BLAKE2b-256 | 9cc0f35ffd86c8010915f78f260299fd123eb9e8586cdeceb48da933b3d01d84 |