Skip to main content

A dictionary-like object that is friendly with multiprocessing and uses key-value databases (e.g., RocksDB) as the underlying storage.

Project description

hugedict PyPI

A dictionary-like object that is friendly with multiprocessing and uses key-value databases (e.g., RocksDB) as the underlying storage.

Installation

pip install hugedict

Usage

from hugedict.rocksdb import RocksDBDict

# replace K and V for the types you are using
mapping: Dict[K, V] = RocksDBDict(
    dbpath,  # path to db file
    create_if_missing=create_if_missing,  # whether to create database if missing
    read_only=read_only,  # open database in read only mode
    deser_key=bytes.decode,  # decode the key from bytes
    ser_key=str.encode,  # encode the key to bytes
    deser_value=bytes.decode,  # decode the value from bytes
    ser_value=str.encode,  # encode the value from bytes
    db_options=db_options,  # other rocksdb options
)

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

hugedict-1.4.0.tar.gz (11.7 kB view hashes)

Uploaded Source

Built Distribution

hugedict-1.4.0-py3-none-any.whl (15.0 kB view hashes)

Uploaded Python 3

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