Skip to main content

General Purpose Trie Data Structure in Python

Project description

pythontrie : Python Implementation of Trie Data Structure

image License

image

pythontrie includes sweet implementation of our favourite data structure trie in python.

Usage:

>>> from pythontrie import trie
>>> sample_trie = trie()
>>> sample_strings = ['heyy', 'heyay', 'heyey', 'hyyy', 'yoyo', 'heeyy', 'hoeyy']
>>> for sample_string in sample_strings:
>>>     sample_trie.insert(sample_string)

Then printing suggestions is as simple as:

>>> 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

pythontrie right now supports all python versions

Installation

To install pythontrie, simply use all time favorite pip and type :

$ pip install pythontrie
✨🍰✨

Documentation

Coming Soon.

How to Contribute

  1. Initial plan is 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 an issue and submit a PR for some sensible feature. Try to elaborate the the area where this feature would be applicable so that all of us can be enlightened :).
  3. I am planning to integrate research work done on tries 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.3.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

pythontrie-0.3-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pythontrie-0.3.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

File hashes

Hashes for pythontrie-0.3.tar.gz
Algorithm Hash digest
SHA256 fc1424b35176e2e25a120c4d38dc047e2b6317d41d94031e9ce78f0ad50ce8bc
MD5 d91c17482a1e831bbe35d0fd7bb248f5
BLAKE2b-256 11e97c315b247d975044b776b9a6ec54cb3d5fafbdf424a2cb085692595fa38e

See more details on using hashes here.

File details

Details for the file pythontrie-0.3-py3-none-any.whl.

File metadata

  • Download URL: pythontrie-0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

File hashes

Hashes for pythontrie-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a31f3500b8da6a0476be3624f562999d873e68e321d859c9ce32f27ddbc0b154
MD5 a2166c7c6d3e664788ed499eafdc4562
BLAKE2b-256 f597499d6232303b568812035d2acb891e3c33f9cf09e972ec924d3a11ca0328

See more details on using hashes here.

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