Skip to main content

General Purpose Trie Data Structure in Python

Project description

ptrie : Python Implementation of Trie Data Structure

image License

image

ptrie includes sweet pythonic implementation of our favourite data structure trie.

Use ptrie as:

>>> import ptrie
>>> sample_trie = trie()
>>> sample_strings = ['heyy', 'heyay', 'heyey', 'hyyy', 'yoyo', 'heeyy', 'hoeyy']
>>> for sample_string in sample_strings:
>>>     sample_trie.insert(sample_string)
>>> print(sample_trie.suggestions(prefix='he')
['heyy', heyay', heyey', 'heeyy']

Current Features

  • Adding arbitrary strings into trie
  • Searching for suggestion using prefix
  • Search whether any string is present in trie or not

ptrie right now supports 3.4–3.7, and runs great on PyPy.

Installation

To install ptrie, simply use all time fav pip and type :

$ pip install ptrie
✨🍰✨

Documentation

Coming Soon.

How to Contribute

  1. Initial plan to to integrate all necessary functionality that trie can offer into this library so that it can act as one place shot for everyone who is playing with trie.
  2. Please propose and feel free to raise and issue and then submit a PR for some sensible feature. Try to elaborate the implementational area where this feature would be applicable so that all of us can be enlightened :).
  3. I am planning to integrate research work done into this library as well so that it can provide advanced functionalities with tight algorithmic complexity bounds. Please feel free to share any paper.

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

pythontrie-0.1.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distribution

pythontrie-0.1-py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 3

Supported by

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