Metadata-Version: 2.4
Name: dataface-playground
Version: 0.0.1
Summary: Dataface interactive playground — OSS dashboard editor
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Requires-Dist: dataface
Requires-Dist: fastapi>=0.100.0
Requires-Dist: openai>=2.7.2
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: typer>=0.12
Requires-Dist: uvicorn[standard]>=0.34.0
Requires-Dist: watchfiles>=1.1.1
Requires-Dist: websockets>=16.0
Description-Content-Type: text/markdown

# Dataface Playground

Interactive editor for Dataface dashboards — live YAML editing with a
real-time preview, share links, and an AI copilot for dashboard authoring.

## Install

```bash
pip install dataface-playground
```

The package installs both the `dft-playground` console script and the
`dft playground` subcommand on the `dft` CLI.

## Run

```bash
dft-playground            # auto-resolved port
dft playground            # equivalent via the dft CLI
dft playground --port 3000
dft playground --base-dir ./examples
dft playground --data ./my_data.db
dft playground --openai-key sk-...    # enables AI copilot
```

The playground opens at `http://127.0.0.1:<port>` and ships a curated
gallery of example dashboards covering charts, layouts, tables, KPIs, and
variable-driven interactions.

## What's in the wheel

- FastAPI app: live YAML editor, WebSocket preview, share-link cache, AI
  copilot (`/api/ai/chat` — OpenAI-backed when `OPENAI_API_KEY` is set)
- A small curated example gallery under `examples_data/examples/`
  (DuckDB-backed) so a fresh install renders something on first launch

## Configuration

| Variable | Default | Description |
|---|---|---|
| `OPENAI_API_KEY` | — | Enables the AI copilot sidebar |
| `DFT_PLAYGROUND_MODE` | `local` (set by CLI) | `local` allows inline data sources; `deployed` requires an allowlisted source |
| `DFT_DOCS_URL` | — | Base URL for per-face `docs:` links rendered in the gallery |

## Known limitations

**Share cache is in-memory.** Shared dashboard links are invalidated when
the server restarts. The playground is meant for local editing and
short-lived demos, not as a persistent share-link service.

## License

Apache-2.0 — see [LICENSE](LICENSE).
