tool ·rdbpy

RocksDB for Python in one pip install.

Real Cython bindings for RocksDB. Ships as one wheel on Linux and macOS, Intel and Apple Silicon. Iterators, snapshots, transactions, merges. No system libs to fight, no toolchain to install.

Powered byRocksDB

What it is.

A Python package that opens a RocksDB database and talks to it directly. No sidecar server, no bridge process. Just import and call.

The whole RocksDB surface, mapped to Python.

Databases, options, iterators, snapshots, transactions, merge operators, column families, backups. Bindings are written in Cython and compiled against a bundled RocksDB, so the wheel is self-contained.

What you get.

Existing RocksDB bindings for Python assume you already have RocksDB, Snappy, LZ4, and Zstd on the system, at the right versions. rdbpy bundles them into the wheel, so pip install is the whole install story.

One pip install.

RocksDB and its compression libs ride in the wheel.

Cython, not ctypes.

Tight bindings over the C++ API, not a thin wrapper.

Full surface.

Transactions, snapshots, merge operators, column families all exposed.

Open a database.

Open the DB, put and get bytes, wrap writes in a transaction.

Iterators, snapshots, and merge operators come from the samedb object. The C++ semantics carry over one-to-one.

db.py
python · 19 locpy
import rdbpy
# open a database
db = rdbpy.DB('/tmp/mydb', rdbpy.Options(create_if_missing=True))
# put, get
db.put(b'user:1', b'ada')
db.get(b'user:1') # -> b'ada'
# atomic writes: open a TransactionDB
txdb = rdbpy.TransactionDB('/tmp/mytxdb',
rdbpy.Options(create_if_missing=True),
txn_db_opts=rdbpy.TransactionDBOptions())
txn = txdb.begin_transaction()
txn.put(b'user:2', b'grace')
txn.put(b'user:3', b'hedy')
txn.commit()
txn.close()

Like what you see?

The project is young. Star it, join the room, watch what we ship next.