Skip to main content

marimo-pydantic-form

[!WARNING] This package is under active development. Features and APIs may change.

A Python package for building marimo forms from Pydantic models.

[!NOTE] Currently, UI elements must be manually assigned to each field. Automatic UI element generation is planned for future releases.

Features

  • Automatically generate marimo forms from Pydantic models
  • Support for nested Pydantic models
  • Customizable UI elements for each field
  • Type-safe form validation using Pydantic
  • Easy parsing of form values back into Pydantic model instances

Installation

pip install marimo-pydantic-form

Or using uv:

uv add marimo-pydantic-form

Quick Start

import marimo as mo
from pydantic import BaseModel
from marimo_pydantic_form import PydanticFormBuilder

class Inner(BaseModel):
    a: int

class Model(BaseModel):
    x: float
    y: Inner

# Create a form builder with custom UI elements
builder = PydanticFormBuilder(
    model=Model,
    ui={
        "x": mo.ui.slider(0, 100, label="x"),
        "y.a": mo.ui.slider(0, 100, label="y.a")
    },
)

# Build the form
form = builder.build()

# Parse the form value into a Pydantic model instance
model_instance = builder.parse(form.value)

Usage

Basic Form

Create a form from a Pydantic model:

from marimo_pydantic_form import PydanticFormBuilder

builder = PydanticFormBuilder(model=YourModel)
form = builder.build()

Custom UI Elements

Assign custom marimo UI elements to specific fields using dot notation for nested fields:

builder = PydanticFormBuilder(
    model=Model,
    ui={
        "field_name": mo.ui.text(label="Custom Label"),
        "nested.field": mo.ui.slider(0, 100)
    }
)

Parsing Form Values

Convert form values back to Pydantic model instances:

model_instance = builder.parse(form.value)

License

See LICENSE file for details.

Metadata

Release files for marimo-pydantic-form 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for marimo-pydantic-form 0.1.1
File Size Uploaded Provenance
marimo_pydantic_form-0.1.1.tar.gz 4.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for marimo-pydantic-form 0.1.1
File Interpreter ABI Platform
marimo_pydantic_form-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / marimo_pydantic_form-0.1.1.tar.gz

Download URL marimo_pydantic_form-0.1.1.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bc0b369e6b2dbe6ae29665e41022e632d1bc3daa2e65eb5b08b78324d8e24ce6
BLAKE2b-256 checksum
How to use checksums
1a0a61144d7095476c01487cdafbef52f85fa8137e1c45ac1516006cb07aaa6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 30, 2025.

Transparency log

Release files / marimo_pydantic_form-0.1.1-py3-none-any.whl

Download URL marimo_pydantic_form-0.1.1-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6e5c6d609b4ffb08a45f4f78e8d23c62cf0934facd71f3c500e915699347334
BLAKE2b-256 checksum
How to use checksums
01ec71c33e7d3ea137c6a6a2149594f86c9c819a7f9e967956de1cc08d8e54c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 30, 2025.

Transparency log

Security for marimo-pydantic-form 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for marimo_pydantic_form-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 30, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page