cidr-trie
Store/search CIDR prefixes in a trie structure.
What it is and what it does
cidr-trie implements a Patricia trie (a space-efficient prefix tree) to store and query CIDR network blocks. You insert IP networks in CIDR notation along with arbitrary data, then query for all networks that contain a given IP address. It supports both IPv4 and IPv6 addresses and returns all matching prefixes from most specific to least specific.
The package has no external runtime dependencies and installs cleanly. However, it has been abandoned since mid-2019 with no active maintenance, so it receives no bug fixes, security updates, or compatibility improvements for newer Python versions. It remains stable for its intended use case if your Python environment is compatible.
Use it for:
- Build a geolocation or ISP lookup table by storing CIDR blocks with associated metadata and querying IP addresses against it.
- Implement IP-based access control lists by storing allowed or blocked CIDR ranges and checking incoming requests.
- Organize network routing tables or firewall rules that need fast prefix matching on IP addresses.
- Validate whether an IP address falls within a known set of CIDR ranges such as private networks.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Stores and queries CIDR IP address blocks (IPv4 and IPv6) in a trie data structure for fast prefix matching and lookup.
Yes, if you need CIDR prefix matching and your Python environment is compatible. The package is stable, has no dependencies, and works for its core use case. However, verify Python version compatibility first (requires_python is unspecified), and be aware that no maintenance or updates are forthcoming—use it only if the existing codebase meets your needs without modification.
Install
cidr-trie on PyPI
pip
pip install cidr-trieuv
uv add cidr-triepoetry
poetry add cidr-trieInstalling cidr-trie
Before you install
Low friction installation with no runtime dependencies. However, the package is abandoned—last release was 2019-07-05 and last commit 2022-12-08, so no active maintenance or bug fixes should be expected.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install cidr-trie
from cidr_trie import PatriciaTrie
trie = PatriciaTrie()
trie.insert("0.0.0.0/0", "Internet")
trie.insert("32.32.32.32/32", "example")
result = trie.find_all("32.32.32.32")
print([node.value for node in result])
Verify before relying
- Whether the package works correctly with modern Python versions (requires_python is unspecified in the fact sheet)
- Performance characteristics for large CIDR datasets or production-scale deployments
- Any known issues or edge cases in the abandoned codebase that may affect reliability
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,597 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 91,203/month — #13,532 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cidr_trie-3.1.2-py3-none-any.whl
Keywords: cidr, ip, ipv4, ipv6, trie
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
py-radixImplements a radix tree data structure for…
permissive · top 15,000 on PyPI
iptoolsProvides utilities for parsing, validating, and…
permissive · top 15,000 on PyPI
netaddrRepresents and manipulates IPv4, IPv6, MAC…
permissive · top 5,000 on PyPI
ipaddrProvides utilities for parsing, validating, and…
permissive · top 15,000 on PyPI
IPyIPy provides Python classes for parsing,…
permissive · top 5,000 on PyPI
PyTriePyTrie provides a pure Python 3 trie data…
permissive · top 15,000 on PyPI
pygtriepygtrie provides pure Python implementations of…
permissive · top 5,000 on PyPI
trieImplements the Ethereum Merkle Trie data…
permissive · top 15,000 on PyPI
isc-dhcp-leasesReads and parses ISC DHCP server lease files…
permissive · top 15,000 on PyPI
ipwhoisRetrieves and parses whois and RDAP data for…
permissive · top 15,000 on PyPI