Skip to main content

Thread/Process safe shelves and other lsm-db helpers

Project description

Coveralls Drone CI Latest Version https://img.shields.io/pypi/wheel/lsm-db-extras.svg https://img.shields.io/pypi/pyversions/lsm-db-extras.svg https://img.shields.io/pypi/l/lsm-db-extras.svg

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')))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lsm-db-extras-0.4.0.tar.gz (3.8 kB view details)

Uploaded Source

File details

Details for the file lsm-db-extras-0.4.0.tar.gz.

File metadata

  • Download URL: lsm-db-extras-0.4.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/33.1.1 requests-toolbelt/0.8.0 tqdm/4.20.0 CPython/3.6.5

File hashes

Hashes for lsm-db-extras-0.4.0.tar.gz
Algorithm Hash digest
SHA256 96855be3e8dae031b841423f8cfe48588feb18bf61457945ee5bb9d238c598e9
MD5 51ffb0ac64f718eae8ff4fd7e14354c4
BLAKE2b-256 3ef694fcbfde8813dbdf3f1473901c9e6a4fb58863257ef2e4e685a7befe8c34

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page