JSON to pydantic generator
Page at falkben.github.io/json-to-pydantic/
Inspired by @brokenloop's jsontopydantic
, this project implements the same conversion (using datamodel-code-generator
), but does the conversion entirely in the browser, using PyScript & Pyodide.
-
Create virtual environment and activate:
python -m venv .venv && source .venv/bin/activate
-
Install package
pip install -e . -r requirements.txt
Or with optional dev dependencies:
pip install -e ".[dev]" -r requirements.txt -r requirements_dev.txt
Dependencies are specified in pyproject.toml
and managed with pip-tools.
-
Install
pip-tools
(globally with pipx or in local virtual environment with pip) -
Generate lock files:
pip-compile pyproject.toml --quiet && \ pip-compile --extra=dev --output-file=requirements_dev.txt pyproject.toml --quiet
To upgrade a dependency, pass the --upgrade-package
flag along with the name of the package, or to upgrade all packages, pass the --upgrade
flag to the command.
More information at: https://github.com/jazzband/pip-tools/