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.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5f4c4d8dc3398764f62e61992df68ab62f5e806b63bf5c0587a193885f98c69 |
|
MD5 | c2e1669c0cf844f7baafaeabf996e7eb |
|
BLAKE2b-256 | 20b7d803e8eedd183c507928ffbbe9c66a5a2198876e1f13f4f7cdaebc582cef |
Close
Hashes for pydantic_custom_types-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 791915ecc8b494afd452f1c5acf862ec72940beb16f98c3bc5b10aa1461f9d6d |
|
MD5 | ea86c3a8650a2ac5850b70cd5a8496cb |
|
BLAKE2b-256 | 60d876b48402e01d5dcb8d9b72107b1e9ff84c343839d780ba84d59973f214a4 |