All Versions
Latest Version
Avg Release Cycle
83 days
Latest Release
149 days ago

Changelog History
Page 1

  • v1.7.1 Changes

    May 28, 2021
    • ๐Ÿ‘ Literal s are not supported on Python 3.9.0 (supported on 3.9.1 and later), so we skip importing them there. (#150 <>_)
  • v1.7.0 Changes

    May 26, 2021
    • cattr.global_converter (which provides cattr.unstructure, cattr.structure etc.) is now an instance of cattr.GenConverter.
    • ๐Ÿ‘ Literal s are now supported and validated when structuring.
    • ๐Ÿ›  Fix dependency metadata information for attrs. (#147 <>_)
    • ๐Ÿ›  Fix GenConverter mapping structuring for unannotated dicts. (#148 <>_)
  • v1.6.0 Changes

    April 28, 2021
    • cattrs now uses Poetry.
    • GenConverter mapping structuring is now ~25% faster, and unstructuring heterogenous tuples is significantly faster.
    • โž• Add cattr.preconf. This package contains modules for making converters for particular serialization libraries. We currently support the standard library json, and third-party ujson, orjson, msgpack, bson, pyyaml and tomlkit libraries.
  • v1.5.0 Changes

    April 15, 2021
    • ๐Ÿ›  Fix an issue with GenConverter unstructuring attrs classes and dataclasses with generic fields. (#65 <>_)
    • GenConverter has support for easy overriding of collection unstructuring types (for example, unstructure all sets to lists) through its unstruct_collection_overrides argument. (#137 <>_)
    • Unstructuring mappings with GenConverter is significantly faster.
    • GenConverter supports strict handling of unexpected dictionary keys through its forbid_extra_keys argument. (#142 <>_)
  • v1.4.0 Changes

    March 21, 2021
    • ๐Ÿ›  Fix an issue with GenConverter un/structuring hooks when a function hook is registered after the converter has already been used.
    • โž• Add support for{Sequence, MutableSequence, Set, MutableSet}. These should be used on 3.9+ instead of their typing alternatives, which are deprecated. (#128 <>_)
    • The GenConverter will unstructure iterables (list[T], tuple[T, ...], set[T]) using their type argument instead of the runtime class if its elements, if possible. These unstructuring operations are up to 40% faster. (#129 <>_)
    • Flesh out Converter and GenConverter initializer type annotations. (#131 <>_)
    • โž• Add support for typing.Annotated on Python 3.9+. cattrs will use the first annotation present. cattrs specific annotations may be added in the future. (#127 <>_)
    • โž• Add support for dataclasses. (#43 <>_)
  • v1.3.0 Changes

    February 25, 2021
    • โœ… cattrs now has a benchmark suite to help make and keep cattrs the fastest it can be. The instructions on using it can be found under the Benchmarking <> section in the docs. (#123 <>_)
    • ๐Ÿ›  Fix an issue unstructuring tuples of non-primitives. (#125 <>_)
    • cattrs now calls attr.resolve_types on attrs classes when registering un/structuring hooks.
    • GenConverter structuring and unstructuring of attrs classes is significantly faster.
  • v1.2.0 Changes

    January 31, 2021
    • ๐Ÿ‘ converter.unstructure now supports an optional parameter, unstructure_as, which can be used to unstructure something as a different type. Useful for unions.
    • ๐Ÿ‘Œ Improve support for union un/structuring hooks. Flesh out docs for advanced union handling. (#115 <>_)
    • ๐Ÿ›  Fix GenConverter behavior with inheritance hierarchies of attrs classes. (#117 <>) (#116 <>)
    • Refactor GenConverter.un/structure_attrs_fromdict into GenConverter.gen_un/structure_attrs_fromdict to allow calling back to Converter.un/structure_attrs_fromdict without sideeffects. (#118 <>_)
  • v1.1.2 Changes

    November 29, 2020
    • 0๏ธโƒฃ The default disambiguator will not consider non-required fields any more. (#108 <>_)
    • ๐Ÿ›  Fix a couple type annotations. (#107 <>) (#105 <>)
    • ๐Ÿ›  Fix a GenConverter unstructuring issue and tests.
  • v1.1.1 Changes

    October 30, 2020
    • โž• Add metadata for supported Python versions. (#103 <>_)
  • v1.1.0 Changes

    October 29, 2020
    • ๐Ÿ‘ Python 2, 3.5 and 3.6 support removal. If you need it, use a version below 1.1.0.
    • ๐Ÿ‘ Python 3.9 support, including support for built-in generic types (list[int] vs typing.List[int]).
    • cattrs now includes functions to generate specialized structuring and unstructuring hooks. Specialized hooks are faster and support overrides (omit_if_default and rename). See the cattr.gen module.
    • 0๏ธโƒฃ cattrs now includes a converter variant, cattr.GenConverter, that automatically generates specialized hooks for attrs classes. This converter will become the default in the future.
    • Generating specialized structuring hooks now invokes attr.resolve_types <>_ on a class if the class makes use of the new PEP 563 annotations.
    • cattrs now depends on attrs >= 20.1.0, because of attr.resolve_types.
    • 0๏ธโƒฃ Specialized hooks now support generic classes. The default converter will generate and use a specialized hook upon encountering a generic class.