Pyserde

Latest version: v0.22.2

Safety actively analyzes 685838 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 12

0.14.1

<!-- Release notes generated using configuration in .github/release.yml at main -->

What's Changed
New features
* skip conversion if the object is already the correct type by uyha in https://github.com/yukinarit/pyserde/pull/482
Documentation
* Fix syntax error in type-check.md by nicoddemus in https://github.com/yukinarit/pyserde/pull/479

New Contributors
* uyha made their first contribution in https://github.com/yukinarit/pyserde/pull/482

**Full Changelog**: https://github.com/yukinarit/pyserde/compare/v0.14.0...v0.14.1

0.14.0

<!-- Release notes generated using configuration in .github/release.yml at main -->

What's Changed
Breaking changes
* pyserde is powered by beartype by yukinarit in https://github.com/yukinarit/pyserde/pull/476

pyserde's strict type check system is overhauled by using [beartype](https://github.com/beartype/beartype) - O(1) runtime type checker. all pyserde classes now implicitly implement `beartype` decorator by default. Passing wrong type of values in constructor raises beartype's validation error.

python
serde
class Foo:
s: str


If you call `Foo` with wrong type of object, beartype validation error is raised.
python
>>> foo = Foo(10)
beartype.roar.BeartypeCallHintParamViolation: Method __main__.Foo.__init__()
parameter s=10 violates type hint <class 'str'>, as int 10 not instance of str.


If you deserialize with wrong value, serde error is raised.
python
>>> print(from_json(Foo, '{"s": 10}'))
serde.compat.SerdeError: Method __main__.Foo.__init__()
parameter s=10 violates type hint <class 'str'>, as int 10 not instance of str.


If you want to disable type check, set either `serde.disabled` or `serde.coerce` in `type_check` class attribute.
python
from serde import serde, disabled

serde(type_check=disabled)
class Foo:
s: str


See https://yukinarit.github.io/pyserde/guide/en/type-check.html for more information.

**Full Changelog**: https://github.com/yukinarit/pyserde/compare/v0.13.2...v0.14.0

0.13.2

<!-- Release notes generated using configuration in .github/release.yml at main -->

What's Changed
New features
* Allow bytes in from_json typing by davetapley in https://github.com/yukinarit/pyserde/pull/471
CI
* Update actions by yukinarit in https://github.com/yukinarit/pyserde/pull/473

New Contributors
* davetapley made their first contribution in https://github.com/yukinarit/pyserde/pull/471

**Full Changelog**: https://github.com/yukinarit/pyserde/compare/v0.13.1...v0.13.2

0.13.1

<!-- Release notes generated using configuration in .github/release.yml at main -->

What's Changed
Build
* Update pdoc to v14 by yukinarit in https://github.com/yukinarit/pyserde/pull/463
* Pin version of plum-dispatch as v2.3 breaks custom class serializer by yukinarit in https://github.com/yukinarit/pyserde/pull/470
Refactoring
* Fix more mypy type errors by yukinarit in https://github.com/yukinarit/pyserde/pull/465
Documentation
* Mention about pyserde-timedelta in README.md by yukinarit in https://github.com/yukinarit/pyserde/pull/461


**Full Changelog**: https://github.com/yukinarit/pyserde/compare/v0.13.0...v0.13.1

0.13.0

<!-- Release notes generated using configuration in .github/release.yml at main -->

What's Changed
New features

New custom class (de)serializer allows to extend pyserde to support third party types in a neat and robust way. Also custom global (de)serializer is a game changer to allow sharing and reusing custom serializers across different python projects. See [custom class serializer](https://github.com/yukinarit/pyserde/blob/main/docs/en/class-attributes.md#class_serializer--class_deserializer) and [custom global serializer](https://github.com/yukinarit/pyserde/blob/main/docs/en/extension.md#custom-global-deserializer) for more information.

e.g. Implementing serializer for `datetime` and `int`
python
class Serializer:
Custom serializer for "datetime"
overload
def serialize(self, value: datetime) -> str:
return value.strftime("%d/%m/%y")

Custom serializer for "int"
overload
def serialize(self, value: int) -> Any:
return str(value)

....

* Fix type error from field with attributes by yukinarit in https://github.com/yukinarit/pyserde/pull/458
* Implement new class (de)serializer by yukinarit in https://github.com/yukinarit/pyserde/pull/456
* Implement global (de)serializer by yukinarit in https://github.com/yukinarit/pyserde/pull/459
Build
* Drop python3.7 by yukinarit in https://github.com/yukinarit/pyserde/pull/460
Documentation
* Fix external union example in union.md by yukinarit in https://github.com/yukinarit/pyserde/pull/455


**Full Changelog**: https://github.com/yukinarit/pyserde/compare/v0.12.7...v0.13.0

0.12.7

<!-- Release notes generated using configuration in .github/release.yml at main -->

What's Changed
Refactoring
* Fix `skip_if` causing serialization of a recursive type to be `O(2**n)` instead of `O(n)` by gschaffner in https://github.com/yukinarit/pyserde/pull/452
Other changes
* :busts_in_silhouette: Add gschaffner as a contributor by yukinarit in https://github.com/yukinarit/pyserde/pull/454

New Contributors
* gschaffner made their first contribution in https://github.com/yukinarit/pyserde/pull/452

**Full Changelog**: https://github.com/yukinarit/pyserde/compare/v0.12.6...v0.12.7

Page 4 of 12

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.