Metadata-Version: 2.4
Name: dashtro-client
Version: 0.2.1
Summary: Python client SDK for the Dashtro CMS API
Author: Atharva Devasthali
License-Expression: ISC
Project-URL: Homepage, https://github.com/1atharvad/dashtro
Project-URL: Repository, https://github.com/1atharvad/dashtro
Project-URL: Source, https://github.com/1atharvad/dashtro/tree/main/sdk/python
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27

# dashtro-client

Python client SDK for the [Dashtro](https://github.com/1atharvad/dashtro) CMS
API — scoped, API-key-authenticated access to a project's documents and
realtime database from external apps (`/api/sdk/*` on your Dashtro instance).

## Install

```bash
pip install dashtro-client
```

## Usage

```python
from dashtro_client import DashtroClient

client = DashtroClient(
    base_url="https://admin.example.com",
    project_id="<project-id>",
    api_key="<api-key>",
    workspace="production",  # optional, defaults to "production"
    cache_ttl=60,            # optional, seconds, defaults to 60
)

post = client.get_document("blog-posts", "<document-id>")
all_posts = client.get_all_documents("blog-posts")

# Realtime database
client.rtdb.set("/counters/views", 1)

client.close()  # or: with DashtroClient(...) as client: ...
```

An `AsyncDashtroClient`/`AsyncRtdbClient` pair with the same API (`await`ed,
`aclose()` instead of `close()`) is available for asyncio code.

API keys are issued and scoped (per collection, read/write) from your
Dashtro instance's settings page.

## License

ISC
