Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Simple Python Trie Data Structure

Project Description

A simple trie implementation in Python

This implementation utilizes a dictionary as its backing
data structure. Essentially, it is creating nested dictionaries.

>>> from trie import TriePy
>>> t = TriePy()
>>> t.add_word("dog")
>>> t.add_word("doggy")
>>> t.add_word("dogs")
>>> t.contains_word("dog")
>>> t.contains_word("dogg")
>>> t.root
{'d': {'o': {'g': {'\0': {'word': 'dog'}, 's': {'\0': {'word': 'dogs'}}, 'g': {'y': {'\0': {'word': 'doggy'}}}}}}}

Unit Testing
nose is used for unit testing and simple unit tests
can be run with the following in the source trie directory:

You can install this as usual with ``.
`python install`

You can also install this via pip.
`pip install TriePy`

The usual "use virtualenv to test first" warnings apply.
Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
TriePy-0.2.1.tar.gz (2.8 kB) Copy SHA256 Checksum SHA256 Source May 15, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting