
Change: You can no longer announce a class with a custom name.Change: Exceptions are more clear upon deserialization failure (thanks to haluzpav).Feature: Added a serializer for Union types.Bugfix: Dumping a tuple with ellipsis failed in strict mode.Feature: Added _version_ which can be imported from jsons.Bugfix: Utilized _annotations_ in favor _field_types because of deprecation as of 3.8.Bugfix: Loading a namedtuple did not properly use key_transformers.

Bugfix: Loading a dict did not properly pass key_transformers.Bugfix: Loading an invalid value targeting an optional did not raise.Bugfix: Fixed bug with postponed typehints (PEP-563).Bugfix: Fixed bug when dumping an object with an innerclass.Change: When loading a list fails, the error message now points to the failing index.Feature: Added serializer and deserializer for pathlib.Path (thanks to alexmirrington).Feature: Added transform that can transform an object to an object of another type.Feature: Added warn_on_fail parameter to default_list_deserializer that allows to continue deserialization upon errors.Bugfix: Fixed bug where classmethods were included in the serialized result.Bugfix: Types of attributes that are not in the constructor are now looked for in annotations.Bugfix: Fixed a bug with postponed annotations and dataclasses.Bugfix: Unwanted stringification of NoneValues is now prevented in Optionals and Unions with NoneType.Bugfix: Loading a verbose-serialized object in a list could sometimes deserialize that object as a parent class.Feature: Dicts with any (hashable) key can now be dumped and loaded.Feature: DefaultDicts can now be deserialized.Bugfix: Types of attributes that are not in the constructor were not properly looked for.Bugfix: get_origin did not work with python3.9+ parameterized collections (e.g.Change: microseconds are no longer stripped by default (thanks to pietrodn).Feature: Support for ZoneInfo on Python3.9+.Bugfix: ZoneInfo failed to dump if attached to a datetime.Bugfix: Named tuples did not use typing.get_type_hints for getting the types, causing trouble in future annotations (thanks to georgeharker).Bugfix: IntEnums were not serialized with their names when use_enum_name=True (thanks to georgeharker).Bugfix: Loading dicts with hashed keys could cause an error due to being loaded twice (thanks to georgeharker).


dump ( p ) > out Įxample of using jsons to deserialize: > p2 = jsons. > p = Person ( 'Guido van Rossum', birthday_guido )Įxample of using jsons to serialize: > out = jsons. П’- this lib? Leave a ★ and tell your colleagues!Įxample of a model to serialize: >. Works with dataclasses, attrs and POPOs.Turn Python objects into dicts or (json)strings and back.
