Skip to main content

polarfactory

Generate Python objects filled with realistic test data, from the type hints you already have.

pip install polarfactory
pip install "polarfactory[pydantic]"  # optional: Pydantic v2 support

Quickstart

from dataclasses import dataclass
from datetime import datetime

from polarfactory import build, build_many


@dataclass
class Address:
    city: str
    country: str


@dataclass
class User:
    id: int
    name: str
    email: str
    created: datetime
    address: Address
    tags: list[str]
    nickname: str | None


user = build(User, seed=42)
# User(id=8753, name='Grace Rossi', email='mateo.brown2@example.org',
#      created=datetime.datetime(2022, 3, 4, 1, 29, 27, tzinfo=datetime.timezone.utc),
#      address=Address(city='Toronto', country='Nigeria'),
#      tags=['hwnoekxw', 'lucfvluc', 'pxxscfvm'], nickname='dpsjyett')

build(User, seed=42, name="Ana")  # same values, except name
build_many(User, 3, seed=1)  # three different users, same list every run
  • Same seed, same object, in every process.
  • Works with dataclasses, plain classes and Pydantic v2 models, including nested ones.
  • Field names like email, name or city get realistic values.
  • Errors say how to fix the problem.

Full documentation: https://pinnlabs.github.io/Polars/

License

MIT

Metadata

Release files for polarfactory 0.1.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 polarfactory 0.1.0
File Size Uploaded Provenance Actions
polarfactory-0.1.0.tar.gz 10.6 kB With provenance Details for polarfactory-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for polarfactory 0.1.0
File Interpreter ABI Platform Actions
polarfactory-0.1.0-py3-none-any.whl Python 3 none any Details for polarfactory-0.1.0-py3-none-any.whl

Total release size: 22.9 kB

Release files / polarfactory-0.1.0.tar.gz

Download URL polarfactory-0.1.0.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d51c34708c5e049edc0ed2885be05dd815be948ba07cad9a8a092b78a8afe8f1
BLAKE2b-256 checksum
How to use checksums
ae32513e20a8885f955d9534f0bfc0fefe3fb33659ab16a730a7bb039dc2d75d
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 12, 2026.

Transparency log

Release files / polarfactory-0.1.0-py3-none-any.whl

Download URL polarfactory-0.1.0-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0aa8a23e607278968f4460aeec97c7739a50f6fc91fc087a83fd9c41d51feef
BLAKE2b-256 checksum
How to use checksums
5bb7d8b91faa7fc08c1b257699072491373fba4094d07d797fc9fc17dad72415
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 12, 2026.

Transparency log

Security for polarfactory 0.1.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for polarfactory-0.1.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 12, 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.

Release history Release notifications | RSS feed

This release

0.1.0 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