A Python library for storing and searching CIDR prefixes in a trie structure. It enables efficient longest-prefix matching of IP addresses against a set of CIDR blocks. The current version is 3.1.2. Release cadence is intermittent.
pip install cidr-trieVerified import paths — ran on the pinned version, not inferred.
Create a trie, insert CIDR prefixes, and perform longest-prefix matching.
Replace `trie.find_longest_prefix(ip)` with `trie[ip]`
Replace `trie.no_prefix(ip)` with `try: result = trie[ip]; except KeyError: # handle missing`
Use a threading lock when modifying the trie from multiple threads.
No dependency data recorded yet.