Serdelicacy

Latest version: v0.18.1

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

Scan your dependencies

Page 1 of 4

0.18.1

Fixed

- Add link to docs in readme

0.18.0

Added

- In-depth documentation. Lots of docstring updates!
- `serdelicacy.SerdeError` as part of the public API (mostly for documentation)

0.17.0

Added

- Explicit support for `enum.Enum` and its subtypes. I personally prefer `typing.Literal`, but `enum.Enum` might be preferred by others.

0.16.0

Note: breaking changes regarding validation and transformation.

Added

- Provide `Override` type, which provides metadata user-defined overrides for dataclass serde for the namespace-constrained `serdelicacy` key. Prevents namespace pollution and provides more type safety.

Removed

- Keys `transform_load`, `transform_postload`, and `validate` are no longer expected. Instead, use the key `serdelicacy` and pass it a `serdelicacy.Override` object.

0.15.0

Added

- Support for additional `dataclasses.field` `metadata` keys: `transform_load`, `transform_postload`, and `transform_dump`. These enable the user to specify functions to modify the specific value that is deserialized (loaded) and serialized (dumped).

Fixed

- Inconsistent documentation the referred to `UNDEFINED` has been corrected to refer to `MISSING`.

Removed

- Removed automatic conversion for primitive types. This special case created a lot of code complexity and is arguably unnecessary now that we provide support for validations and transformations with `dataclasses`.

0.14.0

Added

- Major validation improvement! Support for dataclass attribute validation using the `metadata` parameter to `dataclasses.field`, like `dataclasses.field(metadata={"validate": str.istitle})`. The function passed as the mapping value should either return `True` on positive validation / `False` on non-validation, or return nothing at all and instead rely on the raising of exceptions to indicate whether validation passed for failed.

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.