Skip to main content

Pydantic forms

pypi_version Supported python versions Downloads codecov

A Python package that lets you add smart forms to FastAPI and Flask. Forms will respond with a JSON scheme that contains all info needed in a React frontend with uniforms to render the forms and handle all validation tasks.

Forms can also consist out of a wizard, so you can create complex form flows consisting out of multiple consecutive forms. The forms and the validation logic are defined by using Pydantic models.

Documentation regarding the usage of Forms can be found here

Installation (Development standalone)

This project uses uv. Install the project and its dependencies to develop on the code:

uv sync --all-extras

This creates a .venv, installs pydantic-forms in editable mode, and installs the dev dependency group (which chains in test and doc) plus the fastapi and orjson extras. There is no need to create or activate a virtualenv yourself -- prefix commands with uv run and uv will use the right interpreter.

Running tests

Run the unit-test suite to verify a correct setup.

uv run pytest tests/unit_tests

or with xdist:

uv run pytest -n auto tests/unit_tests

If you do not encounter any failures in the test, you should be able to develop features in the pydantic-forms.

Installation (Development version used by a project that depends on pydantic-forms)

If you are working on a project that already uses pydantic-forms and you want to test your new form features against it, point that project at your local checkout. Run this from the other project:

uv add --editable /path/to/pydantic-forms

This replaces the PyPI dependency with an editable install of your working copy and records it under [tool.uv.sources] in that project's pyproject.toml. Undo it with:

uv remove pydantic-forms && uv add pydantic-forms

Increasing the version number for a (pre) release.

When your PR is accepted you will get a version number.

You can do the necessary change with a clean, e.g. every change committed, branch:

uv version 0.0.1

Note: specifying the version explicitly, instead of relying on uv version --bump patch to increase it, allows you to set a "RC1" version if needed -- e.g. uv version 0.0.1rc1.

Debugging Form behaviour

If you want/need the traceback of pydantic in a Form response you can add an env variable:

LOG_LEVEL_PYDANTIC_FORMS=DEBUG

This will add the traceback to the JSONResponse. If the loglevel is set to DEBUG the library will also add the traceback to the logger.

Download files

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

Source Distribution

pydantic_forms-2.6.0.tar.gz (41.0 kB view details)

Uploaded Source

Built Distribution

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

pydantic_forms-2.6.0-py3-none-any.whl (48.7 kB view details)

Uploaded Python 3

File details

Details for the file pydantic_forms-2.6.0.tar.gz.

File metadata

  • Download URL: pydantic_forms-2.6.0.tar.gz
  • Upload date:
  • Size: 41.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pydantic_forms-2.6.0.tar.gz
Algorithm Hash digest
SHA256 23ada2cc04d02c14664d9d51101124be034e62e9b55e6c5ff21c0ee34b0b0bb1
MD5 214d3d1852516c12c43c8a3a4f9817dc
BLAKE2b-256 f0be753f1658c50ea70d9e84d8d466891934f4a6e2ee9511c2e6a8e2a05a6307

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydantic_forms-2.6.0.tar.gz:

Publisher: publish-release.yaml on workfloworchestrator/pydantic-forms

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

File details

Details for the file pydantic_forms-2.6.0-py3-none-any.whl.

File metadata

  • Download URL: pydantic_forms-2.6.0-py3-none-any.whl
  • Upload date:
  • Size: 48.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pydantic_forms-2.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dcfd64946f78c091cd506fcd922e78b532400bc3a837032d5d3fda6dcddf4c3a
MD5 732a163e054fac4b5c65e315fcf6833f
BLAKE2b-256 8c708c7ef6fc7fbd8bd9ecdfee15ec85ff6e047168d3f9c9350b9b5be5ff779a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydantic_forms-2.6.0-py3-none-any.whl:

Publisher: publish-release.yaml on workfloworchestrator/pydantic-forms

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

Release history Release notifications | RSS feed

This release

2.6.0 This release

2 files

2.5.0

2 files

2.4.0

2 files

2.3.0

2 files

2.2.0

2 files

2.1.2

2 files

2.1.1

2 files

2.1.0

2 files

2.0.0

2 files

1.4.0

2 files

1.3.0

2 files

1.2.1

2 files

1.2.0

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.2.0

2 files

0.1.0

2 files

0.0.1

2 files

Supported by

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