Releases: keithasaurus/koda-validate
Releases · keithasaurus/koda-validate
4.2.0
What's Changed
- fix ExactItemCount type by @keithasaurus in #45
- update dev dependencies
Full Changelog: 4.1.1...4.2.0
4.1.1
What's Changed
- dev updates by @keithasaurus in #41
- Use
pattern.match(...)
instead ofre.match(pattern, ...)
inRegexPredicate
andEmailPredicate
by @keithasaurus in #42
Full Changelog: 4.1.0...4.1.1
4.1.0
4.0.0
Breaking Changes
to_serializable_errs produces different text, removing assumption that validation input was deserialized from json
Improvements
Allow to_serializable_errs to accept callable for next level
Maintenance
Update dev dependencies
3.1.2
What's Changed
- Minor documentation typos/broken links by @kapman28 in #26
- fix typos/wording by @keithasaurus in #27
- validate_signature respects mutated arguments by @keithasaurus in #31
- fix typo by @keithasaurus in #32
Full Changelog: 3.1.1...3.1.2
3.1.1
Bug Fixes
UnionValidator.typed
's@overloads
specify that arguments should be positional-only
Docs
- extend docs for
UnionValidator
andNTupleValidator
Full Changelog: 3.1.0...3.1.1
3.1.0
3.1.0 (Jan. 26, 2023)
Features
- Runtime type checking via
koda_validate.signature.validate_signature
- Coercion customizable via
Coercer
(and helper decoratorcoercer
)
Maintenance
- Minor bug fixes in examples/
Full Changelog: 3.0.0...3.1.0
3.0.0
Headlines
- Valid / Invalid has been revised an decoupled from serialization
- Automatic typehint-derived validators
- New docs site
- Lots of New Validators
- Performance ticks up
3.0.0 (Jan. 5, 2023)
Features
- Derived Validators:
TypedDictValidator
,DataclassValidator
,NamedTupleValidator
UnionValidator
replacesOneOf2
,OneOf3
NTupleValidator
replacesTuple2Validator
,Tuple2Validator
UniformTupleValidator
SetValidator
BytesValidator
- New
Valid
/Invalid
types MaybeValidator
CacheValidatorBase
- Errors decoupled from Serialization
- Fewer Generic Arguments needed for
Validator
s,Predicate
s andPrediateAsync
s koda_validate.serialization.to_json_schema
Removals
OneOf2
OneOf3
Tuple2Validator
Tuple3Validator
Breaking Changes
UnionValidator
replacesOneOf2
,OneOf3
NTupleValidator
replacesTuple2Validator
,Tuple2Validator
- New
Valid
/Invalid
types -- needkoda_validate.to_serializable_errs
to produce serializable errors
Performance
- Various optimizations in dictionary
Validator
s - Optimizations in scalar validators (StringValidator, IntValidator, etc.) for common use cases
- Overall speedups of around 30% for common validation cases
- More benchmarks
Maintenance
- New Docs Site
- Restructure project layout
- _internal.py
- move serialization to koda_validate.serialization
- More benchmarks
2.1.0
2.1.0 (Nov. 9, 2022)
Features
UUIDValidator
Bug Fixes
RecordValidator
allows up-to-16 keys as intended
Performance
- Small optimizations for
RecordValidator
,DictValidatorAny
,ListValidator
andDecimalValidator
2.0.0
Asyncio Validation / Faster synchronous validation / More Flexible Dictionary Validation
All built-in validators now fully compatible with asyncio
. See the docs for more.
Significantly faster than v1.0 -- and 1.5x - 12x faster than Pydantic in (synchronous) benchmarks
RecordValidator
and DictValidatorAny
can now handle any kind of dict key, and whether it's required or not.
Features
asyncio
is supported with.validate_async
methodPredicateAsync
is addedRecordValidator
(andDictValidatorAny
) can now handle any kind of dict key.AlwaysValid
is addedPredicate
s andProcessor
s are allowed more extensively across built-in validators.
Performance
- speed has improved as much as 60x (Koda Validate is now significantly faster than Pydantic)
Breaking Changes
Ok
/Err
/Result
(fromkoda
) ->Valid
/Invalid
/Result
(fromkoda_validate
)dict_validator
->RecordValidator
DictNKeysValidator
s are removed. Instead,RecordValidator
is used.RecordValidator
requires all arguments as keyword-onlyRecordValidator
accepts up-to 16 keyskey
helper is removedmaybe_key
helper is replaced byKeyNotRequired
MapValidator
requires all arguments as keyword-onlyListValidator
requiresPredicate
s to be specified as a keyword argument- the order and number of some
__match_args__
has changed - most validators are no longer dataclasses;
__repr__
s may differ validate_and_map
is deprecated and removed fromkoda_validate
imports.- file structure has changed
- typedefs.py -> base.py
- utils.py -> _internals.py
Maintenance
bench
folder is added for benchmarkspython3.11
added to CIpypy3.9
added to CI- min coverage bumped to 95%
- lots of tests added