autofaker
Python library designed to minimize the setup/arrange phase of your unit tests
Decision gist · record as of 2026-08-14
Yes. Low install friction, active maintenance, no known vulnerabilities, permissive license, and a clear fit for test-heavy projects. Install if you write unit tests and want to reduce setup boilerplate; skip only if your test suite is minimal or you prefer explicit test data factories.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or newer.
- Low friction: pure Python wheel with only three runtime dependencies (pandas, faker, typing_inspect).
- Actively maintained with recent releases; last commit 2026-07-30.
License · maintenance · safety
permissive license (permissive) — MIT license (permissive) allows use in commercial and private projects with minimal restrictions; attribution required but no copyleft obligations.
last release 2026-06-05 (70 days) · last repo commit 2026-07-30 · 8 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 208,464 downloads/mo, #9,531 on PyPI
Alternatives
Verify before relying
pip install autofaker
from autofaker import Autodata
from dataclasses import dataclass
@dataclass
class User:
id: int
name: str
user = Autodata.create(User)
print(user.id, user.name)
# With fake data
user_fake = Autodata.create(User, use_fake_data=True)
print(user_fake.name) # e.g., 'Justin Wise'- Whether the library handles all common test scenarios or has known gaps in type coverage beyond what the description lists.
- Performance characteristics when generating large test datasets or deeply nested object graphs.
- Integration maturity with popular test frameworks beyond unittest (pytest, nose2, etc.).
What it is and what it does
AutoFaker is a test data generation library that automates the arrange phase of unit tests by creating anonymous instances of types on demand. Instead of manually instantiating objects with placeholder values just to satisfy type requirements, you call Autodata.create(SomeType) and get a populated instance. It supports built-in types (int, str, float, datetime), dataclasses, nested classes, enums, Literal types, and pandas DataFrames. When you need realistic rather than random data, you can enable fake data generation via faker to populate fields with names, addresses, emails, and other plausible values.
The library provides two main interfaces: direct calls like Autodata.create(int) for one-off generation, and decorators (@autodata, @fakedata) that inject generated arguments into test methods, letting you declare what types you need as function parameters or type annotations. It's designed for ETL and data-heavy testing scenarios but works for any test that needs to reduce setup boilerplate.
Use it for
- Reduce arrange-phase code in unit tests by auto-generating simple types and dataclass instances instead of manual instantiation.
- Generate realistic fake data (names, addresses, emails) for integration tests of data pipelines and ETL workflows.
- Populate nested object graphs and collections automatically without writing recursive factory code.
- Parameterize test methods with generated arguments using @autodata decorator to keep test code concise.
- Create anonymous pandas DataFrames with random or fake data for testing data transformation logic.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Low install friction, active maintenance, no known vulnerabilities, permissive license, and a clear fit for test-heavy projects. Install if you write unit tests and want to reduce setup boilerplate; skip only if your test suite is minimal or you prefer explicit test data factories.
Install
autofaker on PyPI
Before you install
Low friction: pure Python wheel with only three runtime dependencies (pandas, faker, typing_inspect). Actively maintained with recent releases; last commit 2026-07-30. Requires Python 3.10 or newer.
Requires Python 3.10 or newer.
License in practice
MIT license (permissive) allows use in commercial and private projects with minimal restrictions; attribution required but no copyleft obligations.
Quickstart
pip install autofaker
from autofaker import Autodata
from dataclasses import dataclass
@dataclass
class User:
id: int
name: str
user = Autodata.create(User)
print(user.id, user.name)
# With fake data
user_fake = Autodata.create(User, use_fake_data=True)
print(user_fake.name) # e.g., 'Justin Wise'
Verify before relying
- Whether the library handles all common test scenarios or has known gaps in type coverage beyond what the description lists.
- Performance characteristics when generating large test datasets or deeply nested object graphs.
- Integration maturity with popular test frameworks beyond unittest (pytest, nose2, etc.).
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagespandasfakertyping_inspect |
| Maintenance | Actively maintained 70 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 208,464 / month, #9,531 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 |
Evidence: autofaker-2.0.24-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “unit test data generation”
- autofakerAutoFaker generates anonymous test data and objects automatically,…
- pydantic-factoriesGenerates mock data objects that conform to pydantic models,…
- polyfactoryPolyfactory generates mock data objects from type hints, supporting…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also streamlit-faker · robotframework-faker · faker-e164 · faker-enum · odoo-test-helper · Faker · fake-factory · pytest-faker · polyfactory · aiounittest