Skip to content

Version 0.13.0

Compare
Choose a tag to compare
@jcrist jcrist released this 09 Feb 04:50
· 228 commits to main since this release
  • Add to_builtins function for converting messages composed of any supported type to ones composed of only simple builtin types commonly supported by Python serialization libraries (#258).
  • Add from_builtins function for converting and validating messages composed of simple builtin types to ones composed of any type msgspec supports (#266, #302).
  • Add msgspec.yaml module for encoding/decoding YAML (#267).
  • Add msgspec.toml module for encoding/decoding TOML (#268).
  • Add msgspec.structs.replace function for creating a copy of an existing Struct with some changes applied (#262).
  • Add msgspec.structs.asdict and msgspec.structs.astuple functions for converting a struct instance to a dict or tuple respectively (#300).
  • Support arbitrarily nested typing.NewType/typing.Annotated types (#272).
  • Improve error message for invalid keyword arguments passed to Struct.__init__ (#273).
  • Support default_factory configuration for Struct fields (#274).
  • BREAKING: With the exception of empty builtin collections ([], {}, set(), bytearray()), mutable default values in Struct types are no longer deepcopied when used. If a different mutable default value is needed, please configure a default_factory instead (#274).
  • Improve performance of creating Structs with default parameters (#274).
  • Support typing.ClassVar annotations of Struct types (#281).
  • Support encoding/decoding decimal.Decimal types (#288).
  • Support "abstract" type annotations like collections.abc.MutableMapping/typing.MutableMapping in decoders (#290).
  • Support any string-like or int-like type as a dict key when encoding or decoding JSON (#292).
  • Improved performance encoding large collections in JSON and MessagePack encoders (#294, #298).