Metadata-Version: 2.4
Name: dreamdb
Version: 0.0.7
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: License :: OSI Approved :: MIT License
License-File: LICENSE-MIT
Summary: Multimodal versioned data lake for ML training, on DreamDB
License-Expression: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://dreamdb.dreamlake.ai
Project-URL: Issues, https://github.com/dreamlake-ai/dreamdb-core/issues
Project-URL: Repository, https://github.com/dreamlake-ai/dreamdb-core

# DreamDB Python SDK

Python bindings for the [DreamDB](https://github.com/dreamlake-ai/dreamdb-core) 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

```python
import dreamdb as vd

# Schema
schema = vd.Schema()
schema.add_image("image", mime="jpeg")
schema.add_embedding("embedding", dim=128)
schema.add_scalar_categorical("label")

# Create against any backend (file://, http(s)://, memory://)
ds = vd.Dataset.create(
    "my-dataset",
    schema,
    backend="file:///tmp/my-ds",
)

# Append a batch of samples (each a dict)
ds.append_many([
    {"image": open("cat.jpg", "rb").read(),
     "embedding": [0.1, 0.2, ...],
     "label": "cat"},
    # ...
])

# Filter::Vector + Filter::Where (And)
batches = ds.iter_vector(
    field="embedding",
    query=[0.1, 0.2, ...],
    top_k=10,
    batch_size=4,
    where_eq={"label": "cat"},
)
for batch in batches:
    images = batch["image"]      # list[bytes]
    embeds = batch["embedding"]  # list[list[float]]
    labels = batch["label"]      # list[str]
```

## Build from source

```bash
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.

