Skip to content

Version 0.16.0

Compare
Choose a tag to compare
@jcrist jcrist released this 12 Jun 14:58
· 130 commits to main since this release
  • Deprecate msgspec.from_builtins in favor of msgspec.convert. The new convert function provides a superset of the functionality available in the old from_builtins function. See the converters docs for more information (#431).
  • Add a from_attributes argument to msgspec.convert for allowing conversion between object types with matching attribute names. One use case for this is converting ORM objects to Struct or dataclasses types (#419).
  • Support passing generic Mapping objects as inputs to msgspec.convert. These may be coerced to dict/Struct/dataclasses/attrs types (#427).
  • Add a new strict keyword argument to all decode functions, Decoder classes, as well as msgspec.convert. This defaults to True, setting it to false enables a wider set of coercion rules (e.g. coercing a str input to an int). See "Strict" vs "Lax" Mode for more information (#434).
  • Allow any of msgspec's supported types as inputs to msgspec.convert (#431, #418).
  • Passthrough input unchanged when coercing to typing.Any type in msgspec.convert (#435).
  • Support parametrizing Decoder types at runtime (#415).
  • Support encoding subclasses of UUID (#429).