Skip to main content

faker-rs

CI PyPI version Python versions License

A high-performance, drop-in replacement for Python's Faker library, backed by Rust and PyO3.

Why faker-rs?

  • 14x–988x faster than Python Faker for test fixtures, synthetic datasets, and database seeding.
  • Zero-loop batch APIs (names(n), emails(n), credit_card_numbers(n), date_objects(n), etc.) generate an entire Python list in a single Rust loop.
  • Drop-in compatible: Faker(locale), Faker.seed(n), fake.unique.*, fake.optional.*, fake.add_provider(...), UniquenessException, and PEP 561 type stubs (py.typed).
  • Pre-built abi3 wheels for Linux (manylinux), macOS, and Windows (Python 3.9–3.15) — no Rust compiler needed to pip install.

10-Second Quickstart

pip install faker-rs
from faker_rs import Faker

fake = Faker()
print(fake.name())                # "Emily Johnson"
print(fake.email())               # "david.smith412@example.com"
print(fake.address())             # "4821 Oak Ave\nSpringfield, IL 62704"
print(fake.credit_card_number())  # Luhn-valid Visa / Mastercard / Amex
print(fake.date_of_birth(21, 65)) # datetime.date(...)
print(fake.uuid4())               # "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"

Drop-In Migration

Replace your import and keep your existing code:

# Before
# from faker import Faker
# from faker.exceptions import UniquenessException
# from faker.providers import BaseProvider

# After
from faker_rs import BaseProvider, Faker
from faker_rs.exceptions import UniquenessException

Faker.seed(42)
fake = Faker(["en_US", "fr_FR"])
users = [
    {
        "name": fake.name(),
        "email": fake.unique.email(),
        "phone": fake.optional.phone_number(p=0.8),
        "company": fake.company(),
        "ip": fake.ipv4(),
    }
    for _ in range(1000)
]

Batch Mode (Zero-Loop FFI)

For bulk generation, use the batch methods to generate an entire Python list in a single Rust loop:

fake = Faker(seed=42)
names = fake.names(100_000)
emails = fake.emails(100_000)
floats = fake.pyfloats(100_000)

Provider Compatibility

Category Single Methods Batch Methods
Person name(), first_name(), last_name(), user_name() names(n), first_names(n), last_names(n), user_names(n)
Address address(), city(), state(), postcode(), country() addresses(n), cities(n), states(n), postcodes(n), countries(n)
Company & Contact company(), job(), phone_number() companies(n), jobs(n), phone_numbers(n)
Internet email(), free_email(), company_email(), safe_email(), url(), domain_name(), ipv4(), ipv6(), mac_address(), user_agent(), slug() emails(n), free_emails(n), company_emails(n), safe_emails(n), urls(n), domain_names(n), ipv4s(n), ipv6s(n), mac_addresses(n), user_agents(n), slugs(n)
Finance credit_card_number(), credit_card_expire(), credit_card_security_code(), credit_card_provider(), iban(), currency_code() credit_card_numbers(n), credit_card_expires(n), credit_card_security_codes(n), credit_card_providers(n), ibans(n), currency_codes(n)
Date & Time date(pattern), iso8601(), date_object(), date_time(), date_between(), date_of_birth() dates(n, pattern), iso8601s(n), date_objects(n), date_times(n), date_betweens(n), date_of_births(n)
Patterns & Primitives numerify(), lexify(), bothify(), pyint(), pyfloat(), pybool(), pystr(), password(), random_int(), random_element(), random_elements(), boolean() numerifys(n), lexifys(n), bothifys(n), pyints(n), pyfloats(n), pybools(n), pystrs(n), passwords(n), random_ints(n), booleans(n)
Text, Color, Geo, File word(), words(), sentence(), paragraph(), paragraphs(), text(), hex_color(), rgb_color(), latitude(), longitude(), file_name(), mime_type(), uuid4() words_batch(n), sentences(n), paragraphs_batch(n), texts(n), hex_colors(n), rgb_colors(n), latitudes(n), longitudes(n), file_names(n), mime_types(n), uuid4s(n)
Framework Faker(locale), Faker.seed(n), seed_instance(n), fake.unique.*, fake.optional.*, add_provider(), BaseProvider Locales: en_US, en_GB, de_DE, fr_FR, es_ES, ja_JP

Benchmarks (100,000 Records)

Measured on Windows (CPython 3.12.11, faker==40.63.0, built with maturin develop --release) via python benchmarks/bench.py:

Provider Python Faker faker-rs (single loop) Single Speedup faker-rs (batch) Batch Speedup
name 8.3959 s 0.0130 s 647.1x 0.0085 s 988.8x
company 11.8047 s 0.0173 s 681.7x 0.0126 s 939.5x
address 11.8129 s 0.0243 s 485.9x 0.0188 s 627.1x
email 8.3588 s 0.0194 s 430.0x 0.0136 s 614.5x
ipv4 3.1587 s 0.0194 s 162.5x 0.0147 s 214.2x
credit_card_number 1.4828 s 0.0170 s 87.3x 0.0104 s 142.0x
pyfloat 0.5233 s 0.0105 s 49.8x 0.0052 s 99.7x
phone_number 1.0438 s 0.0154 s 67.9x 0.0110 s 95.2x
text 4.7037 s 0.0771 s 61.0x 0.0696 s 67.6x
password 0.6328 s 0.0189 s 33.4x 0.0116 s 54.7x
date 0.6379 s 0.0196 s 32.6x 0.0120 s 53.0x
numerify 0.3167 s 0.0142 s 22.4x 0.0077 s 41.3x
date_object 0.3751 s 0.0167 s 22.4x 0.0122 s 30.7x
ipv6 0.4850 s 0.0229 s 21.2x 0.0187 s 25.9x
uuid4 0.1971 s 0.0129 s 15.3x 0.0085 s 23.3x
date_time 0.3783 s 0.0271 s 14.0x 0.0221 s 17.1x

Contributing

Contributions are welcome! See CONTRIBUTING.md for local maturin develop setup instructions and PR guidelines.

License

Dual-licensed under either of:

at your option.

Metadata

Release files for faker-rs 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for faker-rs 0.6.0
File Size Uploaded Provenance Actions
faker_rs-0.6.0.tar.gz 45.1 kB With provenance Details for faker_rs-0.6.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for faker-rs 0.6.0
File Actions
faker_rs-0.6.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for faker_rs-0.6.0-cp39-abi3-win_amd64.whl
faker_rs-0.6.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for faker_rs-0.6.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
faker_rs-0.6.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for faker_rs-0.6.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
faker_rs-0.6.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for faker_rs-0.6.0-cp39-abi3-macosx_11_0_arm64.whl
faker_rs-0.6.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for faker_rs-0.6.0-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 2.0 MB

Release files / faker_rs-0.6.0.tar.gz

Download URL faker_rs-0.6.0.tar.gz
Size 45.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9b2873165317c9f470047bf65e44d2909620562cd999f84b20d26659c7a508df
BLAKE2b-256 checksum
How to use checksums
f588846c7aa389a789921d45be1cb7a48b78aa1ff052de392036f1642e6ef951
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / faker_rs-0.6.0-cp39-abi3-win_amd64.whl

Download URL faker_rs-0.6.0-cp39-abi3-win_amd64.whl
Size 328.8 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
d250e1f1328b410c27d3c2b97ad354f7b76336a07c1aa3eac4f0cd3b933340a1
BLAKE2b-256 checksum
How to use checksums
32af94e8f46106e24cb15c81edb40ff9690f72bbccbabf9769b7f902a837005d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / faker_rs-0.6.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL faker_rs-0.6.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 421.7 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
b1ff7c83aafa05dc1ed7c910f41a63b24779c471adb951008d8a0e5f2e1a5bdd
BLAKE2b-256 checksum
How to use checksums
7cea9c0e0d720f03dd146a9ea71d88300a77fe9abb0e7e7d811e827c716e11f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / faker_rs-0.6.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL faker_rs-0.6.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 427.4 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
ab1b557aaebb1def44fcc5c91a2546f90e5234c5d40ddadf9a939de19da520b5
BLAKE2b-256 checksum
How to use checksums
095c3781beb9c2b301d189a8123c4800e14ba50b03d8a29bdf834ade1a312f1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / faker_rs-0.6.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL faker_rs-0.6.0-cp39-abi3-macosx_11_0_arm64.whl
Size 383.9 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6f2f0552346b02a2afa8e8090b46fbb4e07b7c7e0833fc16c5f0e26431004d1d
BLAKE2b-256 checksum
How to use checksums
a7c815ead916e4363570cfd366c0d3c892779fb38b3bdb9dac1bcfa52c5311c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / faker_rs-0.6.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL faker_rs-0.6.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 392.0 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
33b3ee572c4cb0f2b650458172b42e96558216e4d2c81aca21fd6437d3c8a639
BLAKE2b-256 checksum
How to use checksums
d7c10bb66db097c178cdc67c38f46d6c8f9f5b9088feaf4b4a9bf421759f902c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Security for faker-rs 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for faker_rs-0.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page