$npx skillfedfor your agent

pydantic-factories

Mock data generation for pydantic based models and python dataclasses

SkipPyPI Software DevelopmentReleased Apr 2023166.6K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pydantic_factories-1.17.3-py3-none-any.whl
v1.17.3 · released 2023-04-03 · Python >=3.8,<4.0 · 3 runtime deps: faker, pydantic, typing-extensions

No. The project is archived and abandoned as of April 2023, with maintainers explicitly directing users to migrate to polyfactory. While the code may still work with current pydantic versions, there will be no fixes for compatibility issues with future releases. Start with polyfactory instead unless you are maintaining legacy code already using this package.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction install with three straightforward runtime dependencies.
  • However, the repository is archived and the project is abandoned; the maintainers have explicitly migrated to polyfactory as the successor.
  • No updates since April 2023.

License · maintenance · safety

MIT (permissive) — MIT license permits commercial and private use with minimal restrictions, making it safe to adopt from a licensing standpoint.

last release 2023-04-03 (1229 days) · last repo commit 2023-04-03 · 16 stars · archived

0 known vulnerabilities (OSV.dev, 2026-08-14) · 166,645 downloads/mo, #10,485 on PyPI

Verify before relying

pip install pydantic-factories

from pydantic import BaseModel
from pydantic_factories import ModelFactory

class Person(BaseModel):
    name: str
    age: int

class PersonFactory(ModelFactory):
    __model__ = Person

result = PersonFactory.build()
  • Whether existing code using pydantic-factories will continue to work with future pydantic versions without maintenance.
  • Compatibility with pydantic v2 and later versions, given the project's abandoned status.
Same gist for agents: .md · .json

What it is and what it does

Pydantic-factories is a mock data generator that inspects pydantic model definitions, dataclasses, and TypedDicts to automatically create realistic test instances. It uses type hints and field constraints as a blueprint, delegating to faker for realistic string and date generation. You define a factory class pointing to your model, call `.build()`, and receive a fully populated instance ready for testing—no manual field assignment needed.

The library integrates faker and pydantic to handle both built-in Python types and pydantic-specific types, respecting field constraints. It's designed for unit testing and test-driven development workflows where you need representative mock objects quickly. The project is no longer maintained; the authors have moved development to polyfactory.

Use it for

  • Generate realistic test fixtures for pydantic models in unit tests without manually populating every field.
  • Create mock data for dataclass-based APIs during development and testing phases.
  • Populate TypedDict instances with valid random data for integration test scenarios.
  • Quickly prototype test suites for pydantic-based applications during TDD workflows.
  • Generate bulk test data for validation and constraint-testing of model fields.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Skip

No.

The project is archived and abandoned as of April 2023, with maintainers explicitly directing users to migrate to polyfactory. While the code may still work with current pydantic versions, there will be no fixes for compatibility issues with future releases. Start with polyfactory instead unless you are maintaining legacy code already using this package.

Install

pydantic-factories on PyPI

Before you install

Low friction install with three straightforward runtime dependencies. However, the repository is archived and the project is abandoned; the maintainers have explicitly migrated to polyfactory as the successor. No updates since April 2023.

License in practice

MIT license permits commercial and private use with minimal restrictions, making it safe to adopt from a licensing standpoint.

Quickstart

pip install pydantic-factories

from pydantic import BaseModel
from pydantic_factories import ModelFactory

class Person(BaseModel):
    name: str
    age: int

class PersonFactory(ModelFactory):
    __model__ = Person

result = PersonFactory.build()

Verify before relying

  • Whether existing code using pydantic-factories will continue to work with future pydantic versions without maintenance.
  • Compatibility with pydantic v2 and later versions, given the project's abandoned status.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.8,<4.0
Install frictionLow. Pure-Python wheel
Runtime dependencies
3 packages
fakerpydantictyping-extensions
MaintenanceAbandoned 1,229 days since the last release
Last repo commit repository archived
First released
Downloads166,645 / month, #10,485 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Environment :: Web EnvironmentFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: TestingTopic :: Software Development :: Testing :: UnitTopic :: UtilitiesTyping :: Typed

Evidence: pydantic_factories-1.17.3-py3-none-any.whl

Tags

Capabilities
pydantic mock data generationfactory for pydantic modelstest data fixtures pydanticdataclass mock factorygenerate fake pydantic instancestesting data builderspydantic model mocking
Topics
test-fixturesabandoned-project
PyPI keywords
dataclassesfactoryfakermockpydanticpyteststarlitetddtesting

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “pydantic mock data generation”

  • pydantic-factoriesGenerates mock data objects that conform to pydantic models,…
  • polyfactoryPolyfactory generates mock data objects from type hints, supporting…
  • patitoPatito combines pydantic models with polars DataFrames to provide…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also polyfactory · pydantic-collections · pydantic · mimesis · dydantic · pydantic-to-typescript2 · pydantic-to-typescript · graphene-pydantic · datamodel-code-generator · pydantic_yaml