Metadata-Version: 2.4
Name: cast-func
Version: 0.1.0
Summary: Build live notebook-backed presentations from Python functions.
Requires-Python: >=3.9
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Provides-Extra: dev
Provides-Extra: notebook
Requires-Dist: fastapi (>=0.110)
Requires-Dist: httpx (>=0.27) ; extra == "dev"
Requires-Dist: ipython (>=8.0) ; extra == "notebook"
Requires-Dist: numpy (>=1.24)
Requires-Dist: plotly (>=5.18)
Requires-Dist: polars (>=0.20)
Requires-Dist: uvicorn (>=0.27)
Description-Content-Type: text/markdown

# cast

Present from a notebook with two decorators.

```python
import cast, polars as pl, plotly.express as px

cast.serve(port=8000)            # live page in a background thread

@cast.data                        # function returns a polars LazyFrame
def sales():
    return pl.scan_parquet("sales.parquet")

@cast.figure                      # a factory: takes one table, returns a Plotly figure
def trend(tbl: pl.LazyFrame):
    df = tbl.select(["date", "value"]).collect()
    return px.line(df, x="date", y="value")

sales()                           # register the table (data is injected from the browser)
```

`@cast.figure` registers a **factory** at decoration time — you don't pass a
table in the notebook. Open the printed URL and use the controls to **add** the
figure to the inventory with a chosen table. The same factory can be added many
times with different data, and each instance has its own table dropdown; picking
a table re-runs your figure function on the server against it. Calling a
`@cast.data` function again updates its data and the page refreshes live.

See [`examples/demo.py`](examples/demo.py) for a runnable showcase.

