py-radix
Radix tree implementation
Decision gist · record as of 2026-08-14
Yes, if you need efficient prefix matching for IPv4 or IPv6 networks. The package is stable, permissively licensed, has no dependencies, and compiles to wheels for most platforms. The aging maintenance status (last release 253 days ago) is acceptable for a mature, narrow-purpose library with no known vulnerabilities, but check whether the feature set meets your exact needs before committing to it as a long-term dependency.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- C extension requires a C compiler at build time unless RADIX_NO_EXT=1 is set; pre-built wheels available for Python 3.9–3.12 on common platforms reduce this friction.
- Medium install friction due to C extension compilation; wheels are pre-built for Python 3.9–3.12 across multiple platforms (macOS, Linux, Windows, ARM), reducing friction for standard environments.
- Maintenance status is aging—last release 253 days ago, but the repository remains active and not archived.
License · maintenance · safety
BSD (permissive) — Licensed under BSD (permissive), allowing use in both open-source and proprietary projects with minimal restrictions. The underlying C implementation is subject to a 4-term BSD license; see LICENSE file for details.
last release 2025-12-04 (253 days) · last repo commit 2025-12-04 · 130 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 211,822 downloads/mo, #9,472 on PyPI
Alternatives
Verify before relying
import radix
rtree = radix.Radix()
rnode = rtree.add("10.0.0.0/8")
rnode.data["label"] = "my_data"
# Best-match search (routing-style lookup)
result = rtree.search_best("10.123.45.6")
if result:
print(result.prefix)- Whether the pure Python fallback (when C extension is disabled) has performance implications for large trees.
- Performance characteristics or benchmarks for trees with thousands or millions of prefixes.
- Whether IPv6 and IPv4 prefixes can be mixed in the same tree without performance degradation.
What it is and what it does
py-radix provides a radix tree (also called a trie) optimized for storing and retrieving network prefixes. It accepts IPv4 and IPv6 addresses in multiple formats—CIDR notation, separate network and mask length, or binary packed addresses—and supports three types of prefix searches: exact match, best match (longest prefix, used in routing), and worst match (shortest prefix). The tree stores arbitrary metadata in a data dictionary attached to each node.
The package is implemented primarily in C for speed, with a pure Python fallback available. It has no runtime dependencies and compiles to wheels for Python 3.9–3.12 on macOS, Linux, Windows, and ARM architectures. The API is straightforward: create a tree, add prefixes, and query them using one of the search methods. It is commonly used in network applications, routing simulators, and IP-based access control systems.
Use it for
- Build a routing table simulator or network lookup service that matches IP addresses to their containing network prefixes.
- Implement IP-based access control or firewall rules by storing allowed/blocked CIDR ranges and checking incoming addresses.
- Store geolocation or ASN data indexed by IP prefix and retrieve it with a single lookup.
- Analyze network traffic by classifying packets into predefined subnets and aggregating statistics per prefix.
- Validate or normalize network configurations by checking whether proposed prefixes overlap with existing allocations.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need efficient prefix matching for IPv4 or IPv6 networks.
The package is stable, permissively licensed, has no dependencies, and compiles to wheels for most platforms. The aging maintenance status (last release 253 days ago) is acceptable for a mature, narrow-purpose library with no known vulnerabilities, but check whether the feature set meets your exact needs before committing to it as a long-term dependency.
Install
py-radix on PyPI
Before you install
Medium install friction due to C extension compilation; wheels are pre-built for Python 3.9–3.12 across multiple platforms (macOS, Linux, Windows, ARM), reducing friction for standard environments. Maintenance status is aging—last release 253 days ago, but the repository remains active and not archived.
C extension requires a C compiler at build time unless RADIX_NO_EXT=1 is set; pre-built wheels available for Python 3.9–3.12 on common platforms reduce this friction.
License in practice
Licensed under BSD (permissive), allowing use in both open-source and proprietary projects with minimal restrictions. The underlying C implementation is subject to a 4-term BSD license; see LICENSE file for details.
Quickstart
import radix
rtree = radix.Radix()
rnode = rtree.add("10.0.0.0/8")
rnode.data["label"] = "my_data"
# Best-match search (routing-style lookup)
result = rtree.search_best("10.123.45.6")
if result:
print(result.prefix)
Verify before relying
- Whether the pure Python fallback (when C extension is disabled) has performance implications for large trees.
- Performance characteristics or benchmarks for trees with thousands or millions of prefixes.
- Whether IPv6 and IPv4 prefixes can be mixed in the same tree without performance degradation.
Package facts
| License | BSD permissive |
| Python support | Not specified |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Aging 253 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 211,822 / month, #9,472 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Networking |
Evidence: py_radix-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl; py_radix-1.1.0-cp310-cp310-macosx_11_0_arm64.whl; py_radix-1.1.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; py_radix-1.1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; py_radix-1.1.0-cp310-cp310-musllinux_1_2_aarch64.whl; py_radix-1.1.0-cp310-cp310-musllinux_1_2_x86_64.whl; py_radix-1.1.0-cp310-cp310-win32.whl; py_radix-1.1.0-cp310-cp310-win_amd64.whl; py_radix-1.1.0-cp310-cp310-win_arm64.whl; py_radix-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl; py_radix-1.1.0-cp311-cp311-macosx_11_0_arm64.whl; py_radix-1.1.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; py_radix-1.1.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; py_radix-1.1.0-cp311-cp311-musllinux_1_2_aarch64.whl; py_radix-1.1.0-cp311-cp311-musllinux_1_2_x86_64.whl; py_radix-1.1.0-cp311-cp311-win32.whl; py_radix-1.1.0-cp311-cp311-win_amd64.whl; py_radix-1.1.0-cp311-cp311-win_arm64.whl; py_radix-1.1.0-cp312-cp312-macosx_10_13_x86_64.whl; py_radix-1.1.0-cp312-cp312-macosx_11_0_arm64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “radix tree implementation”
- py-radixImplements a radix tree data structure for efficient storage and…
- pygtriepygtrie provides pure Python implementations of trie (prefix tree)…
- pyasnpyasn performs fast offline IP address to Autonomous System Number…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also cidr-trie · pyasn · IPy · netaddr · pygtrie · ipaddr · iptools · PyTrie · django-netfields · sqltrie