A module for manipulating IP addresses, ranges, and networks, supplementing the netaddr module.
Project description
naddrtools
naddrtools is a simple library for manipulating IP addresses, ranges, and networks and acts as an extension of the netaddr module.
>>> import naddrtools as nat
>>> mylist = ["100.25.13.11", "172.20.31.0/24", "172.20.30.1 - 172.20.30.254"]
>>> ipset = nat.build_ipset(mylist, buff_network_ranges=True)
>>> print(ipset)
IPSet(['100.25.13.11/32', '172.20.30.0/23'])
>>> print(nat.convert_ipset_to_ranges_as_string(ipset))
100.25.13.11, 172.20.30.0 - 172.20.31.255
Installing naddrtools
naddrtools is available on PyPI:
$ python -m pip install naddrtools
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
naddrtools-0.1.2.tar.gz
(4.1 kB
view details)
Built Distribution
File details
Details for the file naddrtools-0.1.2.tar.gz
.
File metadata
- Download URL: naddrtools-0.1.2.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c947b3a55262e8c85c5417b9c288fa02bd72e3ba662ed1c81376110da7312f69 |
|
MD5 | 6e9ddc4d4e9079dfab65ac6f16aa80c9 |
|
BLAKE2b-256 | fdee5aa32b0f50f8bc86bcec351ba0a40425005e386f3878184bdad8b3ff0560 |
File details
Details for the file naddrtools-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: naddrtools-0.1.2-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08414773be1c07c70aef6d668347889f219dc30716a91cc3b3a5c66e944d45c3 |
|
MD5 | b83faa70dcabe526a3f29a66e41f0f50 |
|
BLAKE2b-256 | 458019ce0a32989e2fdb0a5405e7f7b3090bf1f8e68792a706af08e1740b3731 |