Skip to main content

A fake data generator that is pydantic compatible.

Project description

Pyfake

Pyfake

A flexible, schema-driven fake data generator built on top of Pydantic v2.


Docs: https://pyfake.readthedocs.io/en/latest  •  Source: https://github.com/Mukhopadhyay/pyfake


✨ Why Pyfake?

Most fake data generators are either:

  • ❌ Random but not structured
  • ❌ Structured but not realistic
  • ❌ Hard to extend

Pyfake fixes that.

It leverages Pydantic models as the single source of truth to generate:

  • ✅ Validated data
  • ✅ Schema-aware fake data
  • ✅ Easily extensible generators
  • ✅ Strong typing + IDE autocomplete

⚡ Quick Example

import uuid
from typing import Annotated
from pydantic import BaseModel, Field
from pyfake import Pyfake


class User(BaseModel):
    id: uuid.UUID = Field(default_factory=uuid.uuid4)
    name: Annotated[str, Field(min_length=3, max_length=20)]
    address: Annotated[str, Field(max_length=255)]
    age: Annotated[int, Field(ge=18)]
    is_deleted: bool


users = Pyfake.from_schema(User, num=5)

print(users)

🧠 How It Works

Pyfake reads your Pydantic schema and:

  • Inspects field types and constraints
  • Applies intelligent generators
  • Produces validated fake data
flowchart LR
    A[Pydantic Model] --> B[Schema Parser]
    B --> C[Generator Engine]
    C --> D[Validated Fake Data]

Installation

Using uv (Recommended)

uv add pyfake

*Using pip

python -m venv .venv
source .venv/bin/activate
pip install pyfake

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfake-0.0.7.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyfake-0.0.7-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file pyfake-0.0.7.tar.gz.

File metadata

  • Download URL: pyfake-0.0.7.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pyfake-0.0.7.tar.gz
Algorithm Hash digest
SHA256 48d3788caaf6687e2f8d58ecf2318779e88896e0da2c99e0ee48d70be83d5d19
MD5 c4ec2bb55e6839170e0fbdcaad1b1805
BLAKE2b-256 860c73bd413a894f07551abadf2de669fd7374515de6dc9192e4a9dd75324d53

See more details on using hashes here.

File details

Details for the file pyfake-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: pyfake-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pyfake-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 2d6d2a77e0ff010f98f6a70c5d77a259b3c0317dca6ffbfccfa6d216a20f2c0f
MD5 aeff7e0988f9ed3293055c4e49b98f72
BLAKE2b-256 17d5f41838357a63e75b548f7c1be12774ffcd91656da50b99b3c9d15afed6a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page