Metadata-Version: 2.4
Name: polarfactory
Version: 0.1.0
Summary: Generate Python objects filled with realistic test data.
Keywords: testing,test data,factory,fixtures,dataclasses,pydantic
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Testing
Classifier: Typing :: Typed
Requires-Dist: pydantic>=2.11 ; extra == 'pydantic'
Requires-Python: >=3.10
Project-URL: Homepage, https://github.com/PinnLabs/Polars
Project-URL: Documentation, https://pinnlabs.github.io/Polars/
Project-URL: Changelog, https://github.com/PinnLabs/Polars/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/PinnLabs/Polars/issues
Provides-Extra: pydantic
Description-Content-Type: text/markdown

# polarfactory

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

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

## Quickstart

```python
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
