Skip to content

Commit

Permalink
version
Browse files Browse the repository at this point in the history
  • Loading branch information
keithasaurus committed Feb 29, 2024
1 parent b801b2c commit d69eb4f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
4.1.0 (Feb 29, 2024)
**Features**
- `ValidationResult.map()` can be used to succinctly convert data contained within `Valid` objects to some other type or value

4.0.0 (Sep 27, 2023)
**Breaking Changes**
- `to_serializable_errs` produces different text, removing assumption that validation input was deserialized from json
Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Koda Validate can be used in normal control flow or as a runtime type checker.

Docs: [https://koda-validate.readthedocs.io/en/stable/](https://koda-validate.readthedocs.io/en/stable/)

### At a Glance

```python

from typing import TypedDict
Expand All @@ -19,6 +21,12 @@ from koda_validate.serialization import to_serializable_errs
from koda_validate.signature import validate_signature


# Explicit Validators
string_validator = StringValidator(MinLength(8), MaxLength(20))

list_string_validator = ListValidator(string_validator)


# Automatic Validators
class Person(TypedDict):
name: str
Expand All @@ -37,12 +45,6 @@ match person_validator({"name": "Guido"}):
# prints: {'hobbies': ['key missing']}


# Explicit Validators
string_validator = StringValidator(MinLength(8), MaxLength(20))

list_string_validator = ListValidator(string_validator)


# Runtime type checking
@validate_signature
def add(a: int, b: int) -> int:
Expand All @@ -63,5 +65,5 @@ add(1, "2") # raises `InvalidArgsError`
There's much, much more... Check out the [Docs](https://koda-validate.readthedocs.io/en/stable/).


## Something's Missing Or Wrong
## Something's Missing or Wrong
Open an [issue on GitHub](https://github.com/keithasaurus/koda-validate/issues) please!
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
project = "Koda Validate"
copyright = "2023, Keith Philpott"
author = "Keith Philpott"
release = "4.0.0"
release = "4.1.0"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Koda Validate
Koda Validate is a library and toolkit for building composable and typesafe validators. In many cases, validators can be
derived from typehints :ref:`automatically<index:Derived Validators>` (e.g. ``TypeDict``s, ``@dataclass``es, ``NamedTuples``).
For everything else, you can compose validator callables or :ref:`write your own<how_to/extension:Extension>`. At its heart, Koda Validate
is just a few kinds of functions that fit together, so the possibilities of what it can validate are endless. It is async-friendly, and comparable
in performance to Pydantic 2.
is just a few kinds of functions that fit together, so the possibilities are as endless as the kinds of functions
you can write. It is async-friendly and comparable in performance to Pydantic 2.

Koda Validate can be used in normal control flow or as a :ref:`runtime type checker<how_to/runtime_type_checking:Runtime Type Checking>`.

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "koda-validate"
version = "4.0.0"
version = "4.1.0"
readme = "README.md"
description = "Typesafe, composable validation"
documentation = "https://koda-validate.readthedocs.io/en/stable/"
Expand Down

0 comments on commit d69eb4f

Please sign in to comment.