A simple in memory kv store in core lib python
Getting started
·
Run tests
An in memory kv store in core lib python. Usable as an example for implementing a in memory kv store in python, where performance is not the main consideration. Transactions are implemented using a rudimentary state machine. the cli has been implemented using CMD.
A recent python 3.8+ install is required. No dependencies to install.
The program can be started with:
python main.py
- SET a key value pair
SET Key Value
- GET a value related to a key.
GET Key
- UNSET (remove) a key value pair.
UNSET Key
- Return the count of values equal to a value.
NUMEQUALTO Value
- Begin a transaction.
BEGIN
- Commit a transaction, making it permanent.
And exit the transaction.
COMMIT
- Revert a transaction,
reverting back to the state at the beginning of the transaction.
And exit the transaction.
ROLLBACK
- List commands
?
- Help on specific command
? <command>
- Return the total contents of the store
LIST
The tests can be started with:
python tests/tests.py