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.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b68a3a7806397446f10ca513609007f708bc26c1906d7b69cf09fd519291a8e7 |
|
MD5 | feffc479fe04940b76264153d79257a6 |
|
BLAKE2b-256 | ccd8ac7bd99d06719228d8d15b8d5bcc3f091473cfc5676e8fa6b4ef897b9aba |
Close
Hashes for pydantic_custom_types-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60a12771f7fcf1baf7aeaaf5f25e24967fd9c1dcb985128decae66ce142713b5 |
|
MD5 | 960d205700020f1eb6cbeb128a670e5e |
|
BLAKE2b-256 | 7f2c58188412ce5f40ae98db64245d52a5420993da5b79e92e20fe027166781a |