Skip to main content

Pydantic-forms engine.

Project description

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)

Install the project and its dependencies to develop on the code.

Step 1 - install flit:

python3 -m venv venv
source venv/bin/activate
pip install flit

Step 2 - install the development code:

flit install --deps develop --symlink --python venv/bin/python

!!! danger Make sure to use the flit binary that is installed in your environment. You can check the correct path by running shell which flit

To be sure that the packages will be installed against the correct venv you can also prepend the python interpreter that you want to use:

flit install --deps develop --symlink --python venv/bin/python

Running tests

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

Step 2 - Run tests

pytest tests/unit_tests

or with xdist:

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 symlinked into project that use pydantic-forms)

If you are working on a project that already uses the pydantic-forms and you want to test your new form features against it, you can use some flit magic to symlink the dev version of the forms to your project. It will automatically replace the pypi dep with a symlink to the development version of the core and update/downgrade all required packages in your own project.

Step 1 - install flit:

python - m venv venv
source venv/bin/activate
pip install flit

Step 2 - symlink pydantic-forms to your own project

flit install --deps develop --symlink --python /path/to/a/project/venv/bin/python

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:

bumpversion patch --new-version 0.0.1

Note: specifying it like this, instead of relying on bumpversion itself to increase the version, allows you to set a "RC1" version if needed.

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.5.0.tar.gz (45.5 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.5.0-py3-none-any.whl (46.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pydantic_forms-2.5.0.tar.gz
  • Upload date:
  • Size: 45.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pydantic_forms-2.5.0.tar.gz
Algorithm Hash digest
SHA256 166b53b50fb2048b1a5916028f4b72b127b71eb19371e7cd959419f10d58f431
MD5 6ca7c48e8c601343bba25e56f69983f1
BLAKE2b-256 754dc4f3ed92d2cd60785da522994783a70bf65ccc3c0811ca7a37b45b2c248e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydantic_forms-2.5.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.5.0-py3-none-any.whl.

File metadata

  • Download URL: pydantic_forms-2.5.0-py3-none-any.whl
  • Upload date:
  • Size: 46.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pydantic_forms-2.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 baaa967875c2ea0719888ea9db30db9f18f792f78d65d9075f9f1396dc970443
MD5 c5f236678fe7d6db6bb4c5ebc6662eb3
BLAKE2b-256 754a7dd4ff051e974121f018276a9e35c1e8652968d1f6a61ae73caa7e3b79dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydantic_forms-2.5.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.

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