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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13935a244d15c84e4b89d0951793c2dc38d812ba6122d0d4b6ea72d3ae3e2360 |
|
MD5 | 66cb6edf7d66979096d133e6d2734833 |
|
BLAKE2b-256 | aa2d7c0ba976f5d3ef6597840f555d28cc44dc36479967bd8c2f8b244da7dfae |
Close
Hashes for pydantic_custom_types-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8de14393a2a25375d89c1abd147c296f766cc2fb6b2e6794f426df2488c5d24 |
|
MD5 | 8615e4de791579e6198203a73479b28e |
|
BLAKE2b-256 | 9aae9d2c3fed8afa0c7aca4569706aa20ce8edc7124a51a4997fc29c75f11c76 |