Metadata-Version: 2.1
Name: phanas-pydantic-helpers
Version: 1.0.1
Summary: A collection of helper functions/classes for Pydantic.
Home-page: https://github.com/Phanabani/phanas-pydantic-helpers
License: MIT
Keywords: pydantic,helper,helpers
Author: Phanabani
Author-email: phanabani@gmail.com
Requires-Python: >=3.6,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Provides-Extra: time
Requires-Dist: pendulum (>=2.1.2,<3.0.0); extra == "time"
Requires-Dist: pydantic (>=1.10.4,<2.0.0)
Requires-Dist: pytimeparse (>=1.1.8,<2.0.0); extra == "time"
Requires-Dist: typing-extensions (>=4.4.0,<5.0.0)
Project-URL: Repository, https://github.com/Phanabani/phanas-pydantic-helpers
Description-Content-Type: text/markdown

# Phana's Pydantic Helpers

[![pypi](https://img.shields.io/pypi/v/phanas-pydantic-helpers)]()
[![pypi-python](https://img.shields.io/pypi/pyversions/phanas-pydantic-helpers)]()
[![license](https://img.shields.io/github/license/phanabani/phanas-pydantic-helpers)](LICENSE)

A collection of helper functions/classes for Pydantic.

## Table of Contents

- [Install](#install)
- [Usage](#usage)
- [Developers](#developers)
- [License](#license)

## Install

### Prerequisites

- [Poetry](https://python-poetry.org/docs/#installation) – dependency manager

### Install Phana's Pydantic Helpers

To get started, install the package with Poetry.

```shell
poetry add phanas-pydantic-helpers
```

## Usage

```python
from pydantic import BaseModel

from phanas_pydantic_helpers import update_forward_refs_recursive, Factory

@update_forward_refs_recursive
class MyModel(BaseModel):
  hi: str = "there"
  
  class _Friend(BaseModel):
    whats: str = "up?"
    
  friend: _Friend = Factory(_Friend)

model = MyModel()
assert model.friend.whats == "up?"
```

## Developers

### Installation

Follow the installation steps in [install](#install) and use Poetry to 
install the development dependencies:

```shell
poetry install
```

## License

[MIT © Phanabani.](LICENSE)

