skillfed

lmdb

Universal Python binding for the LMDB 'Lightning' Database

lmdb v2.3.0 4.8M downloads/30d#2,216 on PyPI747
License unclear OLDAP-2.8 Active released

What it is and what it does

py-lmdb is a Python wrapper around the LMDB C library, a high-performance embedded key-value database that uses memory-mapped files for fast, efficient access. It allows you to store and retrieve binary data with ACID transaction support, making it suitable for applications that need a lightweight, durable local database without the overhead of a server process.

The package has been maintained since 2013 and currently supports Python 3.9 and later, including PyPy. It provides no runtime dependencies beyond the compiled LMDB library itself, so installation is straightforward on platforms with pre-built wheels. The library is commonly used in data-intensive applications, caching layers, and scenarios where you need fast, transactional access to structured data without running a separate database service.

Use it for:

  • Building a local cache layer for machine learning pipelines or data processing workflows that need fast key-value lookups.
  • Storing embeddings or feature vectors in a searchable, persistent format for similarity search or retrieval tasks.
  • Implementing a lightweight session store or state management system for applications that don't require a full database server.
  • Archiving or indexing large datasets where memory-mapped access provides performance benefits over traditional file I/O.
  • Creating a transaction-safe local database for desktop or embedded applications with minimal external dependencies.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a Python binding to LMDB (Lightning Memory-Mapped Database), a fast key-value store based on memory-mapped files for efficient data access and storage.

Yes, if you need a fast, embedded key-value database with transaction support and have Python >= 3.9. The package is actively maintained, has no known vulnerabilities, and offers pre-built wheels for most platforms. Verify that the OLDAP-2.8 license is compatible with your use case before committing to production use.

Install

lmdb on PyPI

pip

pip install lmdb

uv

uv add lmdb

poetry

poetry add lmdb

Installing lmdb

Before you install

Medium install friction due to compiled C extension wheels, but pre-built wheels are available for common platforms (macOS, Linux, Windows) and Python versions 3.10–3.13. Last release 33 days ago; repository is active with 747 stars.

License in practice

License treatment is unclear (OLDAP-2.8); review the repository's license file and terms before use in proprietary or redistributed software to confirm compatibility with your project.

Quickstart

import lmdb

env = lmdb.open('/path/to/db')
with env.begin(write=True) as txn:
    txn.put(b'key', b'value')
with env.begin() as txn:
    print(txn.get(b'key'))

Requires Python >= 3.9; compiled C extension requires a C compiler or pre-built wheel for your platform.

Verify before relying

  • Specific performance characteristics (throughput, latency, memory overhead) compared to other embedded databases.
  • Whether OLDAP-2.8 license is compatible with your intended use case (proprietary, commercial, or open-source redistribution).
  • Concurrency model and transaction isolation guarantees under multi-process or multi-threaded access patterns.

Package facts

License OLDAP-2.8 (unclear)
Python support supports the current Python release (>=3.9)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 33 days since the last release
Last repo commit
First released
Downloads 4,848,906/month — #2,216 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: lmdb-2.3.0-cp310-cp310-macosx_10_9_x86_64.whl; lmdb-2.3.0-cp310-cp310-macosx_11_0_arm64.whl; lmdb-2.3.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; lmdb-2.3.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; lmdb-2.3.0-cp310-cp310-win_amd64.whl; lmdb-2.3.0-cp310-cp310-win_arm64.whl; lmdb-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl; lmdb-2.3.0-cp311-cp311-macosx_11_0_arm64.whl; lmdb-2.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; lmdb-2.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; lmdb-2.3.0-cp311-cp311-win_amd64.whl; lmdb-2.3.0-cp311-cp311-win_arm64.whl; lmdb-2.3.0-cp312-cp312-macosx_10_13_x86_64.whl; lmdb-2.3.0-cp312-cp312-macosx_11_0_arm64.whl; lmdb-2.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; lmdb-2.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; lmdb-2.3.0-cp312-cp312-win_amd64.whl; lmdb-2.3.0-cp312-cp312-win_arm64.whl; lmdb-2.3.0-cp313-cp313-macosx_10_13_x86_64.whl; lmdb-2.3.0-cp313-cp313-macosx_11_0_arm64.whl

Programming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: DatabaseTopic :: Database :: Database Engines/Servers

Tags

lmdb python bindingkey-value databasememory-mapped databasefast embedded databaselightning database pythonpersistent key-value storeembedded database engine
embedded-databasekey-value-storememory-mapped

More Database packages