Fast and well tested serialization library
APACHE-2.0 License
Bot releases are hidden (Show)
variant_tagger_fn
(#184)ForwardRef
in JSON Schema generation (#187)IntFlag
when omit_default
is enabled (#188)serialization_strategy
config optionallow_deserialization_not_by_alias
config option to allow deserialization by both alias and field name, see documentation (https://github.com/Fatal1ty/mashumaro/pull/175)UnserializableDataError
for generic serializable types and generic serialization strategies with postponed evaluation of annotations (#177)ValueError
was not thrown if invalid value type was passed to from_*
methodserialize_by_alias
dialect optionnamedtuple_as_dict
dialect optionsort_keys
config option to sort keys on serialization, see documentation (#157)omit_default
config and dialect options to exclude values equal to defaults on serialization, see documentation (#161)variant_tagger_fn
discriminator parameter to allow discrimination based on a key that is not part of the model, see documentation (#135)no_copy_collections
dialect option to avoid collection data types copying, see documentation (#163)LiteralString
(#166)ForwardRef
types (#144)SerializableType
and GenericSerializableType
subclasses (#156)flake8
to ruff
(#150)default_factory
by JSON Schema generator (#114)additionalProperties
in JSON Schema (#123)Annotated
type with unhashable metadata (#133)Discriminator
type for discriminated unions and subclasses support, see documentation (#106)to_*
methods to the hooks, see documentation (#110)Annotated
are now different from unenclosed ones in serialization_strategy
, see documentation (#115)lazy_compilation
config option that can reduce import time and speed up deserialization, see documentation
Final
types (#107)Literal
on Python 3.9.0 (#103)SerializableType
when TypeVars were mixed with ordinary types in _serialize
/ _deserialize
annotationsdataclasses.KW_ONLY
resulted in UnserializableDataError
from_dict
method could result in unhandled exceptions"omit"
serialization engine to skip the field during serializationref_prefix
parameter to build_json_schema
and JSONSchemaBuilder
to change reference prefixSerializationStrategy
(details)SerializationStrategy
methods by optional use_annotations=True
(details)__class_getitem__
methods will now be treated as generic types according to PEP 560UnresolvedTypeReferenceError
when postponed annotations were used and parent generic dataclass was defined in different module. See https://github.com/Fatal1ty/mashumaro/issues/90.SerializableType
to simplify dealing with generic types (see updated documentation)TypeVarTuple
and Unpack
from PEP 646Tuple[()]
on python 3.11Tuple[T, ...]
from "Tuple[T, Ellipsis]"
to "Tuple[T, ...]"
None
value fields on serialization to TOML format. See https://github.com/Fatal1ty/mashumaro/issues/85.omit_none
config optionomit_none
dialect optionNone
values to fields that can't be None
according to their typetyping.Self
and typing_extensions.Self
from_dict
and to_dict
, methods in other mixins can also be compiled nowDataClassMessagePackMixin
:
ADD_DIALECT_SUPPORT
config option when using DataClassMessagePackMixin
from_msgpack
and to_msgpack
are now compiledDataClassORJSONMixin
to use a third-party orjson
library that will handle supported data types by itself
orjson_options
config option to change default options passing to orjson.dumps
methodto_jsonb
and to_json
have orjson_options
keyword argument to override the default optionsDataClassTOMLMixin
init=False
— they are skipped during deserialization now. See https://github.com/Fatal1ty/mashumaro/issues/82.DataClassMessagePackMixin
. See https://github.com/Fatal1ty/mashumaro/issues/76.