Polyfactory
Simple and powerful mock data generation library for Python based on type hints, supporting Pydantic, dataclasses, TypedDicts, attrs and msgspec.
Our Verdict
The right mock data tool for typed Python codebases, far ahead of factory_boy when you already use Pydantic.
Pros
- Generates mocks from Python type hints
- Supports Pydantic, dataclasses, TypedDict, attrs
- Reduces fixture boilerplate significantly
- Works well with pytest and FastAPI tests
Cons
- Random data can mask deterministic bugs
- Complex nested types need custom factories
- Smaller community than factory_boy
When to Use Polyfactory
Good fit if you need
- Generate mock data from Pydantic models with one call
- TypedDict and dataclass factories for Python test fixtures
- Override specific fields while auto-filling the rest
- Bulk fixture generation for performance test seeding
Pricing
Price wrong?Polyfactory Pricing
- Pricing Model
- free
- Free Tier
- Yes
- Entry Price
- β
- Enterprise Available
- No
- Transparency Score
- β
Beta β estimates may differ from actual pricing
Estimated Monthly Cost
$25
Estimated Annual Cost
$300
Estimates are approximate and may not reflect current pricing. Always check the official pricing page.
Project Health
Health Score
9
21 days
25d
67
N/A
MIT
Last checked: 2026-04-21
Lock-in Assessment
π Thinking about migrating off Polyfactory?
Get an AI-drafted migration plan + a copy-paste email to Polyfactory support requesting a data export. Pick where you're moving to and tell us your context.
Looking for alternatives to Polyfactory?
Answer 4 quick questions β get an AI-ranked shortlist of tools that match your stack and requirements.
Open AI Tool FinderCommunity Discussion
Comments powered by Giscus (GitHub Discussions). You need a GitHub account to comment.