--- id: pytrie version: "0.4.0" license: unclear license_treatment: permissive maintenance: abandoned --- # PyTrie — A pure Python implementation of the trie data structure. License: permissive · Maintenance: abandoned · Downloads: 73.6K/mo ## What it is and what it does PyTrie is a pure Python 3 implementation of the trie (prefix tree) data structure. It stores mappings where keys are sequences—typically strings—and allows you to retrieve items by exact key match or by prefix. Beyond standard dictionary operations, it supports prefix-based lookups: finding all items whose keys start with a given prefix, or finding items whose keys are prefixes of a given string. The package has no external dependencies and installs cleanly. However, it has been abandoned since late 2020, with no commits or releases in years. If you need a trie for a small project or learning, it works; for production systems requiring ongoing maintenance or bug fixes, you should evaluate actively maintained alternatives. Use it for: - Autocomplete and search suggestions where you need to find all entries matching a typed prefix. - IP routing tables or hierarchical key lookups where prefix matching is essential. - Dictionary or spell-checker implementations that benefit from prefix-based traversal. - Storing and querying hierarchical data like file paths or domain names by prefix. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. PyTrie provides a pure Python 3 trie data structure for storing and retrieving string-keyed mappings with prefix-matching capabilities. Yes, if you need a simple, dependency-free trie for a non-critical project or learning. No, if you require active maintenance, bug fixes, or production-grade reliability—the package is abandoned and has not been updated since 2020. The permissive BSD license removes legal friction, but the lack of maintenance is the real blocker. ## Install pip install pytrie uv add pytrie poetry add pytrie ## Installing PyTrie Before you install: Installation is frictionless with no runtime dependencies. However, the package is abandoned—last commit was 2020-12-26 and no release in several years—so expect no maintenance or bug fixes going forward. License in practice: Licensed under BSD (permissive), so you can use it freely in commercial and open-source projects without copyleft obligations. Quickstart: pip install pytrie from pytrie import StringTrie trie = StringTrie() trie['hello'] = 1 trie['help'] = 2 print(trie.keys(prefix='hel')) # Find all keys with prefix 'hel' Verify before relying: - Whether the trie implementation handles edge cases like zero-length keys reliably in production use. - Performance characteristics (insertion, lookup, prefix-search time complexity) relative to alternatives. - Compatibility with modern Python versions beyond what the classifier 'Programming Language :: Python :: 3' indicates. ## Package facts - License: not declared (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 73.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags trie data structure, prefix tree implementation, string prefix matching, ordered tree mapping, sequence key storage, prefix search algorithm, trie dictionary, data-structures, prefix-search [View on SkillFed](https://skillfed.io/packages/pytrie) · [View on PyPI](https://pypi.org/project/pytrie/)