factory_boy
factory_boy: An open-source Python library for structured ORM fixtures and related test objects. Ranked #19 of 28 in Test Data Generation Tools by our editors (6.8/10); pricing: Open source; best for python ORM model factories.
At a glance
- Editor score6.8 / 10
- PricingOpen source
- Best forPython ORM model factories
- Paid fromFree
- Generation modesSynthetic
- Facts checked20 Sep 2026

Where it wins
- Declarative factories support nested and related objects.
- Build, create, stub, and batch generation strategies.
- Integrates with Django, MongoEngine, Mogo, SQLAlchemy, and Faker.
Where it doesn't
- Focused on Python application fixtures rather than standalone data generation.
- Requires self-hosted use within a development environment.
- Database support centers on selected Python ORM integrations.
Our verdict on factory_boy
factory_boy is an open-source Python library for developers who need repeatable test objects and application fixtures. Instead of maintaining static fixture files, teams define declarative factories for Python objects and customize fields as needed. It is particularly suited to projects using Django, MongoEngine, Mogo, or SQLAlchemy, with support for related objects and foreign-key generation.
Its main strength is the depth of its factory model. Developers can choose build, create, or stub instantiation strategies, generate objects in batches, and compose nested factories with SubFactory. Faker integration adds realistic randomized values, while ORM-specific factory classes can save generated objects through the relevant framework or database session. This makes factory_boy a practical fit for tests that need connected object graphs rather than isolated records.
The trade-off is focus. factory_boy is primarily an application-fixture library, with deployment centered on self-hosted use inside a Python codebase. It fits teams that want programmable, framework-aware test data generation and are comfortable defining factories in code. Teams seeking a standalone platform for broad data operations, hosted workflows, or a wider range of database connectors should choose a different category of tool. For Django and supported Python ORM projects, factory_boy keeps test-object creation close to the models and sessions that consume it.
Your product? Our editors can test factory_boy in depth and publish a review, labelled as paid · from $149/mo →
factory_boy pricing
factory_boy fact sheet
| Free plan | Not verified |
|---|---|
| Paid from | Free |
| Generation modes | Synthetic |
| Relational data | Yes |
| API data generation | Yes |
| Supported data formats | Not verified |
| Deployment | Self-hosted |
| Generation limit | Not verified |
| Database connectors | Django ORM, MongoDB, MongoEngine, SQLAlchemy |
| Deployment | Self-hosted |
| Support | Community, Docs |
| Built for | Solo, Small business, Mid-market, Enterprise (editorial estimate) |
| Integrations | 5 integrations: Django, Mogo, MongoEngine, SQLAlchemy, Faker |
| Pricing | Open source |
| Website | factoryboy.readthedocs.io |
| Facts checked | 20 Sep 2026 |
factory_boy integrations
factory_boy lists 5 integrations on its own site.
- Django
- Mogo
- MongoEngine
- SQLAlchemy
- Faker
Alternatives to factory_boy
- MOSTLY AIA broad synthetic-data platform for enterprise relational data teams.9.4
- SynthesizedA database-focused platform for schema-faithful synthetic data and protected test environments.9.2
- Tonic FabricateA flexible choice for AI-assisted relational test data with API and export workflows.9.0
See all factory_boy alternatives →
Used factory_boy? Be the first to review it
The editor score above is our own research. What this page doesn't have yet is a reader's view — what you used factory_boy for, what worked and what didn't. No stars are seeded and no review is paid for; an editor reads every one before it appears.
Write a reviewTwo minutes · verified accounts only · read by an editor before it appears
Featured on iTechGuides
factory_boy is listed in our Test Data Generation Tools directory. Add the badge to your site — it links back to this page.
<a href="https://www.itechguides.com/products/factory-boy/"><img src="https://www.itechguides.com/best/badge/factory-boy.svg" alt="Featured on iTechGuides" width="230" height="46"></a>
Reviewed by iTechGuides Editors · Editorial team · Updated Oct 2026
Advertiser disclosure: iTechGuides is reader-supported. Vendors can pay for top positions in our rankings and for a place on other products' pages, and we may earn a commission when you click some links. Bought places stand at the number bought; this page and our disclosure say so. Paying vendors may get a fuller, more detailed review from our editors, and that review can change their score. How we rank.
Last updated · How we research and update


