Pyserde Versions Save

Yet another serialization library on top of dataclasses, inspired by serde-rs.

v0.13.0

5 months ago

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 and custom global serializer for more information.

e.g. Implementing serializer for datetime and int

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)

   ....

Build

Documentation

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

v0.12.7

6 months ago

What's Changed

Refactoring

Other changes

New Contributors

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

v0.12.6

6 months ago

What's Changed

Bug fixes

Other changes

New Contributors

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

v0.12.5

7 months ago

What's Changed

Bug fixes

Full Changelog: https://github.com/yukinarit/pyserde/compare/v0.12.4...v0.12.5

v0.12.4

7 months ago

What's Changed

Bug fixes

Other changes

New Contributors

Full Changelog: https://github.com/yukinarit/pyserde/compare/v0.12.3...v0.12.4

v0.12.3

8 months ago

What's Changed

Bug fixes

Refactoring

Test

Full Changelog: https://github.com/yukinarit/pyserde/compare/v0.12.2...v0.12.3

v0.12.2

10 months ago

What's Changed

New features

Bug fixes

CI

Build

Documentation

Other changes

New Contributors

Full Changelog: https://github.com/yukinarit/pyserde/compare/v0.12.1...v0.12.2

v0.12.1

11 months ago

What's Changed

Bug fixes

Refactoring

Documentation

Full Changelog: https://github.com/yukinarit/pyserde/compare/v0.12.0...v0.12.1

v0.12.0

11 months ago

What's Changed

New features

This example works correctly now

@serde
@dataclass
class Foo:
    a: int

@serde
@dataclass
class Bar:
    a: int

bar = Bar(10)
s = to_json(bar)
print(s)
print(from_json(Union[Foo, Bar], s))

However, This will introduce a breaking change!! The default behaviour when you pass Union directly was "Untagged" until v0.11.1, but since v0.12.0 it is "ExternalTagging".

The following code prints {"a": 10} until v0.11.1, but prints {"Bar": {"a": 10}} since v0.12.0

print(to_json(bar))

For more information about Union, please see the docs

Refactoring

Other changes

Full Changelog: https://github.com/yukinarit/pyserde/compare/v0.11.1...v0.12.0

v0.11.1

11 months ago

What's Changed

New features

Bug fixes

Refactoring

Other changes

New Contributors

Full Changelog: https://github.com/yukinarit/pyserde/compare/v0.11.0...v0.11.1