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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 899439cdf6c04dd15f12b7672d8831a6044d41f620d8409a3a6ceafed2f14723 |
|
MD5 | b8e3fe4c2e31738450df6b4a2b7c09b9 |
|
BLAKE2b-256 | 72ef9770940dd4df7c1916ccad9b4f23ce2f857ef5474acf0534ee8705165906 |
Close
Hashes for pydantic_custom_types-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c960fc6ab4fc7eafaf9ef49ef25eef6df8e7e32b6a22fe65e090ec5ed8fbc4c |
|
MD5 | 4b5d59193ce26105128dba89a63178dc |
|
BLAKE2b-256 | 509dffd541500d9ea69120f50ed76f49e8462a77361352291a39baeb37691fcb |