Releases: jcrist/msgspec
Releases · jcrist/msgspec
Version 0.19.0
- Improve JSON encoding performance by up to 40% (#647).
- Ensure
tupleandfrozensetdefault values are treated identically whether specified by value ordefault_factory(#653). - Fix memory leak of
match_argsinStructConfigobject (#684). - Fix memory leak in
Raw.copy()(#709). - Update
decodesignatures for PEP 688 (#740). - Generate
__replace__method onStructtypes, for use withcopy.replace(#747). - Fix incorrect decoding of certain > 64 bit integers (#751).
- Call
__post_init__when converting from an object to a Struct (#752). - BREAKING: Expand buffer when
encode_intois passed a buffer smaller thanoffset(#753). - Support
Rawobjects as inputs toconvert(#754). - Error nicely when a dataclass type (instead of an instance) is passed to
encode(#755). - Drop support for Python 3.8 (#756, #763).
- Add support for Python 3.13 (#711).
- Remove deprecated
from_builtins(#761). - Support encoding any
Enumtype whose.valueis a supported type (#757). - Don't fail eagerly when processing generic types with unsupported
__parameters__(#772). - Use
eval_type_backportto backport type annotations to Python 3.9 (#773).
Version 0.18.6
- Support coercing integral floats to ints when
strict=False(#619). - Preserve leading
_when renaming fields to camel or pascal case (#620). - Support zero-copy decoding binary fields to a
memoryview(#624). - Fix a bug when inheriting from the same
Genericbase class multiple times (#626). - Add an
orderoption to all encoders for enforcing deterministic/sorted ordering when encoding. This can help provide a more consistent or human readable output (#627). - Support inheriting from any slots-class when defining a new
Structtype withgc=False(#635). - Automatically infer the input field naming convention when converting non-dict mappings or arbitrary objects to
Structtypes inmsgspec.convert(#636).
Version 0.18.5
- Support unhashable
Annotatedmetadata inmsgspec.inspect.type_info(#566). - Fix bug preventing decoding dataclasses/attrs types with default values and
slots=True, frozen=True(#569). - Support passing parametrized generic struct types to
msgspec.structs.fields(#571). - Validate
strconstraints on dict keys when decoding msgpack (#577). - Support
UUIDsubclasses as inputs tomsgspec.convert(#592). - Call
__eq__from generated__ne__if user defines manual__eq__method on aStructtype (#593). - Include the
Structtype in the generated hash (#595). - Add a
cache_hashstruct option (#596). - Fix a bug around caching of dataclass type info when dealing with subclasses of dataclasses (#599).
- Add
msgspec.structs.force_setattr(#600). - Support custom dict key types in JSON encoder and decoder (#602).
- Include
dictkey constraints in generated JSON schema via thepropertyNamesfield (#604). - Add a
schema_hookfor generating JSON schemas for custom types (#605). - Add support for Python 3.12's
typealiases (#606).
Version 0.18.4
- Resolve an issue leading to periodic segfaults when importing
msgspecon CPython 3.12 (#561)
Version 0.18.3
Version 0.18.2
Version 0.18.1
Version 0.18.0
- Add a new
msgspec.json.Decoder.decode_linesmethod for decoding newline-delimited JSON into a list of values (#485). - Support for decoding UUIDs from binary values (#499).
- Support for encoding UUIDs in alternate formats (#499).
- Overhaul how dataclasses are encoded to support more dataclass-like objects (#501).
- Encode all declared fields on a dataclass (#501).
- Support encoding
edgedb.Objectinstances as dataclass-like objects (#501). - Improve performance when json decoding
floatvalues (#510). - Support for JSON encoding dicts with
floatkeys (#510). - Support for JSON decoding dicts with
floatkeys (#510). - Add
float_hooktomsgspec.json.Decoderto support changing the default for how JSON floats are decoded (#511).
Version 0.17.0
- Ensure
Nonemay be explicitly passed todefstructformodule/namespace/bases(#445). - Support decoding
datetime.datetimevalues fromint/floatvalues (interpreted as seconds since the Unix epoch) whenstrict=False(#452). - Support subclasses of collection types (
list,dict, ...) as inputs toconvert(#453). - Support
strsubclasses as keys into_builtinsand all protocolencodemethods (#454). - Improved performance when JSON encoding
decimal.Decimalvalues (#455). - Improved performance when JSON encoding
int/floatvalues (#458). - Improved performance when JSON encoding
strvalues (#459). - Wrap errors in
dec_hookwith aValidationError(#460). - Support decoding
decimal.Decimalvalues from numeric values (#463) - Support encoding
decimal.Decimalvalues as numeric values (#465). - Support converting
decimal.Decimalvalues tofloatinconvert(#466). - Preliminary support for CPython 3.12 beta releases (#467).
- Support decoding integers that don't fit into an
int64/uint64(#469). - Add a new optional
__post_init__method forStructtypes (#470). - Support decoding
0/1intobooltypes whenstrict=False(#471). - Wrap errors raised in
__post_init__/__attrs_post_init__in aValidationErrorwhen decoding (#472). - Add native support for encoding/decoding
datetime.timedeltatypes (#475). - Add a new
msgspec.json.Encoder.encode_linesmethod for encoding an iterable of values as newline-delimited JSON (#479).
Version 0.16.0
- Deprecate
msgspec.from_builtinsin favor ofmsgspec.convert. The newconvertfunction provides a superset of the functionality available in the oldfrom_builtinsfunction. See the converters docs for more information (#431). - Add a
from_attributesargument tomsgspec.convertfor allowing conversion between object types with matching attribute names. One use case for this is converting ORM objects toStructordataclassestypes (#419). - Support passing generic
Mappingobjects as inputs tomsgspec.convert. These may be coerced todict/Struct/dataclasses/attrstypes (#427). - Add a new
strictkeyword argument to alldecodefunctions,Decoderclasses, as well asmsgspec.convert. This defaults toTrue, setting it to false enables a wider set of coercion rules (e.g. coercing astrinput to anint). 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.Anytype inmsgspec.convert(#435). - Support parametrizing
Decodertypes at runtime (#415). - Support encoding subclasses of
UUID(#429).