Mashumaro

Latest version: v3.15

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

Scan your dependencies

Page 8 of 12

2.0.2

Changes
--------

* Fixed passing a value to `serialize` method of `SerializationStrategy` registered in `Config`: https://github.com/Fatal1ty/mashumaro/issues/44

2.0.1

Changes
--------

* Fixed loading typing information for mypy https://github.com/Fatal1ty/mashumaro/pull/43

2.0

Changes
--------

* Added support for `collections.OrderedDict` (3.7+) and `collections.Counter` types
* Fixed passing `serialize` and `deserialize` field metadata options in `Union` and `Optional` types
* `SerializationStrategy` is now a field option (backward incompatible change). See [here](https://github.com/Fatal1ty/mashumaro#serialization_strategy-option) for details.
* Added ability to configure some options using inner `Config` class. See [here](https://github.com/Fatal1ty/mashumaro#config-options) for details.
* Fixed typing problem on python 3.6. See https://github.com/Fatal1ty/mashumaro/pull/38.

1.24

Changes
--------

* Added support for `Union` types. It's recommended to place more complex variant types at first place like `Union[Dict[int, int], List[int]]` not `Union[List[int], Dict[int, int]]`. When optional type validation is implemented it will be possible not to follow this rule.
* It is now possible to use `serialize` and `deserialize` options for any third-party types and `SerializableType` classes if you need it for some reason.

1.23

Changes
--------

* Added support for MyEnum(str, Enum): https://github.com/Fatal1ty/mashumaro/pull/33
* Fixed using inner classes as field types:
python
dataclass
class A(DataClassDictMixin):

dataclass
class B(DataClassDictMixin):
b: int

a: int
b: B

print(A.from_dict({'a': 1, 'b': {'b': 2}}))

1.22

Changes
--------

* Support for hooks declared in superclasses

python
class Counter:
deserialize = 0
serialize = 0

classmethod
def __pre_deserialize__(cls, d):
Counter.deserialize += 1
return d

def __pre_serialize__(self):
Counter.serialize += 1
return self

dataclass
class Derived(Counter, DataClassDictMixin):
a: int

obj = Derived.from_dict({"a": 1})
obj.to_dict()

print(Counter.deserialize) 1
print(Counter.serialize) 1

Page 8 of 12

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.