Skip to main content

CLI for communicating with a Trie hosted online

Project description


Py-Trie is a command-line interface which enables communication with a global trie hosted on the Google Cloud Platform. Users can execute basic commands such as inserting, deleting, and searching words in the trie. A list of matching words can be generated through an input prefix. Users are also able to display the words present in the trie.


The following are required to be installed on your system before using Py-Trie:

  • Python 3.8 or higher
  • Pip


To install Py-Trie, run the following command:

pip install py-trie

Testing Suite

There are several test cases that can be found in the file located in the cli/pytrie folder. These tests execute the commands listed in the Usage section. Some tests also simulate multiple users sending requests to the server by running processes on different threads.

To run all the test cases with the trie, run:

pytrie test


There are 5 basic commands that can be executed using Py-Trie:

  • Insert
  • Remove
  • Search
  • Autocomplete
  • Display

To get a list of all possible commands, run:

pytrie --help


To insert a word:

pytrie insert [WORD]


To remove a word:

pytrie remove [WORD]


To search a word:

pytrie search [WORD]


To generate a list of matching words based on a prefix:

pytrie autocomplete [PREFIX]


To display all existing words in the trie:

pytrie display

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

py-trie-1.0.0.tar.gz (4.4 kB view hashes)

Uploaded source

Built Distribution

py_trie-1.0.0-py3-none-any.whl (5.0 kB view hashes)

Uploaded py3

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