Msgspec

Latest version: v0.19.0

Safety actively analyzes 706267 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 6

0.18.1

- Support custom `builtin_types` in `msgspec.to_builtins` (517).
- Try `getattr` before `getitem` when converting with `from_attributes=True` (519).
- More efficient module state access in top-level functions (521).

0.18.0

- Add a new `msgspec.json.Decoder.decode_lines` method 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.Object` instances as dataclass-like objects (501).
- Improve performance when json decoding `float` values (510).
- Support for JSON encoding dicts with `float` keys (510).
- Support for JSON decoding dicts with `float` keys (510).
- Add `float_hook` to `msgspec.json.Decoder` to support changing the default for how JSON floats are decoded (511).

0.17.0

- Ensure `None` may be explicitly passed to `defstruct` for `module`/`namespace`/`bases` (445).
- Support decoding `datetime.datetime` values from `int`/`float` values (interpreted as seconds since the Unix epoch) when `strict=False` (452).
- Support subclasses of collection types (`list`, `dict`, ...) as inputs to `convert` (453).
- Support `str` subclasses as keys in `to_builtins` and all protocol `encode` methods (454).
- Improved performance when JSON encoding `decimal.Decimal` values (455).
- Improved performance when JSON encoding `int`/`float` values (458).
- Improved performance when JSON encoding `str` values (459).
- Wrap errors in `dec_hook` with a `ValidationError` (460).
- Support decoding `decimal.Decimal` values from numeric values (463)
- Support encoding `decimal.Decimal` values as numeric values (465).
- Support converting `decimal.Decimal` values to `float` in `convert` (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 for `Struct` types (470).
- Support decoding `0`/`1` into `bool` types when `strict=False` (471).
- Wrap errors raised in `__post_init__`/`__attrs_post_init__` in a `ValidationError` when decoding (472).
- Add native support for encoding/decoding `datetime.timedelta` types (475).
- Add a new `msgspec.json.Encoder.encode_lines` method for encoding an iterable of values as newline-delimited JSON (479).

0.16.0

- Deprecate `msgspec.from_builtins` in favor of [`msgspec.convert`](https://jcristharif.com/msgspec/api.html#msgspec.convert). The new `convert` function provides a superset of the functionality available in the old `from_builtins` function. See the [converters docs](https://jcristharif.com/msgspec/converters.html) 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](https://jcristharif.com/msgspec/usage.html#strict-vs-lax-mode) for more information (434).
- Allow any of msgspec's [supported types](https://jcristharif.com/msgspec/supported-types.html) 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).

0.15.1

- Fix a reference counting bug introduced in 0.15.0 when decoding naive (no timezone) `datetime`/`time` objects in both the `msgpack` and `json` decoders (409).
- Work around an upstream bug in CPython to properly support `Required`/`NotRequired` in `TypedDict` when `__future__.annotations` is enabled (410).

0.15.0

- Add support for Generic `Struct` types (386, 393).
- Add support for Generic `dataclasses` and `attrs` types (396).
- Add support for Generic `typing.TypedDict` and `typing.NamedTuple` types (398).
- **BREAKING**: No longer normalize timezones to UTC when decoding `datetime` objects from JSON (391).
- Support decoding unhyphenated UUIDs (392).
- A few type annotation fixups (383, 387).
- Dedent docstrings for descriptions when generating JSON schemas (397).
- Use a variant of `__qualname__` when auto-generating Struct tags rather than `__name__` (399).
- Fix bug when handling `typing.Literal` types containing a literal `None` (400).
- Make all `Encoder`/`Decoder` methods threadsafe (402).
- **BREAKING**: Drop the `write_buffer_size` kwarg to `Encoder` (402).

Page 2 of 6

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.