Skip to content
A network address manipulation library for Python
Python Makefile
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


`netaddr` is a Python library for representing and manipulating network addresses.

It support the ability to work and interact with the following:

- IPv4 and IPv6 addresses and subnets
- MAC addresses, OUI and IAB identifiers, IEEE EUI-64 identifiers
- arbitrary (non-aligned) IP address ranges and IP address sets
- various non-CIDR IP range formats such as nmap and glob-style formats

There are routines that allow :

- generating, sorting and summarizing IP addresses and networks
- performing easy conversions between address notations and formats
- detecting, parsing and formatting network address representations
- performing set-based operations on groups of IP addresses and subnets
- working with arbitrary IP address ranges and formats
- accessing OUI and IAB organisational information published by IEEE
- accessing IP address and block information published by IANA


For details on the latest updates and changes, see :doc:`changes`


This software is released under the liberal BSD license.

See the :doc:`license` and :doc:`copyright` for full text.


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 :doc:`installation` for details.


The code contains thorough docstrings as well as detailed tutorials and
API documentation can be found here:

Running The Test Suite

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 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/

Or if you are partial to distribute (nee setuptools) :

    python 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.

And finally...

Share and enjoy!
Something went wrong with that request. Please try again.