Nook is a command-line interface (CLI) application that allows you to manage key-value pairs. It provides functionality to add, delete, and retrieve key-value pairs using simple commands. This project uses the Click library for the CLI interface and pickle for data persistence. It can also be used programmatically.
- Add key-value pairs.
- Delete key-value pairs.
- Retrieve values by key.
- Can be used as a quick database solution in development
- Can be used to store environment keys and possibly other config keys.
pip install nook
To get started with nook, clone this repository and install the required dependencies.
git clone https://github.com/jerrygeorge360/nook.git
cd nook
pip install -r requirements.txt
To add a key-value pair, use the add
command with the --key
(or -k
) and --value
(or -v
) options.
nook add --key yourkey --value yourvalue
To delete a key-value pair, use the delete
command with the --key
(or -k
) option.
nook delete --key yourkey
To retrieve a value by key, use the get_value
command with the --key
(or -k
) option.
nook getvalue --key yourkey
from nook import add,delete,getvalue
# add new key value
add.callback('key', 'value')
# get new key value
getvalue.callback('key')
# delete new key and value
delete.callback('key')
-
add
: Adds a key-value pair to the hashmap.- Options:
-k, --key TEXT
: Key to add.-v, --value TEXT
: Value to add.
- Options:
-
delete
: Deletes a key-value pair from the hashmap.- Options:
-k, --key TEXT
: Key to delete.
- Options:
-
getvalue
: Retrieves the value for a given key.- Options:
-k, --key TEXT
: Key to get the value for.
- Options:
.
├── main.py
├── commands.py
├── utils.py
├── hashmap.pickle
├── requirements.txt
└── README.md
main.py
: The main entry point for the CLI application.commands.py
: Contains the CLI commands for the application.utils.py
: Contains utility functions and classes used by the application.hashmap.pickle
: File used to persist the hashmap data.requirements.txt
: File listing the dependencies required for the project.README.md
: This file.
- Python 3.6 or higher
- Click library
This project is licensed under the MIT License