# FactoryBoy/factory_boy

A test fixtures replacement for Python

Repository: https://github.com/FactoryBoy/factory_boy
Canonical: https://ross.abutalabs.com/products/factory_boy
Homepage: https://factoryboy.readthedocs.io/
Language: Python
License: MIT
License Family: permissive
Topics: hacktoberfest, django, sqlalchemy, python, testing, fixtures
Last push: 2026-01-01T19:04:12+00:00

## Health v2 (maintenance only)
Score: 59/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 60, release rhythm 35, longevity 100
- inputs: {"age_days": 5593, "days_push": 244, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3804, forks 420 (observed 2026-08-28T04:08:20.225775+00:00)

## What it is
factory_boy is a Python test fixtures replacement inspired by Ruby's factory_bot. It lets developers define declarative factories for creating test objects, working well with ORMs like Django, SQLAlchemy, and MongoDB.

## Use cases
- generate test data for django models
- replace static fixtures in python tests
- create test objects with only test-specific fields
- build test fixtures for sqlalchemy
- set up complex object graphs in unit tests
- create mock users and orders for integration tests

## When to choose
- you maintain repetitive, hard-to-update static test fixtures
- your tests need many variations of model instances
- you use Django, SQLAlchemy, or MongoDB and want ORM-aware factories

## When to avoid
- you only need simple hardcoded test constants
- your project is not in Python
- you prefer property-based or random data generation over declarative factories

## Facets
- artifact type: library
- maturity: stable
- function: testing, mocking, data-generation
- domain: testing, developer-tools, web-development
- platform: python
- tags: test-fixtures, factory-pattern, django, sqlalchemy, orm

## Member repositories
- FactoryBoy/factory_boy (main) score 59

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:20.225775+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:26:47.577495+00:00, confidence not recorded.
  - readme: https://github.com/FactoryBoy/factory_boy (fetched 2026-08-28T04:08:20.225775+00:00, sha b0a48d8ed205)
  - registry_pypi: https://pypi.org/pypi/factory_boy/json (fetched 2026-08-29T09:22:13.795939+00:00, sha ab6adc0605db)
- Data as of 2026-08-30T08:39:29.467469+00:00.
