Skip to main content

trie-cli

A CLI to interact with a global trie data structure.

Installation

Use the package manager pip to install trie-cli.

pip install trie-cli

Usage

The CLI includes methods to modify the global state of a trie hosted online.

Insert a keyword into the trie:

trie-cli insert [YOUR KEYWORD]

Delete a keyword from the trie:

trie-cli delete [YOUR KEYWORD]

Search for a keyword in the trie (returns True if the keyword is found/False if not):

trie-cli search [YOUR KEYWORD]

Return a list of autocomplete suggestions based on an input prefix

trie-cli autcomplete [YOUR PREFIX]

Display the trie (keywords are indicated with a * at the end of the node name):

trie-cli display

For detailed information on command format, run trie-cli --help.

Server

The trie-cli global state methods run on a Flask server hosted in Heroku. The global state of the trie is stored in a Neo4j graph database running in Neo4j Sandbox. Use the following REST endpoints to test the server.

Name Method curl
insert PUT curl -X PUT -H "Content-Type: application/json" -d '{"keyword"="[YOUR KEYWORD]"} "https://gentle-brushlands-20368.herokuapp.com/insert"
delete DELETE curl -X DELETE "https://gentle-brushlands-20368.herokuapp.com/delete?keyword=[YOUR KEYWORD]"
search GET curl -X GET "https://gentle-brushlands-20368.herokuapp.com/search?keyword=[YOUR KEYWORD]"
autocomplete GET curl -X GET "https://gentle-brushlands-20368.herokuapp.com/autocomplete?prefix=[YOUR PREFIX]"
display GET curl -X GET "https://gentle-brushlands-20368.herokuapp.com/display"

The CLI uses the requests Python library to call the server endpoints.

Tests

A list of commands for testing the CLI can be found in tests.sh.

Sources Consulted

CLI:

Neo4J:

Heroku:

PyPI:

License

MIT

Release files for trie-cli 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trie-cli 0.1.3
File Size Uploaded
trie-cli-0.1.3.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for trie-cli 0.1.3
File Interpreter ABI Platform
trie_cli-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 kB

Release files / trie-cli-0.1.3.tar.gz

Download URL trie-cli-0.1.3.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3a634adf7d54f943cc63803ec8201a411c4173b8ea5fb8ca7813240a81f82f46
BLAKE2b-256 checksum
How to use checksums
e3a0eb6e3c922548ec0dd333ff99bb34cc761512ad60b5be6022b64e82f23f0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

Release files / trie_cli-0.1.3-py3-none-any.whl

Download URL trie_cli-0.1.3-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c70828a2010ff4846b415bfaf9ef57dc39f4efad2df86a43cfe809583c1eb5e0
BLAKE2b-256 checksum
How to use checksums
e3f64aa3174b094d6c769ce25557c9985709d73c0cc3c7ed04e57c50ac47b013
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page