lsm-db-extras

Thread/Process safe shelves and other lsm-db helpers


Keywords
lsm-db, persistent-storage, python, shelf, shelves, simple, simple-api, storage
License
Apache-2.0
Install
pip install lsm-db-extras==0.5.0

Documentation

lsm-db-extras

Coveralls Drone CI Latest Version

Thread/Process safe shelves and other lam-db helpers

Installation

pip install lsm-db-extras

Usage example

from lsm_extras import Shelf, LSMDict, LSMTree

with Shelf("/tmp/test.ldb") as shelf:
    shelf["foo"] = True


with Shelf("/tmp/test.ldb") as shelf:
    print(shelf["foo"])


with LSMDict("/tmp/test-dict.ldb") as storage:
    storage[1] = True


with LSMDict("/tmp/test-dict.ldb") as storage:
    print(storage[1])


with LSMTree("/tmp/test-tree.ldb") as storage:
    with tree.transaction():
        for i in range(10):
            tree['numbers', i] = i * 2
            tree['strings', i] = str(i)

    print(list(tree.find('strings')))