A LSM-Tree key/value database in Python
Project description
soonerdb
A LSM-Tree key/value database in Python.
Free software: MIT license
Documentation: https://soonerdb.readthedocs.io.
This project started as a learning tool when studing the excelent book “Designing data-intensive applications” by Martin Kleppmann.
Features
Pure Python fast LSM-Tree based key/value database.
Embedded and zero-conf.
Support in-order traversal of all stored keys.
On-disk database persistence.
Data is durable in the face of application or power failure.
Thread-safe.
Python 3.6+.
📝 TODO List
[ ] Deletion of keys.
[ ] Background merge of segment files (segment files are merged at load time).
Installation
You can install using pip:
pip install soonerdb
Or from source:
git clone https://github.com/fgmacedo/soonerdb
cd soonerdb
python setup.py install
Quick intro
SoonerDB has a dict-like API.
Showtime:
In [1]: from soonerdb import SoonerDB
In [2]: db = SoonerDB('./tmp')
In [3]: db["my key"] = "A value"
In [4]: db["my key"]
Out[4]: 'A value'
In [5]: "my key" in db
Out[5]: True
In [6]: "other key" in db
Out[6]: False
In [7]: db["other key"]
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-7-bc114493f395> in <module>
----> 1 db["other key"]
KeyError: "Key 'other key' not found."
In [8]: db.get("other key", "default value")
Out[8]: 'default value'
In [9]: db.set("another", "value")
In [10]: list(db)
Out[10]: [('another', 'value'), ('my key', 'A value')]
History
0.1.0 (2020-12-18)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for soonerdb-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddeff5353ce9bed59bc409882f6d7f9b3a1ff9789832e2351b6f104471b2d2a3 |
|
MD5 | bee0226b5c4517c11b292c86b0b54063 |
|
BLAKE2b-256 | b188423e55126531846356b5341e53b104d3646bc2c2c222a8d28a35e8b4430e |