This is a Command Line Interface (CLI) App built using python to implement Key-Value Store.
For illustrating the concept, the key-value pair considered is-
Key - Employee ID
Value - Name
Firebase database is used to store the Data. The mode opted for the db is "Realtime Database in Test Mode".
The basic structure of the Database looks like this-
Now, Firebase provides a REST API for the database. Hence, this API is used to develop the CLI commands as illustrated -
All the commands start with - employee
employee --help
employee add (employee_id) -n (employee_name)
The command inserts a new entry to the database, as shown, however if the employee_id is already there, it shows a message saying "Employee ID is already assigned to someone, use another ID "
employee list-all
employee view (employee_id)
employee update (employee_id) -n (name)
If the user tries to update an existing id, it does that very smoothly, however, if a value that is not in the database, is accessed, it shows a message saying "The Employee you're trying to update dosen't exist, you may add new !!"
employee delete (employee_id)
System requirements - The system must have python (3.4 or later) installled in it- Download the repository, and unzip it
- Open the PowerShell at the root directory, (the directory containg the file 'setup.py')
- run pip install virtualenv
- run virtualenv env
- run env\Scripts\activate
- Now add the path to the database to your system variables
- Variable Name : URL
- Variable Value/Path : https://key-value-store-cli.firebaseio.com/
- run pip install --editable .
- run the command employee --help
Now try to execute all the above commands mentioned!! 👽 👍