Auto-generate Streamlit UI from Pydantic Models and Dataclasses

Streamlit Pydantic

Auto-generate Streamlit UI elements from Pydantic models.

Streamlit-pydantic makes it easy to auto-generate UI elements from Pydantic models. Just define your data model and turn it into a full-fledged UI form. It supports data validation, nested models, and field limitations. Streamlit-pydantic can be easily integrated into any Streamlit app.

Beta Version: Only suggested for experimental usage.

Highlights

  • 🪄  Auto-generated UI elements from Pydantic models.
  • 📇  Out-of-the-box data validation.
  • 📑  Supports nested Pydantic models.
  • 📏  Supports field limits and customizations.
  • 🎈  Easy to integrate into any Streamlit app.

Getting Started

Installation

Requirements: Python 3.6+.

pip install streamlit-pydantic

Usage

  1. Create a script (my_script.py) with a Pydantic model and render it via pydantic_form:

    import streamlit as st

     

     

     

    To finish reading, please visit source site