Skip to main content

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

pydantic_custom_types-0.2.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

pydantic_custom_types-0.2.2-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file pydantic_custom_types-0.2.2.tar.gz.

File metadata

  • Download URL: pydantic_custom_types-0.2.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for pydantic_custom_types-0.2.2.tar.gz
Algorithm Hash digest
SHA256 d373e47a0e7233f5e77d7d73e709eb827a05aa45da92e2e7dcc2eb8d5a1db2f6
MD5 de2fccd49fab358733cd904419bb3373
BLAKE2b-256 c7714e2e30c59635f315952d49e7f9bb8e29aff67d7e41d3dc053a678288bf77

See more details on using hashes here.

File details

Details for the file pydantic_custom_types-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pydantic_custom_types-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ca0bada01dd380c1baa8727a62c44cb813807809bd30d9ed8451a888166d152b
MD5 890f6ef2508541a8d3934ad7c4fd23cf
BLAKE2b-256 ee81959d17a984dc59d8d77ba81b69db3f2e4a33c622e01d2b3d4b14525274a1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page