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.2.tar.gz (198.4 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.2-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

File details

Details for the file dash_fn_form-0.0.2.tar.gz.

File metadata

  • Download URL: dash_fn_form-0.0.2.tar.gz
  • Upload date:
  • Size: 198.4 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.2.tar.gz
Algorithm Hash digest
SHA256 7e7f20d169c3d37146940f1ec02b57f08fae726916f4c7efe5128b1ba17bf471
MD5 966ea85d31f8777f5dbe4c6be3dd07d5
BLAKE2b-256 b15c77ad489705f3891839cf5362e8860de01021da8abb2df07ee617ebf0dd57

See more details on using hashes here.

Provenance

The following attestation bundles were made for dash_fn_form-0.0.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: dash_fn_form-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 35.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1bc9318c86ab57cde7b50d175e53b35427800628858e2cea384e12806dabd693
MD5 8bbd997ff09d90472f8e197d7860a3b2
BLAKE2b-256 fcd06032c64fec157476b12ec6aa0951dc52ad30b5a1cb96efe934cf89271b71

See more details on using hashes here.

Provenance

The following attestation bundles were made for dash_fn_form-0.0.2-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