A command line interface implmenting the trie data structure
Project description
trie_project CLI
SLINGSHOT take home project submission
Demo Video
maybe?
About The Project
Using the Trie data structure to create a usable command line interface with various commands such as add, remove, and search by prefix. I used figlet for a nice looking interface, I used flask and requests to implement the cli with the global state. Lastly I used PythonAnywhere to host the whole thing.
A list of commands are as follows:
help: shows all commands available through the cli
add_[words]: adds words or a word to the trie
remove_[words]: deletes words or a word from the trie
search_[words]: searches for the words or word in the trie and returns words found and not found
visualize: displays all items currently in the trie
searchbyprefix_[prefix]: returns all items in the trie starting with the given prefix
Here are some resources I used to build this project:
- Wikipedia Article for a Trie
- Medium Article on Understand Tries
- GeeksForGeeks Implementation(no code copied)
Built With
Getting Started
- Clone git repository
- Make sure correct packages are installed(Prerequisites)
- Run server.py using
python server.pyinside triecli
Example run:
If you would like to run elsewhere change the link at line 49 in server.py and make sure you have the files: trie1.py, app.py, server.py
Prerequisites
This is an example of how to list things you need to use the software and how to install them.
- flask
pip install flask - pyfiglet
pip install pyfiglet - requests
pip install requests - Make sure you have python 3
License
Distributed under the MIT License. See LICENSE for more information.
Contact
Nalin Nagar - nalinnagar1@gmail.com
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 TrieCLI-0.0.2.tar.gz.
File metadata
- Download URL: TrieCLI-0.0.2.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da07fb4f5a8be9ede397b0c346487b04f6c844bf12b03d73b07ee66b1acfffaf
|
|
| MD5 |
c3a829eb1c0a218b6afc9777717d4571
|
|
| BLAKE2b-256 |
c3c70cf98432c8f0e83b33a97b00bbee6fd99f794bfeb23d4b5290c960cf40fe
|
File details
Details for the file TrieCLI-0.0.2-py3-none-any.whl.
File metadata
- Download URL: TrieCLI-0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c05ae829bfa336a92b449d01e999df2508b589ba434239ac13b6d328fd76cd7
|
|
| MD5 |
9adad7bef72c5188a18b10b504ff06fe
|
|
| BLAKE2b-256 |
5ec6feda9d3b22e1c2fc34e3dc471db4eb0ba03c128f5a54fab2a6fd55b55723
|