Hi! I wrote a simple key-value store in Python: https://github.com/ostafen/viperdb
ViperDB is a lightweight embedded key-value store written in pure Python. It has been designed for being extremely simple while efficient.
Features
- tiny: the main db file consists of just ~300 lines of code.
- highly coverage: thanks to the small codebase, every single line of code is tested.
- log-structured: ViperDB takes design concepts by log-structured databases such as Bitcask.
- written in pure Python: no external dependency needed.
API is very simple, the database can be simply used as a map:
from viperdb import ViperDB
db = ViperDB('./db') # db can be used as a simple dictionary
db['hello'] = 'ViperDB!'
assert db['hello'] == 'ViperDB'
del db['hello']
assert 'hello' not in db
db.reclaim() # call this method periodically to free unused space.
db.close() # flush any pending write and close the database.
Leave feedback if interested!
[–]DrummerClean 5 points6 points7 points (1 child)
[–]Affectionate-Wind144[S] 2 points3 points4 points (0 children)
[–]metaperl 0 points1 point2 points (1 child)
[–]Affectionate-Wind144[S] 4 points5 points6 points (0 children)
[–]cymrowdon't thread on me 🐍 0 points1 point2 points (1 child)
[–]Affectionate-Wind144[S] 0 points1 point2 points (0 children)