Nook
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 as a libray.
Features
- Add key-value pairs.
- Delete key-value pairs.
- Retrieve values by key.
Usage
- Can be used as a quick database solution in development
- Can be used to store environment keys and possibly other config keys.
Installation
Using pip
pip install nook
From github
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
Usage
through the terminal
Adding a Key-Value Pair
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
Deleting a Key-Value Pair
To delete a key-value pair, use the delete command with the --delete (or -d) option.
nook delete --delete yourkey
Retrieving a Value
To retrieve a value by key, use the get_value command with the --getvalue (or -g) option.
nook getvalue --key yourkey
Programmatic usage
from nook import add,delete,getvalue
add.callback('key','value')
getvalue.callback('key')
getvalue.callback('key')
delete.callback('key')
Commands
-
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:
Project Structure
.
├── 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.
Requirements
- Python 3.6 or higher
- Click library
License
This project is licensed under the MIT License
Metadata
Release files for nook 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nook-0.1.1.tar.gz | 4.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nook-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.0 kB
Release files / nook-0.1.1.tar.gz
| Download URL | nook-0.1.1.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b465c0d8d87100bb905a40dd277f82f38a7a234bc953a8afae871c33cc80eb57
|
|
BLAKE2b-256 checksum How to use checksums |
589f74860b13bbd835e084bd20513a7cec3c4a69f89eb9603f9e33f448d93056
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / nook-0.1.1-py3-none-any.whl
| Download URL | nook-0.1.1-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d534f7fe54eee42fec67d0f268ab1bb5f67a9c27d6e72ec55c8d4e132dd41f4
|
|
BLAKE2b-256 checksum How to use checksums |
cd3cacb6edf6c571b0d3ed47e1bfd8c73c845302b6dc5dccfc7a75df74a9ce61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|