Socket
Socket
Sign inDemoInstall

trie-cli

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trie-cli

A CLI to interact with a global trie data structure.


Maintainers
1

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.

NameMethodcurl
insertPUTcurl -X PUT -H "Content-Type: application/json" -d '{"keyword"="[YOUR KEYWORD]"} "https://gentle-brushlands-20368.herokuapp.com/insert"
deleteDELETEcurl -X DELETE "https://gentle-brushlands-20368.herokuapp.com/delete?keyword=[YOUR KEYWORD]"
searchGETcurl -X GET "https://gentle-brushlands-20368.herokuapp.com/search?keyword=[YOUR KEYWORD]"
autocompleteGETcurl -X GET "https://gentle-brushlands-20368.herokuapp.com/autocomplete?prefix=[YOUR PREFIX]"
displayGETcurl -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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc