Skip to main content

LorealDB: Open-Source High-Performance Embedded Python Database Engine

LorealDB is an open-source, high-performance, read-optimized embedded database engine built using Redb, simd json, crossbeam channel, Rust and exposed natively to Python. It stores JSON documents as raw bytes and automatically creates a background metadata index, allowing for lightning-fast querying and filtering without the overhead of heavy runtime parsing.

Not just another rust KV store wrapper.

Lorealdb is created to end your data storage headache with just one single, simple, highly optimized, and highly rustified tool.

✨ Features

  • Dead Simple: No configuration, no servers, no ports. Just point it to a file path and start saving data.
  • Blazing Fast I/O: Built natively in 100% Rust for zero-cost abstraction.
  • GIL-Free Reads: Database reads release the Global Interpreter Lock, allowing true multi-threading in Python.
  • Asynchronous Writes: Upserts are pushed to a high-speed Rust MPSC channel, never blocking your Python thread.
  • Auto batching: Database operations are automatically executed at every 10ms from the MPSC channel.
  • SIMD-accelerated validation: JSON data is validated at CPU vector speeds.
  • Native Types: Pass Python dict objects in, get Python dict objects back. Rust handles the serialization invisibly.
  • Prefix Scanning: Efficiently query ranges of documents using key prefixes.
  • Batch Operations: Fetch hundreds of keys at once with zero order-scrambling and memory-safe pre-allocation.

Installation

Install the package using your favorite Python package manager:

pip install lorealdb

Or if you prefer using uv:

uv pip install lorealdb


Note: DBEngine is read-optimized. It natively accepts standard Python dictionaries, transparently converting them to raw bytes to automatically build a high-speed metadata index in the background.

Full API Reference for DBEngine


Quick Start

from lorealdb import DBEngine

# 1. Connect to your database (it creates the file automatically)
db = DBEngine("my_data.redb")

# 2. Saving a complex Python dictionary
# The Rust engine automatically handles serialization natively.
app_settings = {"theme": "dark", "notifications": True, "version": 1.2}
db.insert("settings", app_settings)

# 3. Reading the data back
# The engine automatically deserializes the bytes directly into a Python dictionary.
settings = db.get("settings")
if settings:
    print(f"App Theme: {settings['theme']}")

# 4. Deleting a record
db.delete("settings")

Metadata

Release files for lorealdb 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for lorealdb 0.1.1
File Interpreter ABI Platform
lorealdb-0.1.1-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details

Release files / lorealdb-0.1.1-cp310-abi3-win_amd64.whl

Download URL lorealdb-0.1.1-cp310-abi3-win_amd64.whl
Size 672.0 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
0d27a514b4bb1e239d7b4f763330fa580cd41d003a82bbe79faf2547ab87aa07
BLAKE2b-256 checksum
How to use checksums
09c47e5cc7c800395b73f016cb277c415ab268afe379aa434943399eb847d36f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release history Release notifications | RSS feed

0.1.4

5 release files

0.1.3

1 release file

This release

0.1.1 This release

1 release file

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page