Typesafe, composable validation
Project description
Koda Validate
Build typesafe validators automatically or explicitly -- or write your own. Combine them to build validators of arbitrary complexity. Koda Validate is async-friendly, pure Python, and 1.5x - 12x faster than Pydantic.
Docs: https://koda-validate.readthedocs.io/en/stable/
from typing import TypedDict
from koda_validate import (StringValidator, MaxLength, MinLength,
ListValidator, TypedDictValidator)
from koda_validate.signature import validate_signature
# Explicit Validators
string_validator = StringValidator(MinLength(8), MaxLength(20))
list_string_validator = ListValidator(string_validator)
# Derived Validators
class Person(TypedDict):
name: str
hobbies: list[str]
person_validator = TypedDictValidator(Person)
# Runtime type checking
@validate_signature
def add(a: int, b: int) -> int:
return a + b
There's much, much more... Check out the Docs.
Something's Missing Or Wrong
Open an issue on GitHub please!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
koda_validate-3.1.2.tar.gz
(41.0 kB
view hashes)
Built Distribution
Close
Hashes for koda_validate-3.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bcee48a7f41e73fe4e29eaebef8d5c40e392be5bbe998abb020f3d79bfaf930 |
|
MD5 | ae22d840047979e8e1903adae115ca48 |
|
BLAKE2b-256 | 1c83fb027bfdbff7cefa7bd95e67c9d26cd252aabc72506d7c2b38fc6ef10030 |