No project description provided
Project description
Pydantic-Choices
How to use
from pydantic_choices import choice
import pydantic as pd
Licenses = choice(["GPL", "GPLv3+", "MIT", "MPL 2.0"])
class Project(pd.BaseModel):
id: str
url: str
license: Licenses
# Validation passes
Project(
id="pydantic_choices",
url="https://github.com/vinissimus/pydantic-choices",
license="MIT",
)
# Validation fails
p1 = Project(
id="pydantic_choices",
url="https://github.com/vinissimus/pydantic-choices",
license="propietary", # value not in choice
)
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
pydantic-choices-0.1.1.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for pydantic_choices-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 956c3e61073aabdd908e9aa4b7310445928f7d5ccde7c20823fc8e36cc697b56 |
|
MD5 | 565c0a41b6c2efee05b56eb1d400ca17 |
|
BLAKE2b-256 | 18d57012a12bb4c3f1248308f9838b70487d21160c882535810c844a342c0c4d |