Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mosquito/lsm-db-extras
Thread/Process safe shelves and other lsm-db helpers
https://github.com/mosquito/lsm-db-extras
lsm-db persistent-storage python shelf shelves simple simple-api storage
Last synced: 17 days ago
JSON representation
Thread/Process safe shelves and other lsm-db helpers
- Host: GitHub
- URL: https://github.com/mosquito/lsm-db-extras
- Owner: mosquito
- License: apache-2.0
- Created: 2017-02-09T22:14:02.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-24T14:05:03.000Z (almost 6 years ago)
- Last Synced: 2024-11-30T17:48:16.284Z (22 days ago)
- Topics: lsm-db, persistent-storage, python, shelf, shelves, simple, simple-api, storage
- Language: Python
- Homepage:
- Size: 24.4 KB
- Stars: 1
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
lsm-db-extras
=============.. image:: https://coveralls.io/repos/github/mosquito/lsm-db-extras/badge.svg?branch=master
:target: https://coveralls.io/github/mosquito/lsm-db-extras
:alt: Coveralls.. image:: https://cloud.drone.io/api/badges/mosquito/lsm-db-extras/status.svg
:target: https://cloud.drone.io/mosquito/lsm-db-extras/
:alt: Drone CI.. image:: https://img.shields.io/pypi/v/lsm-db-extras.svg
:target: https://pypi.python.org/pypi/lsm-db-extras/
:alt: Latest Version.. image:: https://img.shields.io/pypi/wheel/lsm-db-extras.svg
:target: https://pypi.python.org/pypi/lsm-db-extras/.. image:: https://img.shields.io/pypi/pyversions/lsm-db-extras.svg
:target: https://pypi.python.org/pypi/lsm-db-extras/.. image:: https://img.shields.io/pypi/l/lsm-db-extras.svg
:target: https://pypi.python.org/pypi/lsm-db-extras/Thread/Process safe shelves and other lam-db helpers
Installation
------------.. code-block:: shell
pip install lsm-db-extras
Usage example
-------------.. code-block:: python
from lsm_extras import Shelf, LSMDict, LSMTree
with Shelf("/tmp/test.ldb") as shelf:
shelf["foo"] = Truewith Shelf("/tmp/test.ldb") as shelf:
print(shelf["foo"])with LSMDict("/tmp/test-dict.ldb") as storage:
storage[1] = Truewith 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')))