Skip to main content

A fast RocksDB wrapper for Python using pybind11.

Project description

PyPI version Python versions

pyrex-rocksdb

A python wrapper, for the C++ version of RocksDB.

Motivation

rocksdb python wrappers are broken. This is yet another attempt to create a working python wrapper for rocksdb.

Example usage:

Check the test.py file.

Installation

Note on CICD The wheels provided are not completely platform-independent at the moment. I heavily rely on github actions to develop since I don't own mac or windows machines. The CICD workflow for package builds is under development A windows/macos/linux build was successful, but further development is needed.

Linux/WSL

The library comes with RocksDB 9 pre-packaged and statically linked.

Install simply with

pip install pyrex-rocksdb

A version that dynamically links Ubuntu's rocksdb was also tried, but presented runtime errors in Ubuntu 24 default rocksdb (v9).

MacOS/Windows

There is an early version of the library in pypi for windows and MacOS.

Build and Use the Wrapper: After saving the files, follow these steps to build and use your Python wrapper:

Prerequisites:

  • RocksDB C++ Library Installed (headers and libraries accessible). (in Ubuntu sudo apt-get install librocksdb may suffice)

  • C++11 compatible compiler (e.g., g++ or clang++).

  • Python 3.7+ and its development headers.

  • Python pybind11 package: pip install pybind11

Python setuptools package: pip install --upgrade setuptools

Adjust setup.py (if needed):

Open setup.py and verify that include_dirs and library_dirs correctly point to your RocksDB installation paths. If RocksDB is not in /usr/local/include or /usr/local/lib, update these paths.

If RocksDB was built with specific compression libraries (like Snappy, Zlib, LZ4, Zstandard), add their corresponding names (e.g., 'snappy', 'z') to the libraries list.

Compile the Wrapper: Navigate to the directory containing rocksdb_wrapper.cpp and setup.py in your terminal, and run:

# build with pyproject.toml (uses setup.py for some programmatic parts)
pip install build
python -m build

For PyPi compatible build

Either rely on the CICD/Actions to work, or use a local .toml:

cibuildwheel --platform linux --config-file pyproject_localbuild.toml 

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyrex_rocksdb-0.1.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pyrex_rocksdb-0.1.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pyrex_rocksdb-0.1.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pyrex_rocksdb-0.1.2-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pyrex_rocksdb-0.1.2-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file pyrex_rocksdb-0.1.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyrex_rocksdb-0.1.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4265f93961278017e0ed3a79c58771d3fc11da834c1bc77921c136f46c0ce056
MD5 63b2d0dc4d73b8024d5d0c199dd9bfbf
BLAKE2b-256 85c5b484c3caa9174f0167bb1242163c37f596bc18ec128e2dc380411e8131ec

See more details on using hashes here.

File details

Details for the file pyrex_rocksdb-0.1.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyrex_rocksdb-0.1.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e97963482f012a89df09c27de9ba9986a018fab2ae507dc9bdf4f0ad2c19062f
MD5 9597942fb83376856b07e81feb2d6f05
BLAKE2b-256 45542e6c40e3c44f7c388425b456391c4c28a7ec1c35dcde2fffd04980e1792f

See more details on using hashes here.

File details

Details for the file pyrex_rocksdb-0.1.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyrex_rocksdb-0.1.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0ee542b3d604692128f532d70f8cfccee985628a046689868afe9bd1d2514e4f
MD5 7b76ff25a93371bc36d8f5728c4d11ea
BLAKE2b-256 135ced5cde5b8e28bfdc1e942d531ae5c1f68e761ff0c7f2519d773e9bbdcb5f

See more details on using hashes here.

File details

Details for the file pyrex_rocksdb-0.1.2-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyrex_rocksdb-0.1.2-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a149d4c27db1d3427021e710723c3bd9683bf83160971af8baf7680acc37a61d
MD5 0bb95f265797aeee131bef827ff52a4d
BLAKE2b-256 17845f2ecc4059878e49757f21add380ed438e68dca5d0676542dc9bf69c342a

See more details on using hashes here.

File details

Details for the file pyrex_rocksdb-0.1.2-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyrex_rocksdb-0.1.2-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 164e6ba94813ead9e3ee519e9d8a56fcb64816d1ae986fac221a5857165f3737
MD5 86b0994af1b423f9b90a01b496f8bd7e
BLAKE2b-256 8a07e35155b69edbbf14140bdca7012e97da63d2a4367f9185acc1467960f1c1

See more details on using hashes here.

Supported by

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