Widget Generator for JSON schema
Project description
ipywidgets-jsonschema
A lightweight library that seamlessly combines Pydantic models, JSON Schema, and IPyWidgets to generate interactive, schema‐driven forms in Jupyter notebooks. Define your data models with Pydantic (or raw JSON Schema), and this package will produce Jupyter widgets for editing and validating.
Features
- Automatic Widget Generation: Convert any JSON Schema or Pydantic model into a fully interactive IPyWidgets form.
- Pydantic Integration: Leverage Pydantic’s data validation, typing, and JSON Schema generation.
- Nested Structures: Support for nested objects, arrays, dictionaries, enums, unions, and optional fields.
- Inline Editing UI: The
PydanticEditorMixinwraps Pydantic models with an “Edit → Save/Cancel” toolbar for in‐place modifications.
Installation
ipywidgets-jsonschema can be installed with pip:
python -m pip install ipywidgets-jsonschema
Alternatively, you can get it from conda-forge:
conda install -c conda-forge ipywidgets-jsonschema
Quick Start
from pydantic import BaseModel, Field
from ipywidgets_jsonschema import Form
class Person(BaseModel):
name: str = Field(..., description="Your full name")
age: int = Field(..., ge=0, description="Your age in years")
email: str = Field(None, description="Optional email")
form = Form(Person)
form.show()
# Interact with the form in Jupyter; retrieve validated data:
print(form.data) # e.g. {"name": "Alice", "age": 30, "email": "alice@example.com"}
That’s it—your Pydantic model is now an interactive form. For more advanced examples (nested models, enums, unions, customization), see the Documentation.
License
Released under the MIT License.
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
File details
Details for the file ipywidgets_jsonschema-1.2.1.tar.gz.
File metadata
- Download URL: ipywidgets_jsonschema-1.2.1.tar.gz
- Upload date:
- Size: 34.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a7265209c3c364b7281d5ab90cd333a71d65cfc2440742439a098aa5b6715a6
|
|
| MD5 |
ae07285d2aaa8b0948116bb4fcb5d888
|
|
| BLAKE2b-256 |
62bf6485f5e76b7ff70f5ae193ab0ce323691434ddc95a5ba035ee9a2dee368c
|
Provenance
The following attestation bundles were made for ipywidgets_jsonschema-1.2.1.tar.gz:
Publisher:
pypi.yml on ssciwr/ipywidgets-jsonschema
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ipywidgets_jsonschema-1.2.1.tar.gz -
Subject digest:
1a7265209c3c364b7281d5ab90cd333a71d65cfc2440742439a098aa5b6715a6 - Sigstore transparency entry: 998836623
- Sigstore integration time:
-
Permalink:
ssciwr/ipywidgets-jsonschema@118c2bca570ebd3e209a49afa48b59222289b1ed -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/ssciwr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@118c2bca570ebd3e209a49afa48b59222289b1ed -
Trigger Event:
release
-
Statement type: