msgspec
msgspec copied to clipboard
A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML
### Description I looked through your docs and couldn't find a straightforward way to iterate over struct field names and values similar to `dict.items()`. Obviously, there are various ways I...
### Description Currently `rename` on a Struct is always two-ways. ```py import msgspec import re # Data from a third-party API data = """\ { "userId": 456, "firstName": "Jane", "lastName":...
### Description We’re currently storing integer fields on objects in DynamoDB. DynamoDB/boto3 returns all numbers as Decimals – there is no dedicated integer type in DynamoDB. There doesn’t seem to...
### Question Hey folks, I went over https://github.com/jcrist/msgspec/issues/594 because of the same assumptions. I was expecting `asdict` to work on nested Structs, at least as an option. This is where...
### Description This was already raised in #194 , however I'm asking for it again. With later mypyc versions (at least on Python 3.12) the problem with msgpack.Struct's has changed...
### Description Hello all - we use msgspec to encode json of api call responses. We recently discovered that there is a discrepancy between how python floats and decimals are...
### Question When using `msgspec.json.encode` for a dictionary in Python 3.12, for example: ```python msgspec.json.encode({"b": 1, "a": 2}) ``` I see that the ordering of the keys is preserved (with...
Adds a new `raw_decode` method on the JSON and MsgPack `Decoder` classes that allow decoding objects with trailing data after them. This mirrors the interface of the `raw_decode` method in...
Fixes #822 (cc @Jonxslays) This will have the side effect of easing adoption for Django projects because they tend to use [TextChoices / IntChoices](https://docs.djangoproject.com/en/5.1/ref/models/fields/#enumeration-types) when they need enumerations and this...
``` (venv) cc@pretty:~$ pip install --no-build-isolation -C"--with-cython=" git+https://github.com/jcrist/msgspec Collecting git+https://github.com/jcrist/msgspec Cloning https://github.com/jcrist/msgspec to /tmp/pip-req-build-y5vzjnp3 Running command git clone --filter=blob:none --quiet https://github.com/jcrist/msgspec /tmp/pip-req-build-y5vzjnp3 Resolved https://github.com/jcrist/msgspec to commit dd965dce22e5278d4935bea923441ecde31b5325 Preparing metadata (pyproject.toml)...