Skip to content

Metaswitch/netaddr

 
 

Repository files navigation

`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

-------
Changes
-------

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

-------
License
-------

This software is released under the liberal BSD license.

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

------------
Dependencies
------------

Python 2.4 or higher.

Python 3.x support available from netaddr version 0.7.5 onwards.

Required IPython for the interactive netaddr shell.

------------
Installation
------------

See :doc:`installation` for details.

-------------
Documentation
-------------

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

http://readthedocs.org/docs/netaddr/en/latest/

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

	http://github.com/drkjam/netaddr/issues

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!

About

A network address manipulation library for Python

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.1%
  • Other 0.9%