Skip to main content

DreamDB Python SDK

Python bindings for the DreamDB multimodal versioned data lake — image + audio + text + embeddings + scalar metadata on content-addressed object storage, with vector and metadata filters for ML training pipelines.

Quick start

The SDK exposes read-only SqlSession.open(ref_name, backend) with query and explain. See SQL adapters for typed parameters, snapshot semantics and limits.

from pathlib import Path
from tempfile import TemporaryDirectory
import dreamdb as db

with TemporaryDirectory(prefix="dreamdb-quickstart-") as directory:
    backend = Path(directory).as_uri()
    schema = db.Schema().add_scalar_string("label")
    ds = db.Dataset.create("example", schema, backend=backend)
    ds.append_many([{"_anchor": 1, "label": "cat"}])
    reopened = db.Dataset.open("example", backend=backend)
    assert reopened.count() == 1

For trained vector indexes, use the versioned index guide. The feature examples cover Python 0.0.11, including entity keys, progressive geometry and structured arrays. Older packages do not necessarily expose these methods.

Python 0.0.16 adds Dataset.http_stats(), explicit SpatialBucket cell maintenance (append_embedding_layer_with_report, compact_spatial_cells, spatial_cell_entries, merge_spatial_entries) and the opt-in fragment_pack_bytes argument of publish_prepared_video_item. Array fields whose index exceeds 1 MiB are now written in the paged form, which 0.0.15 and earlier cannot read. See the release notes.

Python 0.0.17 adds split upload/commit write paths: VideoItems (video_uploader, VideoUploader.upload_video_item, commit_video_item, commit_video_items, prepare_video_items, publish_prepared_video_items, republish_video_items), embeddings (embedding_uploader, EmbeddingUploader.prepare_embedding_append, append_embedding_layer_prepared) and scalars (scalar_uploader, ScalarUploader.prepare_scalar_append, commit_prepared_scalar), plus Dataset.field_track_hash. Existing methods keep their signatures. See the release notes.

Build from source

Segmented videos with independent initialization (Python 0.0.15)

Schema.add_video_item("video_raw", codec="h265") declares optional VideoItems. Unlike a flat CMAF Track, each item owns its decoder initialization and relative fragment index. The application prepares the media (for example by stream-copy remuxing at source keyframes); DreamDB does not transcode or create previews.

schema = db.Schema().add_video_item("video_raw", codec="h265")
ds = db.Dataset.create("new-originals", schema, backend=backend)
# fragments: [(fragment_bytes, relative_start_ns, relative_end_ns), ...]
published = ds.publish_prepared_video_item(
    "video_raw", b"opaque-clip-key", absolute_start_ns, duration_ns,
    init_bytes, fragments,
)
reopened = db.Dataset.open("new-originals", backend=backend)
window = reopened.read_video_item_range("video_raw", b"opaque-clip-key", 0, duration_ns)

This API materializes one item's inputs in memory, copies them into native ownership and publishes through the existing core validation/CAS boundary. It is not streaming, zero-copy, or a browser compatibility guarantee. Reusing an item key replaces that item; concurrent publication can raise a CAS conflict and is not implicitly retried. Returned addresses identify item, Track and Manifest. These write/schema methods are included in Python 0.0.15; 0.0.14 does not expose them.

Building the bindings

pip install maturin
cd dreamdb-dataset-python
maturin develop --release

This produces the dreamdb package installed into the current virtualenv. Importing it gives the Schema and Dataset classes shown above.

Publisher identity

New Manifest publications record the Python distribution version, shared core build identity and operation in the existing writer tag. Optional dataset.set_application(name, revision) identifies your application on later publications; reopening a Dataset resets that optional pair. This does not label retained payloads or prove execution. See publisher provenance for limits, build configuration and historical/operator behavior.

Explicit ingest checkpoints

For long-running base scalar + VideoItem ingest, a caller may explicitly start a new provenance epoch while reusing the current data objects:

used, limit = dataset.ingest_lineage_usage()
plan = dataset.plan_ingest_checkpoint(backend, "ingest-epoch-001")
# Durably persist these exact bytes BEFORE apply (file flush + fsync in your
# application's checkpoint journal); never rebuild a plan after an uncertain PUT.
save_durably(plan)
tip = dataset.apply_ingest_checkpoint(plan, backend)

backend here is the same non-secret endpoint/bucket identity on both calls. Exclude concurrent GC. The operation pins the old tip with a create-only tag, publishes a frozen new root and conditionally advances the working Ref. After an uncertain result, reopen that Ref and apply the same saved plan. A third tip conflicts; there is no automatic merge. A successful application preserves current data, not its provenance chain: old history remains under the tag, and pre-checkpoint branches cannot automatically merge into the new epoch.

Embeddings and layers are rejected by the base-only planner. For cold IVF-cosine embeddings, including layers over VideoItem, use plan_indexed_ingest_checkpoint(backend, archive_tag) and persist/apply the plan the same way. It retains exact original source bindings as structural ancestry claims, preserves SI/compressor/sidecars and current roles, and emits lineage-v5. All readers/writers must support that format before opting in; older packages reject it. Merge/backfill/entity combinations and unknown dependency-bearing metadata remain refused. This does not automatically publish new SDK packages.

Indexed admission reads bounded Track roots (4 MiB each, 32 MiB aggregate), not all bucket payloads; oversized imported roots need explicit conversion. It does not certify imported payload completeness. Existing full-directory compaction is separate, not implicit checkpoint work. See spec 0030.

The usage result is a measurement, not a guarantee that the next append fits. No object deletion, GC, tag expiry, or larger protocol limit is implied. See spec 0029.

Metadata

Release files for dreamdb 0.0.17

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

Built distributions (wheels)

Table of built distributions (wheels) for dreamdb 0.0.17
File Interpreter ABI Platform Actions
dreamdb-0.0.17-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details for dreamdb-0.0.17-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
dreamdb-0.0.17-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details for dreamdb-0.0.17-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
dreamdb-0.0.17-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for dreamdb-0.0.17-cp38-abi3-macosx_11_0_arm64.whl

Total release size: 22.7 MB

Release files / dreamdb-0.0.17-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL dreamdb-0.0.17-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 8.1 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
5ccf7d51315ac3f80dba27e027bdec93a4d61201fde959f6d41ce7ee901f5235
BLAKE2b-256 checksum
How to use checksums
c256fa6896e4f5f4cad94540560345f466670623c4e90deda234dd9fc08f36c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / dreamdb-0.0.17-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL dreamdb-0.0.17-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 7.5 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
b464824adcd2e168e9698714c0708f803db82edfcd7bc17f2558ccf81322afe9
BLAKE2b-256 checksum
How to use checksums
3d981a8eb08ffdf332497fd0bb7055485120e1c8fa6ad739479447d1824a8dad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / dreamdb-0.0.17-cp38-abi3-macosx_11_0_arm64.whl

Download URL dreamdb-0.0.17-cp38-abi3-macosx_11_0_arm64.whl
Size 7.2 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4de1313d83c36938e8dc39bcd53365957a025fdec546071d5a483e954a1fe9a7
BLAKE2b-256 checksum
How to use checksums
1925c985fa547fd28a2b8cdf23efdf0e1b7fea91d4d5c9193d952a956fb08cfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for dreamdb 0.0.17

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for dreamdb-0.0.17-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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