Skip to main content

⚡ Async Batch Faker

PyPI version License: MIT

A ridiculously fast, asynchronous, and vectorized mock data generator for Python.

Built to solve the bottleneck of seeding massive databases in modern web frameworks and data science pipelines. While standard Faker is great for generating a single row for unit testing, Async Batch Faker uses numpy and asyncio to blast hundreds of thousands of rows of localized data in seconds.

🚀 Performance

Benchmarked generating 100,000 complex records (UUIDs, localized names, emails, IPs, crypto codes) on a standard machine:

  • Standard Python Faker: ~9,000 rows / second
  • Async Batch Faker: ~116,000 rows / second (12.8x Faster)

✨ Killer Features

  • Numpy Vectorization: Mathematical data and string concatenations are calculated instantly in C via numpy arrays, bypassing slow Python for loops.
  • Omni-Data Architecture: Dynamically loads hundreds of localized datasets (names, cities, jobs, IPs) directly into memory from text files.
  • Typo Protection: Built-in fuzzy matching actively suggests the correct field if you misspell a provider (e.g., typing fake.colr suggests color_name).
  • Zero-Friction DX: Built for all skill levels. Generate simple Python lists, stream massive CSVs, or unblock your event loop with async database batching.

The 100MB PyPI Bypass (Dynamic Auto-Downloading)

To bypass PyPI's strict 100MB upload limits while giving you access to gigabytes of worldwide synthetic data, this library uses a Two-Tier Architecture:

  • Lightweight Core: The pip package installs instantly, bundling only the blazing-fast core engine and standard en_US datasets.

  • Transparent Auto-Fetching: When you initialize an international locale (e.g., AsyncBatchFaker(locale="fr_FR")), the engine intercepts the request and silently auto-downloads the highly optimized JSON data package from our GitHub Releases directly into your local ~/.cache/async_batch_faker/ directory.

It only downloads once. Every subsequent run loads the locale from your local NVMe/SSD directly into memory at blistering speed.

📦 Installation

pip install async-batch-faker

(Requires Python 3.8+ and numpy)

💻 Quick Start (3 Ways to Generate Data)

You don't need to be an expert in asyncio or numpy to use this library. We designed it to be as simple as possible.

Level 1: Just give me a Python List (Beginners)

Generate tens of thousands of records instantly in standard Python, no async knowledge required.

from async_batch_faker import AsyncBatchFaker

# Initialize with your preferred locale (defaults to en_US)
fake = AsyncBatchFaker(locale="ur_PK")

schema = {
    "id": fake.uuid4,
    "name": fake.full_name,
    "email": fake.email,
    "city": fake.city,
}

# Returns a standard list of dictionaries instantly
data = fake.generate(schema=schema, total=10000)
print(data[0])  # {'id': '...', 'name': '...', 'email': '...', 'city': '...'}

Level 2: Export straight to CSV (Data Science)

Need a massive dataset for Pandas, Excel, or Kaggle? Stream it directly to a file without overloading your RAM.

from functools import partial
from async_batch_faker import AsyncBatchFaker

fake = AsyncBatchFaker()

# Add custom arguments using functools.partial
schema = {
    "name": fake.full_name,
    "joined_at": partial(
        fake.date_between, start_date="2020-01-01", end_date="2025-01-01"
    ),
    "is_active": fake.boolean,
}

# Generates 1 MILLION rows and saves them to a file in ~8 seconds
fake.to_csv(schema=schema, total=1_000_000, filename="users.csv")

Level 3: Async Database Seeding (Advanced/Pro)

If you are seeding a database, use the async batch generator to stream data without blocking your event loop. Perfect for aiosqlite, asyncpg, or motor.

import asyncio
from async_batch_faker import AsyncBatchFaker

async def seed_db():
    fake = AsyncBatchFaker()
    schema = {"id": fake.uuid4, "email": fake.email, "ip": fake.ipv4}

    # Generates 500,000 records, yielding in chunks of 50,000
    batch_generator = fake.generate_batches(
        schema=schema, total=500000, batch_size=50000
    )

    async for batch in batch_generator:
        # Bulk-insert this batch to your database here
        # await db.executemany(query, batch)
        print(f"Inserted {len(batch)} records...")

if __name__ == "__main__":
    asyncio.run(seed_db())

🔍 Exploring the Data (No Guessing Required)

Because async-batch-faker dynamically loads hundreds of datasets directly from localized text files, you might wonder exactly what fields you can generate. We built helper methods directly into the engine so you never have to guess or check the source code.

View all available data fields

from async_batch_faker import AsyncBatchFaker

fake = AsyncBatchFaker(locale="en_US")

# Prints an alphabetical list of EVERY provider you can use!
# Examples: 'color_name', 'cryptocurrency_code', 'mime_type', 'job_title'
print(fake.get_providers())

View all supported countries/locales

# Prints a list of all supported locales (e.g., 'ur_PK', 'fr_FR', 'ja_JP')
print(AsyncBatchFaker.available_locales())

🛡️ Typo Protection

If you misspell a provider, the engine won't just crash with a cryptic error—it will analyze your typo and suggest the correct field automatically.

fake.colr(size=100)
# AttributeError: 'AsyncBatchFaker' has no provider 'colr'. Did you mean 'color_name'?
# 💡 Tip: Run `print(fake.get_providers())` to see all available datasets.

📝 License

MIT License. Created by Kashan Haider.

Metadata

Release files for async-batch-faker 0.1.3.1

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

Source distribution (sdist)

Source distribution for async-batch-faker 0.1.3.1
File Size Uploaded Provenance
async_batch_faker-0.1.3.1.tar.gz 14.0 MB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for async-batch-faker 0.1.3.1
File Interpreter ABI Platform
async_batch_faker-0.1.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 28.1 MB

Release files / async_batch_faker-0.1.3.1.tar.gz

Download URL async_batch_faker-0.1.3.1.tar.gz
Size 14.0 MB
Tags Source
SHA-256 checksum
How to use checksums
b5e7aff10c936a63b0e23fb021be3fe89ecfccb47d6c2f351376bff9c29b5eea
BLAKE2b-256 checksum
How to use checksums
ab976ac4487a5538d0a65ae66a9316a05ade4f0136819a3d730d2a8e524ecec2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 2, 2026.

Transparency log

Release files / async_batch_faker-0.1.3.1-py3-none-any.whl

Download URL async_batch_faker-0.1.3.1-py3-none-any.whl
Size 14.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
dde0de37e4796c3a49d90dbd8695344107a457bb08854f7f7e5b75dfe4c69a4c
BLAKE2b-256 checksum
How to use checksums
8a8d557b040000b702864b8814533ea0dd87dcad5d8f1df63dd7d04fbf7d738a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 2, 2026.

Transparency log

Security for async-batch-faker 0.1.3.1

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 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for async_batch_faker-0.1.3.1.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 Aug 2, 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.

Release history Release notifications | RSS feed

This release

0.1.3.1 This release

2 release files Full provenance

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