https://github.com/nndev1/triecli
SLINGSHOT take home project submission
https://github.com/nndev1/triecli
cli flask python trie
Last synced: about 1 month ago
JSON representation
SLINGSHOT take home project submission
- Host: GitHub
- URL: https://github.com/nndev1/triecli
- Owner: NNDEV1
- License: mit
- Created: 2021-10-23T18:30:40.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-07T23:03:29.000Z (over 4 years ago)
- Last Synced: 2025-03-18T13:46:47.996Z (over 1 year ago)
- Topics: cli, flask, python, trie
- Language: Python
- Homepage:
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://en.wikipedia.org/wiki/Trie)
* [Medium Article on Understand Tries](https://medium.com/basecs/trying-to-understand-tries-3ec6bede0014)
* [GeeksForGeeks Implementation(no code copied)](https://www.geeksforgeeks.org/trie-insert-and-search/)
### Built With
* [Flask](https://flask.palletsprojects.com/)
* [Requests](https://docs.python-requests.org/)
* [PyFiglet](http://www.figlet.org/)
* [PythonAnywhere](https://https://www.pythonanywhere.com/)
## Getting Started
* Install TrieCLI using ```pip install TrieCLI==0.0.2```
* Run ```import TrieCLI``` and you're all set!
* or optionally
* *Clone git repository*
* *Make sure correct packages are installed(Prerequisites)*
* *Run server.py* using ```python server.py``` inside 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