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(domain, name), email_from_name(), free_email(), company_email(domain, name), safe_email(), url(), domain_name(), ipv4(), ipv6(), mac_address(), user_agent(), slug() emails(n, domain), free_emails(n), company_emails(n, domain), 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(), iso8601_between(), date_object(), date_time(), date_between(), date_time_between(), date_of_birth() dates(n, pattern), iso8601s(n), iso8601_betweens(n), date_objects(n), date_times(n), date_betweens(n), date_time_betweens(n), date_of_births(n)
Patterns & Primitives numerify(), lexify(), bothify(), pyint(), pyfloat(), pybool(), pystr(), password(), random_int(), random_element() (weighted), random_elements() (weighted/unique), random_sample(), random_choices(), 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 & Relational Faker(locale), Faker.seed(n), seed_instance(n), fake.unique.*, fake.optional.*, add_provider(), BaseProvider, Dataset, PrimaryKey, ForeignKey, Weighted, Derived, export_csv Locales: en_US, en_GB (UK postcodes/phones), 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.7.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.7.0
File Size Uploaded Provenance Actions
faker_rs-0.7.0.tar.gz 54.0 kB With provenance Details for faker_rs-0.7.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for faker-rs 0.7.0
File Actions
faker_rs-0.7.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for faker_rs-0.7.0-cp39-abi3-win_amd64.whl
faker_rs-0.7.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.7.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
faker_rs-0.7.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for faker_rs-0.7.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
faker_rs-0.7.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for faker_rs-0.7.0-cp39-abi3-macosx_11_0_arm64.whl
faker_rs-0.7.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for faker_rs-0.7.0-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 2.2 MB

Release files / faker_rs-0.7.0.tar.gz

Download URL faker_rs-0.7.0.tar.gz
Size 54.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b97f3073eb43ecd9fd5daecbff901fb90e172bed065dc0f15e2d6fbadeba0794
BLAKE2b-256 checksum
How to use checksums
18d08e21d8f9455c25fb07ec2b0acbeb64b0c1e5bc22d9683a77e85d183581fd
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 25, 2026.

Transparency log

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

Download URL faker_rs-0.7.0-cp39-abi3-win_amd64.whl
Size 358.8 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
12eb60153a4c504a80a94f2ba4a76548df834fe32d6cbfbc0cd25ec6b02e9d54
BLAKE2b-256 checksum
How to use checksums
14fb3619f3c0fcc6c6f0468a1e6c30048dfb935b0f6ed4ee6c1bc140f0f7fb03
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 25, 2026.

Transparency log

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

Download URL faker_rs-0.7.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 451.2 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
5a56aa8c29aa5f3a077782e6ce8daf0860645270647eae83b4f26f452721161e
BLAKE2b-256 checksum
How to use checksums
a31fa3565245727ba5ee66e7751323d6bfa3ac352c0d2d4d94b57aef42a37325
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 25, 2026.

Transparency log

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

Download URL faker_rs-0.7.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 454.1 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
ee37d4c9253b179b2371319898bc8ed31843230cc6841c94da117d39f0834646
BLAKE2b-256 checksum
How to use checksums
e0ccfa4ac7a722eb9aaada91643249d95cbf13b2707c686d837fb4cdebf61395
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 25, 2026.

Transparency log

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

Download URL faker_rs-0.7.0-cp39-abi3-macosx_11_0_arm64.whl
Size 412.3 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
eef26b22dfeab04db6c08d98a73b886df0a11305b24bd3453371e8908821abef
BLAKE2b-256 checksum
How to use checksums
d66cdbae4bd72802e94d583eac2c6f8d81a60fa79fed929149053be288883104
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 25, 2026.

Transparency log

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

Download URL faker_rs-0.7.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 420.3 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
c82ec9ce97c55327346f806ea5040313dc2f11180685b0360fd4c74162ebf11f
BLAKE2b-256 checksum
How to use checksums
8db84c57989a28eda572a276bfaae5ecb01d4fc99b8b85684fbe6101586fb7bf
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 25, 2026.

Transparency log

Security for faker-rs 0.7.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.7.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 25, 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