GitPedia
ramonhagenaars

ramonhagenaars/jsons

🐍 A Python lib for (de)serializing Python objects to/from JSON

15 Releases
Latest: 4y ago
v1.6.3Latest
ramonhagenaarsramonhagenaars·4y ago·June 9, 2022
GitHub

📋 Changes

  • Bugfix: a string was sometimes unintentionally parsed into a datetime.
v1.6.2
ramonhagenaarsramonhagenaars·4y ago·May 11, 2022
GitHub

📋 Changes

  • Bugfix: `fork_inst`s were not propagated in `default_list_deserializer` (thanks to patrickguenther).
v1.6.1
ramonhagenaarsramonhagenaars·4y ago·January 9, 2022
GitHub

📋 Changes

  • Bugfix: Loading dicts with hashed keys could cause an error due to being loaded twice (thanks to georgeharker).
  • Bugfix: IntEnums were not serialized with their names when `use_enum_name=True` (thanks to georgeharker).
  • Bugfix: Named tuples did not use `typing.get_type_hints` for getting the types, causing trouble in future annotations (thanks to georgeharker).
v1.6.0
ramonhagenaarsramonhagenaars·4y ago·October 31, 2021
GitHub

📋 Changes

  • Feature: Support for Python3.10.
  • Feature: Support for attrs.
v1.5.1
ramonhagenaarsramonhagenaars·4y ago·September 1, 2021
GitHub

📋 Changes

  • Bugfix: `ZoneInfo` failed to dump if attached to a `datetime`.
v1.5.0
ramonhagenaarsramonhagenaars·4y ago·July 18, 2021
GitHub

📋 Changes

  • Feature: Support for `ZoneInfo` on Python3.9+.
  • Change: microseconds are no longer stripped by default (thanks to pietrodn).
v1.4.2
ramonhagenaarsramonhagenaars·5y ago·April 10, 2021
GitHub

📋 Changes

  • Bugfix: get_origin did not work with python3.9+ parameterized collections (e.g. `dict[str, str]`).
v1.4.1
ramonhagenaarsramonhagenaars·5y ago·March 31, 2021
GitHub

📋 Changes

  • Bugfix: Types of attributes that are not in the constructor were not properly looked for. See issue #128.
v1.4.0
ramonhagenaarsramonhagenaars·5y ago·February 6, 2021
GitHub

📋 Changes

  • Feature: DefaultDicts can now be deserialized.
  • Feature: Dicts with any (hashable) key can now be dumped and loaded.
  • Feature: Suppress specific warnings.
  • Bugfix: Loading a verbose-serialized object in a list could sometimes deserialize that object as a parent class.
  • Bugfix: Unwanted stringification of NoneValues is now prevented in Optionals and Unions with NoneType.
  • Bugfix: Fixed a bug with postponed annotations and dataclasses. See also [Issue34776](https://bugs.python.org/issue34776).
  • Bugfix: Types of attributes that are not in the constructor are now looked for in __annotations__.
v1.3.1
ramonhagenaarsramonhagenaars·5y ago·January 4, 2021
GitHub

📋 Changes

  • Bugfix: Fixed bug where classmethods were included in the serialized result.
v1.3.0
ramonhagenaarsramonhagenaars·5y ago·October 9, 2020
GitHub

📋 Changes

  • Feature: Added `warn_on_fail` parameter to `default_list_deserializer` that allows to continue deserialization upon errors.
  • Feature: Added `transform` that can transform an object to an object of another type.
  • Feature: Added serializer and deserializer for `pathlib.Path` (thanks to alexmirrington).
  • Change: When loading a list fails, the error message now points to the failing index.
  • Bugfix: Fixed bug when dumping an object with an innerclass.
v1.2.0
ramonhagenaarsramonhagenaars·5y ago·July 3, 2020
GitHub

📋 Changes

  • Bugfix: Fixed bug with postponed typehints (PEP-563).
  • Bugfix: Loading an invalid value targeting an optional did not raise.
  • Bugfix: Loading a dict did not properly pass key_transformers.
  • Bugfix: Loading a namedtuple did not properly use key_transformers.
  • Bugfix: Utilized `__annotations__` in favor `_field_types` because of deprecation as of 3.8.
v1.1.1
ramonhagenaarsramonhagenaars·6y ago·December 22, 2019
GitHub

📋 Changes

  • Feature: Added a serializer for ``Union`` types.
  • Change: Exceptions are more clear upon deserialization failure (thanks to haluzpav).
  • Change: You can no longer announce a class with a custom name.
  • Bugfix: Fixed dumping optional attributes.
  • Bugfix: Dataclasses inheriting from ``JsonSerializable`` always dumped their attributes as if in strict mode.
v1.1.0
ramonhagenaarsramonhagenaars·6y ago·December 4, 2019
GitHub

📋 Changes

  • Feature: Added ``strict`` parameter to ``dump`` to indicate that dumping a certain ``cls`` will ignore any extra data.
  • Feature: When using ``dump(obj, cls=x)``, ``x`` can now be any class (previously, only a class with ``__slots__``).
  • Feature: Support for dumping ``Decimal`` (thanks to herdigiorgi).
  • Feature: Primitives are now cast if possible when dumping (e.g. ``dump(5, str)``).
  • Feature: Dumping iterables with generic types (e.g. ``dump(obj, List[str])``) will now dump with respect to that types (if ``strict``)
  • Feature: The ``default_dict`` serializer now optionally accepts types: ``Optional[Dict[str, type]]``.
  • Change: Improved performance when dumping using ``strict=True`` (up to 4 times faster!).
  • Bugfix: ``set_validator`` with multiple types did not work.
v1.0.0
ramonhagenaarsramonhagenaars·6y ago·October 7, 2019
GitHub

📋 Changes

  • Feature: Added a serializer/deserializer for ``time``.
  • Feature: Added a serializer/deserializer for ``timezone``.
  • Feature: Added a serializer/deserializer for ``timedelta``.
  • Feature: Added a serializer/deserializer for ``date``.
  • Bugfix: Dumping verbose did not store the types of dicts (``Dict[K, V]``).
  • Bugfix: Loading with ``List`` (no generic type) failed.
  • Bugfix: Loading with ``Dict`` (no generic type) failed.
  • Bugfix: Loading with ``Tuple`` (no generic type) failed.