# 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)
Raw data
{
"_id": null,
"home_page": "https://github.com/Phanabani/phanas-pydantic-helpers",
"name": "phanas-pydantic-helpers",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "pydantic,helper,helpers",
"author": "Phanabani",
"author_email": "phanabani@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/c5/51/d79abcf2808ac9203dd6703f38b8a4a4d2dbdc7f82de87fd3cdd31be9794/phanas_pydantic_helpers-2.0.0.tar.gz",
"platform": null,
"description": "# Phana's Pydantic Helpers\n\n[![pypi](https://img.shields.io/pypi/v/phanas-pydantic-helpers)]()\n[![pypi-python](https://img.shields.io/pypi/pyversions/phanas-pydantic-helpers)]()\n[![license](https://img.shields.io/github/license/phanabani/phanas-pydantic-helpers)](LICENSE)\n\nA collection of helper functions/classes for Pydantic.\n\n## Table of Contents\n\n- [Install](#install)\n- [Usage](#usage)\n- [Developers](#developers)\n- [License](#license)\n\n## Install\n\n### Prerequisites\n\n- [Poetry](https://python-poetry.org/docs/#installation) \u2013 dependency manager\n\n### Install Phana's Pydantic Helpers\n\nTo get started, install the package with Poetry.\n\n```shell\npoetry add phanas-pydantic-helpers\n```\n\n## Usage\n\n```python\nfrom pydantic import BaseModel\n\nfrom phanas_pydantic_helpers import update_forward_refs_recursive, Factory\n\n@update_forward_refs_recursive\nclass MyModel(BaseModel):\n hi: str = \"there\"\n \n class _Friend(BaseModel):\n whats: str = \"up?\"\n \n friend: _Friend = Factory(_Friend)\n\nmodel = MyModel()\nassert model.friend.whats == \"up?\"\n```\n\n## Developers\n\n### Installation\n\nFollow the installation steps in [install](#install) and use Poetry to \ninstall the development dependencies:\n\n```shell\npoetry install\n```\n\n## License\n\n[MIT \u00a9 Phanabani.](LICENSE)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A collection of helper functions/classes for Pydantic.",
"version": "2.0.0",
"split_keywords": [
"pydantic",
"helper",
"helpers"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2e995e68118d49dacbca3056db408c52d65c2882150191a8324f910961c48228",
"md5": "4430c59d18283dfd921381f504e34653",
"sha256": "234c0c5810ab51bebff262911ffea654f29bfae0ec3574185839226db68e3d82"
},
"downloads": -1,
"filename": "phanas_pydantic_helpers-2.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4430c59d18283dfd921381f504e34653",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 8528,
"upload_time": "2023-02-08T03:47:19",
"upload_time_iso_8601": "2023-02-08T03:47:19.883340Z",
"url": "https://files.pythonhosted.org/packages/2e/99/5e68118d49dacbca3056db408c52d65c2882150191a8324f910961c48228/phanas_pydantic_helpers-2.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c551d79abcf2808ac9203dd6703f38b8a4a4d2dbdc7f82de87fd3cdd31be9794",
"md5": "adcfa12d9fedffe7103b295e7c709aaf",
"sha256": "9cd3ea92279647763dc68f08247ea816a85e834cf5d0bc5a2dcfe7c8ae27d35e"
},
"downloads": -1,
"filename": "phanas_pydantic_helpers-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "adcfa12d9fedffe7103b295e7c709aaf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 6753,
"upload_time": "2023-02-08T03:47:21",
"upload_time_iso_8601": "2023-02-08T03:47:21.485225Z",
"url": "https://files.pythonhosted.org/packages/c5/51/d79abcf2808ac9203dd6703f38b8a4a4d2dbdc7f82de87fd3cdd31be9794/phanas_pydantic_helpers-2.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-08 03:47:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "Phanabani",
"github_project": "phanas-pydantic-helpers",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "phanas-pydantic-helpers"
}