Generate Pydantic Fields with typing.Annotated
Project description
pydantic-annotated
Proof of concept Decomposing Field components into Annotated.
from typing import Annotated
from pydantic_annotated import BaseModel, Description, FieldAnnotationModel
class PII(FieldAnnotationModel):
status: bool
class ComplexAnnotation(FieldAnnotationModel):
x: int
y: int
class Patient(BaseModel):
name: str
condition: Annotated[
str,
ComplexAnnotation(x=1, y=2),
Description("Patient condition"),
PII(status=True),
]
Project details
Release history Release notifications | RSS feed
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 pydantic-annotated-0.0.1a0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23822d59e30d9dd2ba6212367f387dbb610ddecb921e7976aeda17275355cc0b |
|
MD5 | 234a9254ae7bb822da96f931063a74dc |
|
BLAKE2b-256 | 7569a8150f7ec866ccb80918844495fb08283480c7e08bd7e117c7fc04a26678 |
Close
Hashes for pydantic_annotated-0.0.1a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3c14be64274433247b0b4725762633a39369180a4ff22d6099b036308ffd883 |
|
MD5 | 7bcda66694164e2b1ac0d5820ff42ef1 |
|
BLAKE2b-256 | 06bb4f09d5cce9df7c55fd56dd711917d213506c4f7b6d7b48963d944b350b72 |