Metadata-Version: 2.1
Name: trie-cli
Version: 0.1.3
Summary: A CLI to interact with a global trie data structure.
Home-page: https://github.com/pmathur007/trie-cli
Author: Pranav Mathur
Author-email: pranavmathur001@gmail.com
License: UNKNOWN
Description: # trie-cli
        A CLI to interact with a global trie data structure.
        
        ## Installation
        
        Use the package manager [pip](https://pip.pypa.io/en/stable/) to install trie-cli.
        
        ```bash
        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:
        ```bash
        trie-cli insert [YOUR KEYWORD]
        ```
        Delete a keyword from the trie:
        ```bash
        trie-cli delete [YOUR KEYWORD]
        ```
        Search for a keyword in the trie (returns True if the keyword is found/False if not):
        ```bash
        trie-cli search [YOUR KEYWORD]
        ```
        Return a list of autocomplete suggestions based on an input prefix
        ```bash
        trie-cli autcomplete [YOUR PREFIX]
        ```
        Display the trie (keywords are indicated with a * at the end of the node name):
        ```bash
        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](https://neo4j.com/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:
        * [https://click.palletsprojects.com/en/7.x/](https://click.palletsprojects.com/en/7.x/)
        * [https://docs.python-requests.org/en/master/](https://docs.python-requests.org/en/master/)
        
        Neo4J:
        * [https://py2neo.org/2021.0/index.html](https://py2neo.org/2021.0/index.html)
        * [https://github.com/elena/py2neo-quickstart](https://github.com/elena/py2neo-quickstart)
        
        Heroku:
        * [https://realpython.com/flask-by-example-part-1-project-setup/](https://realpython.com/flask-by-example-part-1-project-setup/)
        
        PyPI:
        * [https://packaging.python.org/](https://packaging.python.org/)
        
        
        ## License
        [MIT](https://choosealicense.com/licenses/mit/)
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Description-Content-Type: text/markdown
