Pyserde

Latest version: v0.22.2

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

Scan your dependencies

Page 9 of 12

0.9.2

* chore: Bump allowed version of numpy to >1.21.0 on Python 3.7 ([beb2a8b](https://github.com/yukinarit/pyserde/commit/beb2a8b))
* fix: Fix deserialization of optional complex types with default=None ([2b3b7ae](https://github.com/yukinarit/pyserde/commit/2b3b7ae))

This release had contributions from 1 person: [kmsquire](https://github.com/kmsquire). Thank you so much! :tada: :joy:

0.9.1

* fix: Call to untyped function "serde" in typed context ([84c5f07](https://github.com/yukinarit/pyserde/commit/84c5f07))

0.9.0

pyserde` v0.9 adds one of the most awaited features, the type checking functionality 🎉 If you add `Coerce` or `Strict` in `serde` decorator, `pyserde` will do type coercing or type checking based on the declared types.

`Coerce`

Type coercing automatically converts a value into the declared type during (de)serialization. If the value is incompatible e.g. value is "foo" and type is int, pyserde raises an `SerdeError`.

python
serde(type_check=Coerce)
dataclass
class Foo
s: str

foo = Foo(10)
pyserde automatically coerce the int value 10 into "10".
{"s": "10"} will be printed.
print(to_json(foo))


`Strict`

Strict type checking is to check every value against the declared type during (de)serialization. We plan to make `Strict` a default type checker in the future release.

python
serde(type_check=Strict)
dataclass
class Foo
s: str

foo = Foo(10)
pyserde checks the value 10 is instance of `str`.
SerdeError will be raised in this case because of the type mismatch.
print(to_json(foo))


* refactor: Change default type_check from Coerce to NoCheck ([23ea180](https://github.com/yukinarit/pyserde/commit/23ea180))
* refactor: Change to pass "type_check" parameter in decorator ([fbe8dc8](https://github.com/yukinarit/pyserde/commit/fbe8dc8))
* feat: Add type coercion feature make it default ([dabb777](https://github.com/yukinarit/pyserde/commit/dabb777))
* feat: Implement strict type checking ([0273b9a](https://github.com/yukinarit/pyserde/commit/0273b9a))

Another notable change is switching toml library from [toml](https://pypi.org/project/toml/) to [tomli](https://pypi.org/project/tomli/). tomli is used in a handful of major products e.g. `pip` and `pytest` and [will be the part of Python standard library in Python 3.11](https://peps.python.org/pep-0680/).

* feat: Switch toml library to tomli ([11b4df6](https://github.com/yukinarit/pyserde/commit/11b4df6))
* Better documentation about generic alias ([fd4e5a5](https://github.com/yukinarit/pyserde/commit/fd4e5a5))
* Ensure union_func_name produces a valid function name ([eddf250](https://github.com/yukinarit/pyserde/commit/eddf250))
* Import 'Literal' from serde.compat ([a7450c1](https://github.com/yukinarit/pyserde/commit/a7450c1))
* Support NumPy 1.23 in Python 3.7/3.8 ([3309a73](https://github.com/yukinarit/pyserde/commit/3309a73))
* Use str instead of repr in typename, fixing Union[Literal["str"], ...] ([b3905ef](https://github.com/yukinarit/pyserde/commit/b3905ef))
* fix: from_json return returns T not Optional[T] ([9e50fb7](https://github.com/yukinarit/pyserde/commit/9e50fb7))

This release had contributions from 1 person: [kngwyu](https://github.com/kngwyu). Thank you so much! :tada: :joy:

0.8.3

* fix: Use numpy<1.23.0 for python 3.7 and 3.8 ([3045521](https://github.com/yukinarit/pyserde/commit/3045521))

0.8.2

* chore: Replace stringcase with casfey ([1f8a17d](https://github.com/yukinarit/pyserde/commit/1f8a17d)), closes [#240](https://github.com/yukinarit/pyserde/issues/240)

This release had a contribution from 1 person: [gitpushdashf](https://github.com/gitpushdashf). Thank you so much! :tada: :joy:

0.8.1

* feat: Don't wrap user exception in SerdeError ([161cffd](https://github.com/yukinarit/pyserde/commit/161cffd))

Page 9 of 12

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.