Skip to main content

CLI for communicating with a Trie hosted online

Project description

Py-Trie

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.

Requirements

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

  • Python 3.8 or higher
  • Pip

Installation

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 test.py 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

Usage

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

Insert

To insert a word:

pytrie insert [WORD]

Remove

To remove a word:

pytrie remove [WORD]

Search

To search a word:

pytrie search [WORD]

Autocomplete

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

pytrie autocomplete [PREFIX]

Display

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file py-trie-1.0.0.tar.gz.

File metadata

  • Download URL: py-trie-1.0.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.8

File hashes

Hashes for py-trie-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5a534a6a565611c79036fb05c8301b52b4ea76903cd2d9fd11a23bb64b6fd322
MD5 2b6da596ceab5fd2e347dfe64b65f08b
BLAKE2b-256 855d9674e489b4105698fa41b99b10116d25ea7abadd1d1d608af5bd0c0eb4fc

See more details on using hashes here.

File details

Details for the file py_trie-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: py_trie-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.8

File hashes

Hashes for py_trie-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a4efece631e0d1b1388eecbbab33a66b78d1c64e72ae3c9a0e11868ea04c202
MD5 308260085b28c033f06e76bc6f203ffe
BLAKE2b-256 5f19be9f4a91f1dbd011fb7d4a18f6fa1a72b5e8a2b5f3a40bfdb8dfd6538c20

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