Skip to content

A basic in-memory Key value store in dependency free Python

License

Notifications You must be signed in to change notification settings

remcoeijsackers/kvstore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


simple kv store

A simple in memory kv store in core lib python
Getting started · Run tests

Abstract

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.

Getting started

1. Installation

A recent python 3.8+ install is required. No dependencies to install.

The program can be started with:

python main.py

2. core Commands

  1. SET a key value pair
    SET Key Value
  2. GET a value related to a key.
    GET Key
  3. UNSET (remove) a key value pair.
    UNSET Key
  4. Return the count of values equal to a value.
    NUMEQUALTO Value
  5. Begin a transaction.
    BEGIN
  6. Commit a transaction, making it permanent. And exit the transaction.
    COMMIT
  7. Revert a transaction, reverting back to the state at the beginning of the transaction. And exit the transaction.
    ROLLBACK

(back to top)

3. helper commands

  1. List commands
    ?
  2. Help on specific command
    ? <command>
  3. Return the total contents of the store
    LIST

(back to top)

Tests

The tests can be started with:

python tests/tests.py

(back to top)

About

A basic in-memory Key value store in dependency free Python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages