Introspection-based UI engine for Plotly Dash — transform type-hinted Python functions into reactive Dash forms.
Project description
dash-fn-form
Introspection-based UI engine for Plotly Dash — transform type-hinted Python functions into reactive Dash forms.
Installation
pip install dash-fn-form
Most users should install dash-interact instead, which includes this package and adds a convenience page API.
Usage
from dash import Dash, html
from dash_fn_form import build_fn_panel
def sine_wave(amplitude: float = 1.0, frequency: float = 2.0):
import numpy as np, plotly.graph_objects as go
x = np.linspace(0, 6 * np.pi, 600)
return go.Figure(go.Scatter(x=x, y=amplitude * np.sin(frequency * x)))
app = Dash(__name__)
app.layout = html.Div([build_fn_panel(sine_wave)])
app.run(debug=True)
build_fn_panel inspects the function signature and builds a form with matching controls. The return value is rendered automatically.
Type mapping
| Python type | Control |
|---|---|
float |
Number input (or slider with (min, max, step)) |
int |
Number input (integer step) |
bool |
Checkbox |
Literal[A, B, C] |
Dropdown |
str |
Text input |
date / datetime |
Date picker |
list[T] / tuple[T, ...] |
Comma-separated input |
T | None |
Same as T, submits None when empty |
Field customization
from dash_fn_form import Field
form = FnForm("my_form", my_fn, title=Field(label="Title", col_span=2))
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dash_fn_form-0.0.1.tar.gz.
File metadata
- Download URL: dash_fn_form-0.0.1.tar.gz
- Upload date:
- Size: 197.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef1736bb6cd553d3fc712b7454c81d35f76137b341a5a5f876d82be7ac49e726
|
|
| MD5 |
1b09ef0ed72f505fc044b90ada0576c1
|
|
| BLAKE2b-256 |
f516ead92c8ce8ccb150601c6f196aabd4b7bb108bb83b7f30617e22efb04d1a
|
Provenance
The following attestation bundles were made for dash_fn_form-0.0.1.tar.gz:
Publisher:
publish.yml on saemeon/dash-fn-form
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dash_fn_form-0.0.1.tar.gz -
Subject digest:
ef1736bb6cd553d3fc712b7454c81d35f76137b341a5a5f876d82be7ac49e726 - Sigstore transparency entry: 1186308702
- Sigstore integration time:
-
Permalink:
saemeon/dash-fn-form@4381f60aa42cbc823762d19572ea4a718a685e84 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/saemeon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4381f60aa42cbc823762d19572ea4a718a685e84 -
Trigger Event:
release
-
Statement type:
File details
Details for the file dash_fn_form-0.0.1-py3-none-any.whl.
File metadata
- Download URL: dash_fn_form-0.0.1-py3-none-any.whl
- Upload date:
- Size: 34.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10bf1876d868e1469b86cbe0dcc14e04feb89d2e89f90037c3c54ec91a3bf605
|
|
| MD5 |
4fc8469be039006c9773c7a49089daa8
|
|
| BLAKE2b-256 |
916cf928c307679d35851c6549888aac8f31171c6648cdb599f984c534e41c24
|
Provenance
The following attestation bundles were made for dash_fn_form-0.0.1-py3-none-any.whl:
Publisher:
publish.yml on saemeon/dash-fn-form
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dash_fn_form-0.0.1-py3-none-any.whl -
Subject digest:
10bf1876d868e1469b86cbe0dcc14e04feb89d2e89f90037c3c54ec91a3bf605 - Sigstore transparency entry: 1186308708
- Sigstore integration time:
-
Permalink:
saemeon/dash-fn-form@4381f60aa42cbc823762d19572ea4a718a685e84 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/saemeon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4381f60aa42cbc823762d19572ea4a718a685e84 -
Trigger Event:
release
-
Statement type: