Fast IPv4 and IPv6 prefix aggregator written in Python.
Project description
aggregate-prefixes
Fast IPv4 and IPv6 prefix aggregator written in Python.
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]] [--truncate [MASK]] [--verbose] [--version] prefixes Aggregates IPv4 or IPv6 prefixes from file or STDIN positional arguments: prefixes Text file of 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 --truncate [MASK], -t [MASK] Ttruncate IP/mask to network/mask --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 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
Built Distributions
Close
Hashes for aggregate_prefixes-0.6.1b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac79294552a1ae1084968ad6effd6a07b9efe864de5099900c32170c82669a48 |
|
MD5 | 3035cf8c89996fb72b36f81b1e6029c1 |
|
BLAKE2b-256 | 0b8b7150197c45cbf422b4199768de2454d2cc433c99f0f5ffccfb48343af7aa |
Close
Hashes for aggregate_prefixes-0.6.1b0-py3.9.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45acb662614d2c119a940ac0bf86cbfe109ad73816f152fd558048a632471e02 |
|
MD5 | 36bccdcce419dc51fc7627276d7f4eaa |
|
BLAKE2b-256 | f184a381bbb0edef6cc9ca0a07c247eec7051fed6a2e8b16fb75921713fd872a |
Close
Hashes for aggregate_prefixes-0.6.1b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 886c81b5040ee27bf9fc1bd09fdf1bacbfa09d7350c61a7f5e12bfcac833cad4 |
|
MD5 | 0e42fa8d3c5a8df72373dd0d794ea770 |
|
BLAKE2b-256 | ba1372e9a592d01bacddcf2c1f0d157934d5760d16c16c6a92335e8e2a922224 |