Faker

A Python library that generates realistic fake data for testing, seeding, and anonymizing datasets across 70+ locales.

Library
PyPI
v40.37.0
19,383stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
93/100Excellent
Development Activity92
Maintenance96
Community84
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
84/100Excellent
Architecture85
Code Quality90
Innovation72
Learning Curve90

Faker is a Python package for generating fake data — names, addresses, text, dates, companies, credit cards, and dozens of other data types — for use in tests, database seeding, and mock APIs. Rather than hardcoding sample values, developers call methods on a Faker() instance (fake.name(), fake.address(), fake.text()) and get a different plausible-looking value on every call, with results seedable for reproducible test runs.

What sets Faker apart from similar libraries is its locale coverage: it ships hundreds of locale-specific provider modules so generated names, addresses, and phone numbers look native to a given country and language rather than defaulting to US English. It’s heavily inspired by PHP Faker, Perl Faker, and Ruby Faker, and its own API — Faker, Provider, Generator — has in turn become the reference pattern that fake-data libraries in other ecosystems copy.

It integrates directly into common Python testing workflows via a bundled pytest plugin (a faker fixture) and a faker CLI command for ad-hoc data generation from the shell or scripts in other languages. Custom data types are added by subclassing BaseProvider, so teams can extend it with domain-specific fake data (e.g. internal ID formats) without forking the library.

What You Get

  • A Faker() proxy object exposing hundreds of generator methods (name, address, email, date_time, company, credit_card_number, etc.) grouped into ~27 provider categories
  • Localization for 70+ locales, so generated names, addresses, and phone numbers match the conventions of a specific country/language rather than defaulting to en_US
  • A pluggable provider system — subclass BaseProvider to register custom fake-data generators alongside the built-in ones
  • A bundled pytest plugin exposing a faker fixture, plus a faker CLI command for generating values from the command line or shell scripts
  • Seedable, reproducible output via Faker.seed() / seed_instance(), and multi-locale instances that can weight which locale is used per call
  • A use_weighting mode that samples common values (e.g. common names) more frequently than rare ones, for more realistic-looking distributions

Common Use Cases

  • Seeding a development or staging database with realistic-looking sample records
  • Generating test fixtures and mock API responses without hand-writing sample data
  • Anonymizing production data by replacing real PII with structurally similar fake values
  • Populating demo environments and UI screenshots with varied, non-repetitive placeholder content
  • Stress-testing data pipelines and forms with large volumes of varied, locale-correct input

Under The Hood

Architecture Faker centers on a proxy pattern: the public Faker class (faker/proxy.py) wraps one or more per-locale Generator instances, created by Factory.create() (faker/factory.py), and forwards attribute access to whichever generator(s) are active — supporting single-locale, multi-locale, and weighted-locale configurations transparently through the same API. Factory._find_provider_class() (cached with functools.lru_cache) resolves each requested provider path to its locale-specific Provider class by walking that provider package’s locale submodules and falling back to a default_locale. Each Generator.add_provider() call then dynamically attaches every public method of a provider instance onto the generator via set_formatter()/setattr(), so fake.name() is really a formatter method registered at construction time rather than a hardcoded dispatch table — the whole system is a plugin registry, and swapping the core Generator/Factory abstractions would ripple through every one of the hundreds of locale-specific provider modules built on top of BaseProvider.

Tech Stack Faker is pure Python (99.9% of the codebase) targeting Python 3.10+, packaged with classic setuptools/setup.py and near-zero runtime dependencies (tzdata on Windows only, with optional extras for tzdata and Pillow-based image generation). It exposes two integration points beyond the library API: a console_scripts entry point (faker) implemented with argparse in faker/cli.py, and a pytest11 entry point registering a faker pytest fixture plugin. Type information ships via a py.typed marker and a proxy.pyi stub, checked under a strict mypy.ini (disallow_subclassing_any, disallow_incomplete_defs, check_untyped_defs). CI runs through GitHub Actions workflows (ci.yml, gh-release.yml) with tox coordinating multi-version test runs.

Code Quality The repository has an extensive test suite — 61 test files under tests/, covering the proxy, generator, factory, CLI argument parsing, uniqueness constraints, optional values, and provider output formats — plus a dedicated tests/providers tree exercising individual locale providers. Typing is enforced project-wide under a strict mypy configuration rather than left optional, and the codebase ships its own type stubs for consumers. No informal or ad-hoc error handling was observed; the library raises typed exceptions (faker/exceptions.py, e.g. UniquenessException) for well-defined failure modes like unresolvable unique-value constraints.

What Makes It Unique Faker’s differentiator is breadth and realism at scale: hundreds of locale-specific provider modules across roughly two dozen provider categories (address, person, company, phone_number, date_time, and more) give it native-looking output for a very wide set of languages and countries, not just template English data with substituted words. Its use_weighting mode goes further than uniform random selection — sampling common values (e.g. common first names) more frequently than rare ones so distributions look statistically plausible rather than uniformly random. The provider system is fully extensible via BaseProvider subclassing, letting teams register their own fake-data generators without modifying the library, and its Faker/Provider/Generator API design has become the pattern other language ecosystems’ fake-data libraries emulate.

Used by 7 apps in this directory

Python
50%
Other

Airbyte

Developer Tools · Data Engineering

21,971

Open-source ELT platform with 600+ connectors for moving data from any source to warehouses, lakes, and AI agents.

View details
95
Repo Health
80
Technical
67
Dependency
Built with
Python50%
Kotlin41%
Updated today
Python
67%
Other

AutoGPT

Automation · Productivity · AI Assistants

186,997

Build, deploy, and run autonomous AI agents that automate complex multi-step workflows using a visual block-based graph editor.

View details
93
Repo Health
78
Technical
67
Dependency
Built with
Python67%
TypeScript31%
Updated today
Python
64%
MIT

Flowfile

Data Engineering

345

Visual ETL that compiles to Polars — build pipelines on a canvas, export as standalone Python, and run anywhere without platform lock-in.

View details
83
Repo Health
81
Technical
66
Dependency
Built with
Python64%
Vue19%
TypeScript16%
Updated today
TypeScript
97%
Other

Infisical

Security · Devops

29,028

The open-source platform for secrets, certificates, privileged access, and AI agent security — all in one self-hostable system.

View details
91
Repo Health
84
Technical
66
Dependency
Built with
TypeScript97%
Updated yesterday
Python
51%
AGPL 3.0

LearnHouse

Learning Management · CMS

2,218

Open-source LMS with AI tutoring, real-time collaboration boards, live code execution, and built-in course monetization — self-hosted in minutes.

View details
90
Repo Health
77
Technical
67
Dependency
Built with
Python51%
TypeScript48%
Updated today
C++
66%
Other

Memgraph

Databases · AI Development

4,378

High-performance in-memory graph database for AI context and real-time analytics

View details
90
Repo Health
79
Technical
69
Dependency
Built with
C++66%
Python18%
Updated today
C
79%
AGPL 3.0

TDengine

Databases

25,093

A high-performance, open-source time-series database built in C for IoT, connected vehicles, and industrial monitoring workloads, with built-in stream processing, caching, and data subscription.

View details
97
Repo Health
71
Technical
69
Dependency
Built with
C79%
C++12%
Updated 2 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search