skillfed

types-factory-boy

Typing stubs for factory-boy

types-factory-boy v0.4.1 457.3K downloads/30d#6,548 on PyPI24
Permissive license MIT Active released

What it is and what it does

types-factory-boy is a PEP 561 type stub package that bridges the gap between factory-boy (a popular Python fixture library) and static type checkers. It provides type annotations for factory-boy's public API, allowing tools like mypy, PyCharm, and pytype to understand and validate code that uses factory-boy for generating test fixtures.

The package is a thin, zero-runtime-cost addition to your development environment. Once installed alongside factory-boy, it enables your type checker to catch type errors in fixture definitions and usage without requiring factory-boy itself to be rewritten with inline type hints. It supports Python 3.7 through 3.11 and is maintained actively.

Use it for:

  • Enable mypy or PyCharm to type-check factory-boy fixture definitions and catch type mismatches before runtime.
  • Validate that test factories produce objects matching expected type signatures in a typed codebase.
  • Provide IDE autocomplete and type hints for factory-boy class attributes and methods.
  • Integrate factory-boy into a strict type-checking CI pipeline without modifying factory-boy itself.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides PEP 561 type stubs for factory-boy, enabling static type checkers like mypy and PyCharm to validate code that uses factory-boy for test fixture generation.

Yes, if you use factory-boy in a type-checked codebase. It has no runtime overhead, low installation friction, and permissive licensing. The only caveat is that the latest release is from March 2023, so verify stub coverage matches your factory-boy version before relying on it for strict type enforcement.

Install

types-factory-boy on PyPI

pip

pip install types-factory-boy

uv

uv add types-factory-boy

poetry

poetry add types-factory-boy

Installing types-factory-boy

Before you install

Low friction installation with only two runtime dependencies (factory-boy and typing-extensions). Actively maintained as of August 2026, though the latest release is from March 2023.

License in practice

MIT license permits unrestricted use, modification, and distribution in both open and closed projects with minimal obligations.

Quickstart

pip install types-factory-boy

import factory
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    # Type checker now understands factory-boy classes
    pass

Requires factory-boy to be installed; type checking benefits only apply when using a compatible type checker like mypy, PyCharm, or pytype.

Verify before relying

  • Whether stub coverage is complete for all factory-boy public APIs and recent versions.
  • How frequently stubs are updated relative to factory-boy releases.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 2 — factory-boy, typing-extensions
Maintenance actively maintained — 1,251 days since the last release
Last repo commit
First released
Downloads 457,278/month — #6,548 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: types_factory_boy-0.4.1-py3-none-any.whl

Development Status :: 3 - AlphaLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Typing :: Stubs Only

Tags

type stubs factory-boymypy factory-boy typingfactory-boy type checkingpep 561 stubsstatic type checking fixturesfactory-boy type hints
type-stubstesting

More Quality Assurance packages