Skip to main content

A pure Python implementation of the trie data structure.

Project description

# pytrie

pytrie is a a pure Python (2 and 3) implementation of the trie data structure.

A _trie_ is an ordered tree data structure that is used to store a mapping where the keys are sequences, usually strings over an alphabet. In addition to implementing the mapping interface, tries allow finding the items for a given prefix, and vice versa, finding the items whose keys are prefixes of a given key.

pytrie runs on Python 2.7 and 3.x without modification. To install run:

pip install pytrie

Documentation is available at [Read the Docs](https://pytrie.readthedocs.io/).

## Changelog

### 0.3

  • Fixed bug for tries with zero-length keys.

  • Added __bool__ (__nonzero__) and __cmp__ methods to Trie.

  • Added sortedcontainers dependency.

  • Linting.

  • Converted from Mercurial to Git.

### 0.2

  • Initial Python 3 support (thanks Dmitrijs Milajevs)

### 0.1

  • Initial release

Project details


Download files

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

Source Distribution

PyTrie-0.3.tar.gz (228.7 kB view details)

Uploaded Source

File details

Details for the file PyTrie-0.3.tar.gz.

File metadata

  • Download URL: PyTrie-0.3.tar.gz
  • Upload date:
  • Size: 228.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyTrie-0.3.tar.gz
Algorithm Hash digest
SHA256 0c1bd0cb7c301b193da4bcf31bdf68bbdbea88be4bea5f680caecc56d9b74020
MD5 32d824476a5beab2bc79620fb5871cd2
BLAKE2b-256 aa4a3a3e7e95cb6202192c268043bed586f299e5b72b2650ece4614f60aecf2b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page