awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
FactoryBoy avatar

FactoryBoy/factory_boy

0
View on GitHub↗
3,799 stars·417 forks·Python·MIT·11 viewsfactoryboy.readthedocs.io↗

Factory Boy

Factory Boy is a dynamic test fixture framework and data generation tool for Python. It serves as a replacement for static fixtures by providing a system to create complex Python objects and database models through programmable blueprints.

The project differentiates itself by offering specialized integration with Object Relational Mappers to manage persistence within database sessions. It enables the creation of complex object hierarchies using sub-factories and recursive composition to resolve dependent related objects.

The framework provides capabilities for synthesizing realistic random data via provider libraries and generating unique values through stateful sequences. It includes various instantiation strategies to determine whether objects are persisted to a database, built in memory, or returned as lightweight stubs. Additional functionality covers the use of lazy-evaluated attributes, post-instantiation hooks, and the ability to seed random values for reproducibility.

Features

  • Automated Test Data Generation - Provides a dynamic alternative to static fixtures by generating complex test objects and records.
  • Object Blueprints - Implements programmable blueprints to ensure consistent instantiation of complex Python objects and database models.
  • Test Object Factories - Provides a programmable system to generate complex Python objects and database models as dynamic replacements for static test fixtures.
  • Model Instantiation - Instantiates database model objects by mapping programmable factory declarations to specific data models.
  • Test Object Associations - Automatically links related objects during test data generation through factory associations.
  • ORM Integrations - Integrates with various Object Relational Mappers to handle persistence and instantiation logic automatically.
  • Realistic Data Generators - Produces plausible random attribute values using providers to help uncover edge-case bugs during testing.
  • Random Provider Integrations - Integrates external provider libraries to inject realistic randomized fake data into object attributes.
  • Test Data Generators - System for producing random and realistic test data in Python using providers and stateful sequences.
  • Custom Object Instantiation - Uses a set of default attributes within a factory to ensure consistent object instantiation across tests.
  • Nested Factory Composition - Builds complex object graphs by triggering nested factory calls to resolve dependent related objects.
  • Test Object Graph Generation - Enables the creation of complex object graphs using sub-factories and automatic circular dependency resolution.
  • ORM Adapters - Uses specialized adapters to handle database session management and object mapping across different ORMs.
  • Database Object Mocking - Generates persisted or in-memory database objects with complex associations for testing.
  • ORM Fixture Management - Generates complex database model instances and related object hierarchies for testing ORM-based applications.
  • Random Value Generators - Creates random integers, floats, decimals, and dates using fuzzy declarations to vary object attributes.
  • Dynamic Fixture Frameworks - Serves as a dynamic replacement for static fixtures, generating object hierarchies with programmable attributes.
  • Test Data Blueprinting - Defines reusable templates for object creation with default attributes and conditional logic for consistent test setups.
  • Test Sequence Generation - Produces unique incrementing values for fields and supports resetting the counter for new cycles.
  • Test Object Persistence Management - Manages database sessions and implements get-or-create behavior for data models during object generation.
  • Object Generation Hooks - Runs custom logic or method calls on an object immediately after the instantiation process completes.
  • Lazy Evaluation - Allows field values to be computed at runtime using functions that reference other attributes on the same object.
  • Dynamic Attribute Management - Defines attribute values that are computed at runtime using lazy functions or cross-references to other fields.
  • Computed Attribute Derivation - Calculates attribute values at runtime using functions or by referencing other existing attributes on the object.
  • Batch Object Generation - Enables the generation of multiple object instances in a single call to create varied datasets.
  • Post-Instantiation Hooks - Executes custom methods or logic on objects immediately after they have been instantiated.
  • Random Number Generation - Manages random seeds to ensure that generated test data and failing tests are reproducible.
  • Edge Case Test Suites - Produces realistic but random data values to uncover bugs and boundary conditions missed by static data.
  • Test Instantiation Strategies - Provides strategies to determine if objects are persisted to a database, built in memory, or returned as stubs.
  • Test Sequence Generators - Provides stateful counters to generate unique incrementing values for object attributes.
  • Testing Tools - Listed in the “Testing Tools” section of the Awesome Python awesome list.

Star history

Star history chart for factoryboy/factory_boyStar history chart for factoryboy/factory_boy

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Frequently asked questions

What does factoryboy/factory_boy do?

Factory Boy is a dynamic test fixture framework and data generation tool for Python. It serves as a replacement for static fixtures by providing a system to create complex Python objects and database models through programmable blueprints.

What are the main features of factoryboy/factory_boy?

The main features of factoryboy/factory_boy are: Automated Test Data Generation, Object Blueprints, Test Object Factories, Model Instantiation, Test Object Associations, ORM Integrations, Realistic Data Generators, Random Provider Integrations.

Which projects share features with factoryboy/factory_boy?

Projects with overlapping indexed features include: thoughtbot/factory_bot — FactoryBot is a Ruby library for generating complex test objects and their associations, serving as a dynamic… nelmio/alice — Alice is a PHP test data generator and fixture library used to automate the creation of large sets of fake objects and… chancejs/chancejs — Chance is a JavaScript library for generating random data, designed to produce realistic test data for automated tests… dubzzz/fast-check — fast-check is a property-based testing framework and random data generator designed to verify software invariants by… fzaninotto/faker — Faker is a PHP library for creating realistic synthetic data used for testing, prototyping, and populating database… lk-geimfari/mimesis — Mimesis is a Python synthetic data generator used to create realistic fake datasets and mock data for software testing…

Projects sharing features with Factory Boy

These projects share indexed features with Factory Boy. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • thoughtbot/factory_botthoughtbot avatar

    thoughtbot/factory_bot

    8,176View on GitHub↗

    FactoryBot is a Ruby library for generating complex test objects and their associations, serving as a dynamic alternative to static fixture files. It provides a system for defining reusable data blueprints with default attributes and inheritance to produce consistent test records. The tool distinguishes itself through flexible instantiation strategies, allowing users to control whether objects are persisted to a database, built in memory, or created as stubs. It manages data uniqueness via a sequence generator for incremental values and uses traits to bundle shared attributes into reusable mo

    Rubyfactoriesfactory-botfactory-girl
    View on GitHub↗8,176
  • nelmio/alicenelmio avatar

    nelmio/alice

    2,539View on GitHub↗

    Alice is a PHP test data generator and fixture library used to automate the creation of large sets of fake objects and entities. It functions as an object hydrator and random data provider, allowing users to define the structure and attributes of dummy test data in markup or arrays to simulate specific application states. The library distinguishes itself through a template-based system that supports fixture inheritance to reduce data duplication. It utilizes a flexible instantiation model that allows for custom factory integration, method invocation, and property hydration via reflection or c

    PHPaliceexpression-languagefaker
    View on GitHub↗2,539
  • chancejs/chancejschancejs avatar

    chancejs/chancejs

    6,541View on GitHub↗

    Chance is a JavaScript library for generating random data, designed to produce realistic test data for automated tests and prototypes. It uses a Mersenne Twister pseudo-random number generator that accepts an optional seed value, enabling reproducible sequences of random values across multiple runs. The library provides a wide range of generators for common data types, including random integers, floats, booleans, characters, strings, and dates, all with configurable ranges and character pools. It can generate realistic geographic data like addresses, as well as financial data such as credit c

    JavaScript
    View on GitHub↗6,541
  • dubzzz/fast-checkdubzzz avatar

    dubzzz/fast-check

    4,778View on GitHub↗

    fast-check is a property-based testing framework and random data generator designed to verify software invariants by producing a wide range of randomized input data. It functions as a test data fuzzer that executes predicates against high volumes of random inputs to uncover edge cases and critical bugs. The project is distinguished by its ability to perform input-shrinking searches, which reduce complex failing inputs to their simplest form to isolate the exact cause of failure. It provides deterministic seed replay to exactly reproduce specific test failures and includes a concurrency testin

    TypeScriptfakerfuzzinggenerative-testing
    View on GitHub↗4,778
  • Compare all 30 related projects→