Skip to main content

Introspection-based UI engine for Plotly Dash — transform type-hinted Python functions into reactive Dash forms.

Project description

PyPI Python License Dash Ruff uv ty prek

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dash_fn_form-0.0.1.tar.gz (197.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dash_fn_form-0.0.1-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

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

Hashes for dash_fn_form-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ef1736bb6cd553d3fc712b7454c81d35f76137b341a5a5f876d82be7ac49e726
MD5 1b09ef0ed72f505fc044b90ada0576c1
BLAKE2b-256 f516ead92c8ce8ccb150601c6f196aabd4b7bb108bb83b7f30617e22efb04d1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for dash_fn_form-0.0.1.tar.gz:

Publisher: publish.yml on saemeon/dash-fn-form

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for dash_fn_form-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 10bf1876d868e1469b86cbe0dcc14e04feb89d2e89f90037c3c54ec91a3bf605
MD5 4fc8469be039006c9773c7a49089daa8
BLAKE2b-256 916cf928c307679d35851c6549888aac8f31171c6648cdb599f984c534e41c24

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page