Custom types for pydantic used in SRE peipelins for validation input vars
Project description
pydantic custom types
A collection of custom types for pydantic
https://github.com/pydantic/pydantic
Useful for validation input parameters for infrastructure pipelines when building kubernetes apps/clusters
Requirements
python >= 3.10
Installation
pip install pydantic-custom-types
Examples
from pydantic import BaseModel
from pydantic_custom_types.kubernetes import NamespaceName, SecretName
class K8sNamespace(BaseModel):
# These string types only allow: lowercase/numbers/dash, cannot start with dash/number
# NamepaceName has linit at 63 characters
# SecretName has linit at 63 characters
name: NamespaceName
secret_name: SecretName
# will pass
K8sNamespace(
name="my-namespace",
secret_name="my-secret"
)
# will not pass
K8sNamespace(
name="-0mynameSpace",
secret_name="0mysecret"
)
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 pydantic_custom_types-0.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7b88f66bd53bbc4172d9dc6b0fcb9ef70a73e1438dd19bf4f489b15e896184b |
|
MD5 | 5d42238e5f4b3db3d831340cc1d26bc1 |
|
BLAKE2b-256 | a5c790e306b1fa947b3bd058dab1ecbc25f582c1acfbd76a0ff89682e51b6e26 |
Close
Hashes for pydantic_custom_types-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce0c255d05ab680c0a60c8239d9e61b721dd3528dbc2363e192ddaca460e6cf0 |
|
MD5 | d24ad2372bb72df180af48392b91cec7 |
|
BLAKE2b-256 | 4e190b2f25b990cd5a44fe5a006df9ca6970f9754bc8a659090c7f0137b4647d |