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.1-py3.7.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4531d647a792e0eddb1ade672342ff4288328308e61e9d1355637ef550b15e4 |
|
MD5 | fa702166f49012250ba43121d9e3249f |
|
BLAKE2b-256 | 0f943cf3d4d94c9e7d75ca8fa7fc43a8410746c3062775b5d84ec88c03f312d6 |
Close
Hashes for aggregate_prefixes-0.6.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b833089e67b8bbb1a901d1774833e0097f356f4def7a68cc362df3458b52ed21 |
|
MD5 | 5a714f450dadb6fcc620e1e946ffe07b |
|
BLAKE2b-256 | c6bfbf3dbadb288eabd4a7510130b894a23f22ba6204d31b44b20eedfb8359a1 |
Close
Hashes for aggregate_prefixes-0.6.1-py2.7.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff43dc967c804410f5b36f78cd6e064e690d17837e41e145b8fe3498fd075d22 |
|
MD5 | a85a91e9010c95ce5fa57f6792878202 |
|
BLAKE2b-256 | 6693952c29b8a71b103a276df1033ad353c201d61014ad0750c9f35a30980122 |
Close
Hashes for aggregate_prefixes-0.6.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e828e3167427dde8693091628eeda0eecbdc3e41787664dc960f014280a1541e |
|
MD5 | 706293d919044a78744d60a7d96c88cd |
|
BLAKE2b-256 | 7666160cd27e9ef840e040b4bdaf381441823ae6af5f64b24678af0735813f87 |