netaddr is a Python library for representing and manipulating network addresses.
It supports the ability to work and interact with the following:
There are routines that allow :
For details on the latest updates and changes, see What’s new in netaddr 0.7.14
This software is released under the liberal BSD license.
Python 2.4 or higher.
Python 3.x support available from netaddr version 0.7.5 onwards.
Required IPython for the interactive netaddr shell.
See Installing netaddr for details.
The code contains thorough docstrings as well as detailed tutorials and API documentation can be found here:
No code can ever be deemed truly complete or trustworthy without reasonable unit test coverage. Full coverage for netaddr is the certainly the ultimate goal. To this end coverage.py by Ned Batchelder is being used from release 0.7.x onwards to help with this. The latest coverage report can be found in the tests/ subdirectory. Feel free to add tests to help improve coverage ;-)
Wherever possible all changes and new features will be covered with specific regression tests.
To run the unit tests, go into the netaddr directory and run the following using your Python interpreter :-
python tests/__init__.py
Or if you are partial to distribute (nee setuptools) :
python setup_egg.py test
Tests are expected to run through without error. If any do fail, please help the project’s user base by filing bug reports at the following URL :-
Efforts have been made to ensure this code works equally well on both big and little endian architectures. However, the project does not own or have access to any big endian hardware (e.g. SPARC or PowerPC) for continual regression testing. If you happen to work on big endian architectures with Python and wish to use netaddr PLEASE ensure you run the unit tests before you using it in a production setting just to make sure everything is functioning as expected.
Share and enjoy!