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 3.9.1+ (default, Feb 5 2021, 13:46:56)
[GCC 10.2.1 20210110] on linux
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 3.9.1+
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for aggregate_prefixes-0.6.3-py3.9.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4167c0d3006023b8689b44b9672d83b0bca28a34786d191643c49202a7e0a568 |
|
MD5 | ef360e36dbeb351df2626d4be389a996 |
|
BLAKE2b-256 | 28d80dc40ef269d1b00345cb9ac8d0ff931ec3231ebd07e2f98831c0bfadf3ff |
Close
Hashes for aggregate_prefixes-0.6.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97e0240e19d0e3881bed27dccc8db5e0ab0cbd04285f4a72fcf108ef8e451521 |
|
MD5 | b9fbfe439076e8b469e7177ed7e62e61 |
|
BLAKE2b-256 | 423c0e1fcb5688a3176df3c8c0ee6f9311e0e5802f66ce6ecf2c416cdc36b6a5 |