abondis / basicKVstore

Basic python Key Value store using folders and files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Basic Key Value store

This is a basic Key-Value store library.

It uses folders as a hash, files as keys and files contents as values.

cat 'some#/hash#/path#/mykeyK'
>> this is the value of mykey

Hashes are systematically appended the ‘#’ character. Keys are systematically appended the ‘K’ character.

TODO

  • be able to remove keys/hashes

Usage

Add a value

This is done using the configure function.

This will add the key myKey to the hash this/is/a/hash under the folder /tmp/test.

It sets the myKey’s value to some value

kv.configure('/tmp/test', 'this/is/a/hash', 'myKey', 'some value')

Get a key’s value

get_config function.

kv.get_config('/tmp/test', 'this/is/a/hash', 'myKey')
>>> 'some value'

About

Basic python Key Value store using folders and files

License:GNU General Public License v2.0


Languages

Language:Python 100.0%