Metadata-Version: 2.4
Name: lamina-sdk
Version: 0.1.4
Summary: Async-first Python SDK for Lamina video generation.
Author: Lamina
License: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27.0
Requires-Dist: Pillow>=10.0.0
Requires-Dist: websockets>=12.0

# lamina-sdk

Async-first Python SDK for Lamina video generation.

## Install

```bash
pip install lamina-sdk
```

Python 3.11 or newer is required.

## Quick Start

```python
from lamina import simi

async with simi(api_key="lamina_live_your_key") as client:
    video = await client.generate("A blue sphere moving across white background", duration=10)
    await video.save("out.mp4")
```

You can also set `LAMINA_API_KEY` and call `simi()` with no arguments. The SDK
defaults to `https://api.laminalabs.ai`; override `base_url=...` only for local
development or staging.

## Submit And Stream Events

```python
from lamina import simi

async with simi(api_key="lamina_live_your_key") as client:
    job = await client.submit_async("A blue sphere moving across white background", duration=10)

    async for event in client.stream_events(job):
        print(event.type)
```

## Callback Style

```python
from lamina import simi

async with simi(api_key="lamina_live_your_key") as lamina:
    job = await lamina.submit_async("A narrated lesson about derivatives")
    job.onstream(lambda event: print(event.type))
    job.oncompletion(lambda video: print(f"Ready: {video.job_id}"))
    await job.wait()
```

## Public API

- `job = lamina.submit(prompt, *, duration=20)`
- `job = await lamina.submit_async(prompt, *, duration=20)`
- `video = await lamina.generate(prompt, *, duration=20)`
- `await lamina.save(job, path)`
- `await lamina.aclose()` or `async with simi()`
- `api_key` is required in `simi(...)` unless `LAMINA_API_KEY` is set.
