py-radix
py-radix is an implementation of a radix tree for Python, which supports storage and lookups of IPv4 and IPv6 networks. This is a Python equivalent to Dave Plonka's Perl Net::Patricia (it even steals the same radix tree code from MRTd).
The radix tree (a.k.a Patricia tree) is the data structure most commonly used for routing table lookups. It efficiently stores network prefixes of varying lengths and allows fast lookups of containing networks. py-radix's implementation is built solely for networks (the data structure itself is more general).
py-radix is licensed under a ISC/BSD licence. The underlying radix tree implementation is taken (and modified) from MRTd and is subject to a 4-term BSD license. See the LICENSE file for details.
News
Tue, 18 Dec 2007: py-radix-0.5 released
py-radix-0.5 has been released. This release fixes some bugs on Windows systems and adds support for pickle and unpickling of Radix objects.
Wed, 25 Apr 2007: Binary release for Python 2.5
I have just compiled and built a binary release of py-radix for Windows Python 2.5. It is available from the download section below.
Tue, 08 Aug 2006: Windows binary available
After wrestling with Microsoft's compilers and headers, I have been able to build and release Windows binaries of the radix module. These are available below in the download section. Some minor changes were required to the module to build it, if you are interested you can see them in CVS.
Mon, 25 Apr 2005: py-radix-0.4 released
py-radix-0.4 has been released. This fixes a bug that could corrupt the stored prefix with certain mask lengths. An upgrade is recommended for anyone using an older version.
Tue, 23 Nov 2004: py-radix-0.3 released
The first beta version of py-radix has been released. This release includes many changes:
- Warn (RuntimeWarning) against modifying a tree while iterating over it
- Add Radix.prefixes() method, returning a list of network prefix strings
- Improve argument parsing, allowing keyword arguments, separate masklengths and the specification of packed binary addresses instead of strings.
- Allow mixing of IPv4 and IPv6 addresses in the same radix tree
- Many more regression tests
- Several bug fixes.
Download
py-radix is available here: