Metadata-Version: 2.1
Name: hugedict
Version: 1.3.3
Summary: A dictionary-like object that is friendly with multiprocessing and uses key-value databases (e.g., RocksDB) as the underlying storage.
Home-page: https://github.com/binh-vu/hugedict
License: MIT
Author: Binh Vu
Author-email: binh@toan2.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: lbry-rocksdb-optimized (>=0.8.1,<0.9.0)
Requires-Dist: loguru (>=0.6.0)
Requires-Dist: orjson (>=3.6.8,<4.0.0)
Requires-Dist: pybloomfiltermmap3 (>=0.5.5,<0.6.0)
Requires-Dist: tqdm (>=4.64.0,<5.0.0)
Requires-Dist: zstandard (>=0.17.0,<0.18.0)
Project-URL: Repository, https://github.com/binh-vu/hugedict
Description-Content-Type: text/markdown

# hugedict ![PyPI](https://img.shields.io/pypi/v/hugedict)

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

## Installation

```bash
pip install hugedict
```

## Usage

```python
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
)
```

