Documentation
Install
Reference docs for pydantic-fixturegen.
Install: choose the workflow that fits your toolchain
Install the CLI, enable extras, and confirm the
pfgentry point is on your PATH.
pip (recommended)
python -m pip install --upgrade pip
pip install pydantic-fixturegen
- This installs the CLI script
pfgand pulls core dependencies (pydantic,faker,pluggy,typer). - After installing, verify with
pfg --help.
pip with extras
Enable optional capabilities per environment:
pip install 'pydantic-fixturegen[orjson]'
pip install 'pydantic-fixturegen[regex]'
pip install 'pydantic-fixturegen[hypothesis]'
pip install 'pydantic-fixturegen[watch]'
pip install 'pydantic-fixturegen[fastapi]'
pip install 'pydantic-fixturegen[polyfactory]'
pip install 'pydantic-fixturegen[openapi]'
pip install 'pydantic-fixturegen[dataset]'
pip install 'pydantic-fixturegen[sqlmodel]'
pip install 'pydantic-fixturegen[beanie]'
pip install 'pydantic-fixturegen[seed]'
pip install 'pydantic-fixturegen[all]'
pip install 'pydantic-fixturegen[all-dev]'
orjsonunlocks faster JSON encoding.regexinstallsrstrfor regex-constrained strings.hypothesisenables property-based extras in the cookbook.watchadds filesystem watching viawatchfiles.fastapipulls in FastAPI + Uvicorn so you can usepfg fastapi smokeandpfg fastapi serve.polyfactoryinstalls Polyfactory so model discovery can delegate to existing factories andpfg gen polyfactoryruns immediately.sqlmodelinstalls SQLModel + SQLAlchemy for database seeding.beanieinstalls Beanie + Motor for MongoDB seeding.seedbundles both stacks sopfg gen seedworks out of the box.datasetinstalls PyArrow sopfg gen dataset --format parquet|arrowworks without additional steps.openapibundlesdatamodel-code-generator+PyYAMLso you can ingest JSON Schema/OpenAPI documents directly inpfg.allbundles runtime extras;all-devadds Ruff, mypy, pytest, and pytest-cov.
Poetry
poetry add pydantic-fixturegen
poetry run pfg --help
- Add extras with
poetry add pydantic-fixturegen[watch]. - Use
poetry run pfg ...inside virtual environments or configure poetry’svirtualenvs.in-projectsetting for local bins.
Hatch
# pyproject.toml
[project]
dependencies = ["pydantic-fixturegen"]
hatch run pfg --help
- Add extras inside the same dependency list, for example
["pydantic-fixturegen[orjson,watch]"]. - Combine with Hatch environments to separate runtime and dev dependencies.
Extras matrix
| Extra | Provides | Ideal for |
|---|---|---|
regex |
rstr for regex-based string providers |
Models with Field(regex=...) constraints |
orjson |
Fast JSON encoder | Large JSON/JSONL dumps |
hypothesis |
Property-based strategy exporter (strategy_for, pfg gen strategies) |
Generative testing combos |
watch |
Live regeneration via watchfiles |
Watch mode in CI or local loops |
numpy |
Deterministic NumPy array providers | Models embedding numpy.ndarray fields |
fastapi |
FastAPI + Uvicorn | Smoke tests and mock servers |
polyfactory |
Polyfactory | Delegating to existing ModelFactory classes |
sqlmodel |
SQLModel + SQLAlchemy | SQL database seeding via CLI/fixtures |
beanie |
Beanie + Motor | MongoDB seeding |
seed |
SQLModel + SQLAlchemy + Beanie + Motor | Enable all seeding workflows |
dataset |
PyArrow | CSV/Parquet/Arrow dataset emission |
openapi |
datamodel-code-generator + PyYAML |
JSON Schema / OpenAPI ingestion workflows |
all |
Every runtime extra | One-shot enablement |
all-dev |
Runtime extras + mypy, Ruff, pytest, pytest-cov | Local development stacks |
Verify the CLI
pfg --version
pfg schema config --out /tmp/config.schema.json
pfg --versionprints the installed version and resolves the entry point declared under[project.scripts].pfg schema configconfirms Typer loads dynamic subcommands correctly.
You are ready to follow the Quickstart or dig into configuration defaults.
Edit this page