--- id: autofaker version: "2.0.24" license: unclear license_treatment: permissive maintenance: active --- # autofaker — Python library designed to minimize the setup/arrange phase of your unit tests License: permissive · Maintenance: active · Downloads: 208.5K/mo ## 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 above — verify before relying. AutoFaker generates anonymous test data and objects automatically, reducing boilerplate in unit test setup by creating instances of built-in types, dataclasses, and custom classes with minimal configuration. 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 pip install autofaker uv add autofaker poetry add autofaker ## Installing autofaker 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. 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' Requires Python 3.10 or newer. 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: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 208.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags unit test data generation, test fixture automation, anonymous object creation, arrange phase simplification, fake data for testing, test setup boilerplate reduction, autofixture python, test-data-generation, unit-testing, test-fixtures [View on SkillFed](https://skillfed.io/packages/autofaker) · [View on PyPI](https://pypi.org/project/autofaker/)