Releases: jcrist/msgspec
Releases · jcrist/msgspec
Version 0.10.0
- Add
forbid_unknown_fieldsconfiguration option toStructtypes (#210) - BREAKING: Encode all
enumtypes by value, rather than name (#211) - Fix a bug in the JSON encoder when base64 encoding binary objects (#217)
- Add support for encoding/decoding
dataclasses(#218) - Add support for encoding/decoding
datetime.dateobjects (#221) - Add support for encoding/decoding
uuid.UUIDobjects (#222) - BREAKING: support encoding/decoding
datetime.datetimevalues without timezones by default (#224). - Add a
tzconstraint to require aware or naive datetime/time objects when decoding (#224). - Add support for encoding/decoding
datetime.timeobjects (#225) - Add a
msgspec.json.formatutility for efficiently pretty-printing already encoded JSON documents (#226). - Support decoding JSON from strings instead of just bytes-like objects (#229)
Version 0.9.1
Version 0.9.0
- Support for constraints during validation. For example, this allows ensuring a field is an integer >= 0. (#176)
- New utilities for generating JSON Schema from type definitions (#181)
- Support for pretty printing using rich (#183)
- Improve integer encoding performance (#170)
- Builtin support for renaming fields using kebab-case (#175)
- Support for passing a mapping when renaming fields (#185)
Version 0.8.0
- Support integer tag values when using tagged unions (#135).
- Support decoding into
typing.TypedDicttypes (#142). - Support encoding/decoding
typing.NamedTupletypes (#161). - Test against CPython 3.11 prelease builds (#146).
- Add
ValidationError(a subclass ofDecodeError) to allow differentiating between errors due to a message not matching the schema from those due to the message being invalid JSON (#155). - Support encoding subclasses of
list/dict(#160). - Fix a bug preventing decoding custom types wrapped in a
typing.Optional(#162).
Version 0.7.1
Version 0.7.0
- Dramatically speedup JSON string decoding, up to 2x speedup in some cases (#118).
- Adds a cache for decoding short (< 32 character) ASCII dict keys. This results in up to a 40% speedup when decoding many dicts with common keys using an untyped decoder. It's still recommended to define
Structtypes when your messages have a common structure, but in cases where no type is provided decoding is now much more performant (#120, #121). - Adds
orderandeqconfiguration options forStructtypes, mirroring thedataclassesoptions of the same name. Order comparisons for Struct types are very performant, roughly 10x to 70x faster than alternative libraries (#122). - Speedup
Structdecoding for both JSON and MessagePack, on average 20% faster (#119). - Various additional performance improvements, mostly to the JSON implementation (#100, #101, #102).
- Add
defstructmethod for dynamically defining newStructtypes at runtime (#105). - Fix ARM support and publish ARM wheels for Linux and Mac (#104).
- Reduce published wheel sizes by stripping debug symbols (#113).
- Fix a memory leak in
Struct.__reduce__(#117). - Rename
nogcstruct option togc(a breaking change). To disable GC on a Struct instance you now want to specifygc=Falseinstead ofnogc=True(#124).
Version 0.6.0
- Add a new
msgspec.Rawtype for delayed decoding of message fields / serializing already encoded fields. - Add
omit_defaultsoption toStructtypes (docs). If enabled, fields containing their respective default value will be omitted from serialized message. This improves both encode and decode performance. - Add
renameoption toStructtypes (docs) for altering the field names used for encoding. A major use of this is supportingcamelCaseJSON field names, while letting Python code use the more standardsnake_casefield names. - Improve performance of
nogc=Truestructs. GC is now avoided in more cases, andnogc=Truestructs use 16 fewer bytes per instance. Also added a benchmark for howmsgspeccan interact with application GC usage. - Cache creation of tagged union lookup tables, reducing memory usage for applications making heavy use of tagged unions.
- Support encoding and decoding
frozensetinstances - A smattering of other performance improvements.
Version 0.5.0
- Support tagged unions for encoding/decoding a
Unionofmsgspec.Structtypes. - Further improve encoding performance of
enum.Enumby 20-30% - Reduce overhead of calling
msgspec.json.decode/msgspec.msgpack.decodewithtype=SomeStructType. It's still faster to create aDecoderonce and calldecoder.decodemultiple times, but for struct types the overhead of calling the top-level function is decreased significantly. - Rename the Struct option
asarraytoarray_like(a breaking change)
Version 0.4.2
- Support
Literalstring types as dict keys in JSON - Support Python 3.10 style unions (e.g.
int | float | None) - Publish Python 3.10 wheels
Version 0.4.1
- Optimize decoding of
Enumtypes, ~10x faster - Optimize decoding of
IntEnumtypes, ~12 faster - Support decoding
typing.Literaltypes - Add
nogcoption forStructtypes, disabling the cyclic garbage collector for their instances