PolyFactory

Mock data generation library for Python classes and Pydantic models.

EstablishedOpen SourceLow lock-in

Pricing

Free tier

Flat rate

Adoption

Stable

License

Open Source

Data freshness

Aging · Jun 8, 2026

Overview

What is PolyFactory?

PolyFactory is a powerful mock data generation library that supports Python classes and Pydantic models, making it easier to generate test data for development and testing purposes. It continues the legacy of `pydantic-factories` with enhanced features and support.

Key differentiator

PolyFactory stands out by offering robust support for Python classes and Pydantic models, making it an ideal choice for developers who need precise control over their test data generation.

Capability profile

Capability Radar

Ease of StartEcosystemValueMaturityFlexibilityScale Ready

Honest assessment

Strengths & Weaknesses

↑ Strengths

Support for Python classes and Pydantic modelsmedium

Enhanced mock data generation capabilitiesmedium

Seamless integration with existing codebasesmedium

↓ Weaknesses

Steep learning curve for non-Python developershigh

API requires Python-specific patterns, TypeScript SDK is community-maintained

Frequent breaking changes between versionsmedium

v0.1 to v0.2 migration required rewriting chain definitions

Limited support for complex Pydantic modelshigh

Difficulties in generating mock data for nested and recursive models

Small community and limited third-party integrationsmedium

Few community contributions and plugins compared to more established libraries like Faker

Fit analysis

Who is it for?

✓ Best for

Developers working with Pydantic models who need to generate consistent and realistic test data

Teams building Python applications that require extensive testing and validation

Projects where manual data creation is time-consuming or impractical

✕ Not a fit for

Applications requiring real-time data generation (PolyFactory focuses on static mock data)

Scenarios where the generated data needs to be highly customized beyond what PolyFactory offers out-of-the-box

Cost structure

Pricing

Free Tier

Available

Open source — free to use

Starts at

$0

Model

Flat rate

Enterprise

None

Performance benchmarks

How Fast Is It?

Ecosystem

Relationships

Next step

Get Started with PolyFactory

Step-by-step setup guide with code examples and common gotchas.

View Setup Guide →