A CLI to interact with a global trie data structure.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trie-cli-0.1.3.tar.gz.
File metadata
- Download URL: trie-cli-0.1.3.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a634adf7d54f943cc63803ec8201a411c4173b8ea5fb8ca7813240a81f82f46
|
|
| MD5 |
b1e75939697203a01fcb70b4be46a3bd
|
|
| BLAKE2b-256 |
e3a0eb6e3c922548ec0dd333ff99bb34cc761512ad60b5be6022b64e82f23f0e
|
File details
Details for the file trie_cli-0.1.3-py3-none-any.whl.
File metadata
- Download URL: trie_cli-0.1.3-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c70828a2010ff4846b415bfaf9ef57dc39f4efad2df86a43cfe809583c1eb5e0
|
|
| MD5 |
c3bc1667019ff54579cc78c9b060d6eb
|
|
| BLAKE2b-256 |
e3f64aa3174b094d6c769ce25557c9985709d73c0cc3c7ed04e57c50ac47b013
|