A collection of helper functions/classes for Pydantic.
Project description
Phana's Pydantic Helpers
A collection of helper functions/classes for Pydantic.
Table of Contents
Install
Prerequisites
- Poetry – dependency manager
Install Phana's Pydantic Helpers
To get started, install the package with Poetry.
poetry add phanas-pydantic-helpers
Usage
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 and use Poetry to install the development dependencies:
poetry install
License
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
Built Distribution
Close
Hashes for phanas_pydantic_helpers-2.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cd3ea92279647763dc68f08247ea816a85e834cf5d0bc5a2dcfe7c8ae27d35e |
|
MD5 | adcfa12d9fedffe7103b295e7c709aaf |
|
BLAKE2b-256 | c551d79abcf2808ac9203dd6703f38b8a4a4d2dbdc7f82de87fd3cdd31be9794 |
Close
Hashes for phanas_pydantic_helpers-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 234c0c5810ab51bebff262911ffea654f29bfae0ec3574185839226db68e3d82 |
|
MD5 | 4430c59d18283dfd921381f504e34653 |
|
BLAKE2b-256 | 2e995e68118d49dacbca3056db408c52d65c2882150191a8324f910961c48228 |