Skip to main content

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


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 hashes)

Uploaded source

Built Distribution

naddrtools-0.1.2-py3-none-any.whl (17.5 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page