Object-relational zero-copy in-memory database layer for LMDB
Project description
zLMDB
zlmdb is a complete LMDB solution for Python providing two APIs in one package:
- Low-level py-lmdb compatible API - Direct LMDB access with full control
- High-level object-relational API - Type-safe ORM with automatic serialization
Key Features
Low-level LMDB API (py-lmdb compatible):
- Drop-in replacement for py-lmdb
- Direct access to LMDB transactions, cursors, and databases
- Full LMDB feature set (subdatabases, duplicate keys, etc.)
- Works with all py-lmdb examples and code
High-level Object-Relational API:
- Type-safe persistent objects with automatic serialization
- Multiple serializers (JSON, CBOR, Pickle, Flatbuffers)
- Export/import from/to Apache Arrow
- Native Numpy arrays and Pandas data frames support
- Automatic indexes and relationships
- Schema management
Implementation:
- CFFI-only (no CPyExt) for maximum compatibility
- Works on both CPython and PyPy
- Native binary wheels for x86-64 and ARM64
- Vendored LMDB (no external dependencies)
- High-performance with zero-copy operations
- Free software (MIT license)
Usage Examples
Low-level API (py-lmdb compatible):
import zlmdb.lmdb as lmdb
# Open database
env = lmdb.open('/tmp/mydb', max_dbs=10)
db = env.open_db(b'users')
# Write data
with env.begin(write=True) as txn:
txn.put(b'alice', b'alice@example.com', db=db)
txn.put(b'bob', b'bob@example.com', db=db)
# Read data
with env.begin() as txn:
email = txn.get(b'alice', db=db)
print(email) # b'alice@example.com'
High-level API (zlmdb ORM):
import zlmdb
# Define schema
class User(object):
def __init__(self, oid, name, email):
self.oid = oid
self.name = name
self.email = email
schema = zlmdb.Schema()
schema.users = zlmdb.MapUuidCbor(1, marshal=lambda obj: obj.__dict__)
# Use it
db = zlmdb.Database('/tmp/mydb', schema=schema)
with db.begin(write=True) as txn:
user = User(uuid.uuid4(), 'Alice', 'alice@example.com')
schema.users[txn, user.oid] = user
Development Workflow
This project uses just as a modern task runner and uv for fast Python package management.
Complete Recipe List
Virtual Environment Management:
- [x]
just create [venv]- Create Python venv (auto-detects system Python if no arg) - [x]
just create-all- Create all venvs (cpy314, cpy313, cpy312, cpy311, pypy311) - [x]
just version [venv]- Show Python version - [x]
just list-all- List all available Python runtimes
Installation:
- [x]
just install [venv]- Install zlmdb (runtime deps only) - [x]
just install-dev [venv]- Install in editable mode - [x]
just install-tools [venv]- Install dev tools (pytest, sphinx, etc.) - [x]
just install-all- Install in all venvs
Testing - LMDB: 🧪
- [x]
just test-examples-lmdb- Test all LMDB examples (in default venv) - [x]
just test-examples-lmdb-addressbook [venv]- Test example LMDB address book - [x]
just test-examples-lmdb-dirtybench [venv]- Test example LMDB dirtybench - [x]
just test-examples-lmdb-dirtybench-gdbm [venv]- Test example LMDB dirtybench-gdbm - [x]
just test-examples-lmdb-nastybench [venv]- Test example LMDB nastybench - [x]
just test-examples-lmdb-parabench [venv]- Test example LMDB parabench
Testing - ORM: 🧪
- [ ]
just test [venv]- Run full test suite (both test directories) - [ ]
just test-quick [venv]- Quick pytest run - [x]
just test-single [venv]- Run test_basic.py - [x]
just test-pmaps [venv]- Run pmap tests - [x]
just test-indexes [venv]- Run index tests - [x]
just test-select [venv]- Run select tests - [ ]
just test-zdb-etcd/df/dyn/fbs [venv]- Individual zdb tests - [ ]
just test-zdb [venv]- All zdb tests - [ ]
just test-all- Test in all venvs - [ ]
just coverage [venv]- Generate HTML coverage report
Code Quality: ✨
- [x]
just autoformat [venv]- Auto-format code with Ruff (modifies files!) - [x]
just check-format [venv]- Check formatting with Ruff (dry run) - [x]
just check-typing [venv]- Run static type checking with mypy
Building: 📦
- [x]
just build [venv]- Build wheel - [x]
just build-sourcedist [venv]- Build sdist - [x]
just build-all- Build wheels for all venvs - [!]
just dist [venv]- Build both sdist and wheels - [x]
just verify-wheels [venv]- Verify all built wheels.
Publishing: 🚀
- [ ]
just publish [venv]- Upload to PyPI with twine
Documentation: 📚
- [x]
just docs [venv]- Build HTML docs with Sphinx - [x]
just docs-view [venv]- Build and open in browser - [x]
just docs-clean- Clean doc build artifacts
Cleaning: 🧹
- [x]
just clean- Clean everything (alias for distclean) - [x]
just clean-build- Remove build/ dist/ *.egg-info - [x]
just clean-pyc- Remove *.pyc __pycache__ - [x]
just clean-test- Remove .coverage .pytest_cache - [x]
just distclean- Nuclear clean (removes venvs too!)
Utilities: 🔧
- [ ]
just update-flatbuffers- Update from deps/ submodule - [ ]
just generate-flatbuffers-reflection- Generate reflection code - [ ]
just fix-copyright- Update copyright headers - [ ]
just setup-completion- Setup bash tab completion
Quick Start
# Install just and uv (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create virtual environment and install in development mode
just create
just install-dev
# Run tests
just test
# Build wheel
just build
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zlmdb-25.12.3.tar.gz.
File metadata
- Download URL: zlmdb-25.12.3.tar.gz
- Upload date:
- Size: 1.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c576bcc38f3c926d96999be5f9c5fcd180cdca5d2b581c023a467fd59feaaa64
|
|
| MD5 |
f311e0a794e853956bafa79637ca0596
|
|
| BLAKE2b-256 |
4069d403e26bc059a70578d0406b29cb239a9aa018e28d79f92b8106a1a7d8e5
|
File details
Details for the file zlmdb-25.12.3-pp311-pypy311_pp73-manylinux_2_34_aarch64.whl.
File metadata
- Download URL: zlmdb-25.12.3-pp311-pypy311_pp73-manylinux_2_34_aarch64.whl
- Upload date:
- Size: 233.5 kB
- Tags: PyPy, manylinux: glibc 2.34+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a32445dea95c0c80942efc7adddab2e8490d327184f18ae0c4d1598e34907b0
|
|
| MD5 |
088f0117871b5b40582decc3e5355478
|
|
| BLAKE2b-256 |
9b6e46a6022750897ca2119b757c327d4e128642842b102e60e478baf2ec62a9
|
File details
Details for the file zlmdb-25.12.3-pp311-pypy311_pp73-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: zlmdb-25.12.3-pp311-pypy311_pp73-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.8 MB
- Tags: PyPy, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae203d0679f291fb3ccf40b4ff456aa44fc01f94e973cf5470018efca1cf2963
|
|
| MD5 |
d211ba87a05b598c8cb206f023dc7bbc
|
|
| BLAKE2b-256 |
baaad0dc86a703b15936fbcb9f65d9125318e7b51476b119992d17d13bde66a5
|
File details
Details for the file zlmdb-25.12.3-pp311-pypy311_pp73-macosx_15_0_arm64.whl.
File metadata
- Download URL: zlmdb-25.12.3-pp311-pypy311_pp73-macosx_15_0_arm64.whl
- Upload date:
- Size: 1.6 MB
- Tags: PyPy, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b9d39e56b44ac2d7c6f4dfb328744e3b958740df29f0841209ed0056a62e81a
|
|
| MD5 |
390344de1c6c2c16212f2021ed7cac28
|
|
| BLAKE2b-256 |
91fefe92d43316e8cb4e187b97ea363a23d925b567891c7f1fb8158a2507ddba
|
File details
Details for the file zlmdb-25.12.3-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: zlmdb-25.12.3-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.14t, manylinux: glibc 2.24+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4fd9d76717719948fc7428ac189d8bf09fe429517f9086cd01f21092a9562cd
|
|
| MD5 |
2998c24438bbaa1580cfb9fde165baae
|
|
| BLAKE2b-256 |
9003c8d8a20e8d8ebd8e897c97d6233c129321f0b1243fafe46c187cf0209d88
|
File details
Details for the file zlmdb-25.12.3-cp314-cp314-win_amd64.whl.
File metadata
- Download URL: zlmdb-25.12.3-cp314-cp314-win_amd64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.14, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c909b5dec936f9859072c80a179ff6cd8aeb709f18c2aac1c4f5478f43ccbe66
|
|
| MD5 |
21970327b3fb6c99b4536a461c6d858d
|
|
| BLAKE2b-256 |
4809c0ed67fe3153f52adba9133005e1f701c05fe67d195367cf45fbcbeebc84
|
File details
Details for the file zlmdb-25.12.3-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: zlmdb-25.12.3-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.14, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c572dace5fc40806436d65a06da9bcc802897b07b1585253c0753df812c1bf4
|
|
| MD5 |
111e7fbc81e93998f93dac13782e930b
|
|
| BLAKE2b-256 |
03ad9e4f58da2606e53a30d41fcab292e664cf8b9cb39630673631755196ef28
|
File details
Details for the file zlmdb-25.12.3-cp314-cp314-macosx_15_0_arm64.whl.
File metadata
- Download URL: zlmdb-25.12.3-cp314-cp314-macosx_15_0_arm64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.14, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98cae845fa11ef5ff1694d2c5427e269ee205828c07be48cc67ea119915f05fe
|
|
| MD5 |
7eeaa78d2529480aac8fe14c25c554aa
|
|
| BLAKE2b-256 |
e311dffe0133d341fbb63db202133348ab8419fd038b61af2e0c529977666bb7
|
File details
Details for the file zlmdb-25.12.3-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: zlmdb-25.12.3-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f66151617c286e01af2a18c5a740e051701b35e3a1e0008ca7ee35daaf415ec
|
|
| MD5 |
c26eedd02856b5c758fff8181ed5fd22
|
|
| BLAKE2b-256 |
dabab565f9f08f87275b8f5a1a9df23ea70d6a3be393f88adefbb280bcf93bc9
|
File details
Details for the file zlmdb-25.12.3-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: zlmdb-25.12.3-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.13, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68b500e12036ad1125c5a195cab0c24842ad7853eeaf69ddae65147ea12be120
|
|
| MD5 |
1ecb05c7bbbfe66492786ec5ffcd1f56
|
|
| BLAKE2b-256 |
6cbe288db04d1b546931f18cdf26e91ee51ef2059ccbe98054ce8cf804a99001
|
File details
Details for the file zlmdb-25.12.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: zlmdb-25.12.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 439.2 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7cb7edb98dbdb13f12089d2561e1edb07c6b50cb8c73a3333891f0b19ee511c
|
|
| MD5 |
c2e14595c86a5d03995a26b3b09f3d28
|
|
| BLAKE2b-256 |
78bceda132ace57e3482beb57289a82cf4fbaaf0fbaad42c9d3a13ff3163535a
|
File details
Details for the file zlmdb-25.12.3-cp313-cp313-macosx_15_0_arm64.whl.
File metadata
- Download URL: zlmdb-25.12.3-cp313-cp313-macosx_15_0_arm64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.13, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e68e935a92f9cada724761d98f8e7e419c5c589d6f32fee4b9a75f0e2716b108
|
|
| MD5 |
7ffb100a4f0136269b5449c54db88ff4
|
|
| BLAKE2b-256 |
c012be878479dd542e530864b4b206f649a0cbee611eab136e2cadab8ce51acc
|
File details
Details for the file zlmdb-25.12.3-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: zlmdb-25.12.3-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29117b119a2771571aed22a9cfb172599c43a10b36910a915eb797a4ee244eb0
|
|
| MD5 |
3df53fb3acae5eb52f70658837bdca68
|
|
| BLAKE2b-256 |
ded78d4a77786fdffb1b8aac5b210a450aa24929d17b7c8837e5a1e484431e60
|
File details
Details for the file zlmdb-25.12.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: zlmdb-25.12.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.12, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8764db60534aa3f1999439116518cb823268a943d932d83c6075519f6b5f38c0
|
|
| MD5 |
e065da7ba673481361acb42cd022bc33
|
|
| BLAKE2b-256 |
56f2cf6211dde7d2d7806075ce207e5d65e03b163fa350a0f15bd16d73e8d42f
|
File details
Details for the file zlmdb-25.12.3-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: zlmdb-25.12.3-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.12, manylinux: glibc 2.24+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f97656ab0a9e4f403edfec88730e051822d6cd5746a008bd17ea3b9d4e31564
|
|
| MD5 |
841a5b3337a8afd85aeee87a7ff5396b
|
|
| BLAKE2b-256 |
fa7bc565aa09791eacc86591be5c40409e027a28cc26819a4c05b7cc1e3425a4
|
File details
Details for the file zlmdb-25.12.3-cp312-cp312-macosx_15_0_arm64.whl.
File metadata
- Download URL: zlmdb-25.12.3-cp312-cp312-macosx_15_0_arm64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.12, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e09ec5353dd56f31a35325f3990c63be0db6f434d7713c9c8b4a5859e35b2d2
|
|
| MD5 |
8aa708e6ca86987a45353c1bc91d836f
|
|
| BLAKE2b-256 |
ddcc187892175c684aef506dafaf69c9e73e23e5a902fef337187f210c9e4d73
|
File details
Details for the file zlmdb-25.12.3-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: zlmdb-25.12.3-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46bbd146762b8e7e9e8630fb31643bf698cc6bff05cb922c3d1ac8aba73b4e18
|
|
| MD5 |
99bf41fe405e73c8b512aefd6edc80e9
|
|
| BLAKE2b-256 |
59f6bf6aecb0b353463bbf490c3f4b777f8f0aeeadb902a94ac8cbee07fed41e
|
File details
Details for the file zlmdb-25.12.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: zlmdb-25.12.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.11, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31ee3fd2b9c83b3e197fffdb56e0b5f094144f3755eb36d9964e2aa0430d4bd7
|
|
| MD5 |
ff89b06ba8ac802b95fec361ee368b56
|
|
| BLAKE2b-256 |
bc638c3c1663f7a0a1d9bcf965e2418ca126b9958ed25666149e833612740429
|
File details
Details for the file zlmdb-25.12.3-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: zlmdb-25.12.3-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.11, manylinux: glibc 2.24+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ab002933a96201abd0947006443095af2341f65f2c25e736cb45994fd4322ea
|
|
| MD5 |
38826a2714e14c02c3ac1f297b8cd07d
|
|
| BLAKE2b-256 |
a9ec260762e66bbcfab7c2afdf9bb56b5cc5c6d6e69ca2926c7613a03b62e8cd
|
File details
Details for the file zlmdb-25.12.3-cp311-cp311-macosx_15_0_arm64.whl.
File metadata
- Download URL: zlmdb-25.12.3-cp311-cp311-macosx_15_0_arm64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.11, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.1.dev12+g84cc26417 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1794b457fac5f9bb2cd8313395cbe07dece534c59fb14ec6a5ec55445f49940b
|
|
| MD5 |
bc278c0ff5e8381cf5958d46fb8385f2
|
|
| BLAKE2b-256 |
874ed84f5d62dbd936b8f5719d846b9b1c4017bb7378237d2099ab37b09988b6
|