NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #4215 most downloaded on PyPI
Yet another serialization library on top of dataclasses
Last release today
17 Sep 2026
Ships fairly regularly
a new release about every 3 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
117 releases · first in 2018
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
Full Changelog: https://github.com/yukinarit/pyserde/compare/v0.10.7...v0.10.8
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
Full Changelog: https://github.com/yukinarit/pyserde/compare/v0.10.6...v0.10.7
One column per quarter.
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
Full Changelog: https://github.com/yukinarit/pyserde/compare/v0.10.5...v0.10.6
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
Full Changelog: https://github.com/yukinarit/pyserde/compare/v0.10.4...v0.10.5
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
Full Changelog: https://github.com/yukinarit/pyserde/compare/v0.10.3...v0.10.4
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
Full Changelog: https://github.com/yukinarit/pyserde/compare/v0.10.2...v0.10.3
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
Full Changelog: https://github.com/yukinarit/pyserde/compare/v0.10.1...v0.10.2
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
Full Changelog: https://github.com/yukinarit/pyserde/compare/v0.10.0...v0.10.1
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
pyserde can (de)serialize dataclasses without @serde since v0.10.0. This feature is convenient when you want to use classes declared in external libraries or a type checker doesn't work with @serde decorator. See this example. Thanks @Kobzol!
@dataclass
class Foo:
i: int
s: str
f: float
b: bool
f = Foo(i=10, s='foo', f=100.0, b=True)
print(f"Into Json: {to_json(f)}")
s = '{"i": 10, "s": "foo", "f": 100.0, "b": true}'
print(f"From Json: {from_json(Foo, s)}")
Full Changelog: https://github.com/yukinarit/pyserde/compare/v0.9.8...v0.10.0
<!-- Release notes generated using configuration in .github/release.yml at v0.9.8 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.9.8 -->
Full Changelog: https://github.com/yukinarit/pyserde/compare/v0.9.7...v0.9.8
A bug for optional unions was fixed, Thanks @soaxelbrooke! `python @serde @dataclass(frozen=True) class Bar: request: Optional[Union[str, int]] `
A bug for optional unions was fixed, Thanks @soaxelbrooke!
@serde
@dataclass(frozen=True)
class Bar:
request: Optional[Union[str, int]]
Recursive dataclasses are supported in #290 ```python @dataclass class Recur: f: Optional['Recur']
@dataclass
class Recur:
f: Optional['Recur']
serde(Recur)
typing.FrozenSet and typing.DefaultDict are supported in #285,#286@serde
@dataclass
class Foo:
a: FrozenSet[int]
b: DefaultDict[str, List[int]]
Full Changelog: https://github.com/yukinarit/pyserde/compare/v0.9.5...v0.9.6
alias field attribute was implemented.
Variable lengh tuple is supported. `python @serde @dataclass class Foo: v: Tuple[int, ...] `
Thanks to PEP681 @dataclass_transform, @dataclass decorator is no longer mandatory if you use a PEP681 supported type checker such as pyright. If you
Thanks to PEP681 @dataclass_transform, @dataclass decorator is no longer mandatory if you use a PEP681 supported type checker such as pyright. If you are a mypy user, you still need @dataclass decorator.
@serde
#@dataclass <= No longer needed.
class Foo:
i: int
chore: Bump allowed version of numpy to >1.21.0 on Python 3.7
fix: Call to untyped function "serde" in typed context
pyserde v0.9 adds one of the most awaited features, the type checking functionality 🎉 If you add Coerce or Strict in serde decorator, pyserde will do
pyserde v0.9 adds one of the most awaited features, the type checking functionality 🎉 If you add Coerce or Strict in serde decorator, pyserde will do type coercing or type checking based on the declared types.
CoerceType coercing automatically converts a value into the declared type during (de)serialization. If the value is incompatible e.g. value is "foo" and type is int, pyserde raises an SerdeError.
@serde(type_check=Coerce)
@dataclass
class Foo
s: str
foo = Foo(10)
# pyserde automatically coerce the int value 10 into "10".
# {"s": "10"} will be printed.
print(to_json(foo))
StrictStrict type checking is to check every value against the declared type during (de)serialization. We plan to make Strict a default type checker in the future release.
@serde(type_check=Strict)
@dataclass
class Foo
s: str
foo = Foo(10)
# pyserde checks the value 10 is instance of `str`.
# SerdeError will be raised in this case because of the type mismatch.
print(to_json(foo))
Another notable change is switching toml library from toml to tomli. tomli is used in a handful of major products e.g. pip and pytest and will be the part of Python standard library in Python 3.11.
This release had contributions from 1 person: @kngwyu. Thank you so much! :tada: :joy:
fix: Use numpy<1.23.0 for python 3.7 and 3.8
chore: Replace stringcase with casfey (1f8a17d), closes #240
This release had a contribution from 1 person: @gitpushdashf. Thank you so much! :tada: :joy:
feat: Don't wrap user exception in SerdeError
…in json.dumps internally. This would lead to a breaking change in some cases. If you need the same behaviour as in pyserde<0.8, please explicitely pas…
Thanks to the contribution by @kigawas, pyserde can optionally use orjson as JSON serializer!
pip install pyserde[orjson]
If orjson is installed in the system, pyserde automatically use orjson in to_json/from_json.
NOTE: In order to align the JSON (de)serializer to orjson, a few parameters are passed in json.dumps internally. This would lead to a breaking change in some cases. If you need the same behaviour as in pyserde<0.8, please explicitely pass those parameters in serde.json.to_json. 🙇♂️
to_json(obj, ensure_ascii=True, separators=(", ", ": "))
Other noteble chage is we have @dataclass decorator back in the all example and test code in the repository as shown below. It's because we found mypy isn't able to deduce the type correctly without @dataclass decorator. If you are not mypy user, you can still declare a class with only @serde decorator. 👍 For more information, please read the docs.
@serde
@dataclass # <-- Recommended to add @dataclass if you are mypy user.
class Foo:
i: int
s: str
f: float
b: bool
This release had contributions from 1 person: @kigawas. Thank you so much! :tada: :joy:
Thanks to the great contribution by @kmsquire, pyserde supports some numpy types!
Thanks to the great contribution by @kmsquire, pyserde supports some numpy types!
@serde
class NPFoo:
i: np.int32
j: np.int64
f: np.float32
g: np.float64
h: np.bool_
u: np.ndarray
v: npt.NDArray
w: npt.NDArray[np.int32]
x: npt.NDArray[np.int64]
y: npt.NDArray[np.float32]
z: npt.NDArray[np.float64]
This release had contributions from 2 people: @kmsquire and @chagui. Thank you so much! :tada: :joy:
Don't package tests and examples (af829ae), closes #214
This release had contributions from 1 person: @gitpushdashf. Thank you so much! :tada: :joy:
ci: Run tests on pull_request only
fix: Optional in custom class deserializer
Untagged to ExternalTagging. This may break the existing code, so please be aware if you use dataclasses with Union. For more information, check the documentationThis release had contributions from 1 person: @tardyp. Thank you so much! :tada: :joy:
feat: Add serde_skip_default field attribute
With serde decorator and field function, you can declare pyserde class more easily.
from serde import serde, field
@serde
class Foo:
a : List[str] = field(default_factory=list, skip_if_false=True)
The declaration until v0.5.3 still works.
from dataclasses import dataclass
from serde import serialize, deserialize
@deserialize
@serialize
@dataclass
class Foo:
a : List[str] = field(default_factory=list, metadata={'serde_skip_if_false': True})
feat: Add more dataclass Field's attrs to Field
This release had contributions from 2 people: @rnestler, @mauvealerts. Thank you so much! :tada: :joy:
feat: (de)serialize non dataclass types correctly
feat: deserialize to the type more correctly
New documentation is available!
@deserialize
@serialize
@dataclass
class Bar:
c: float
d: bool
@deserialize
@serialize
@dataclass
class Foo:
a: int
b: str
bar: Bar = field(metadata={'serde_flatten': True})
This release had contributions from 1 person: @alexmisk. Thank you so much! :tada: :joy:
feat: add support for lazy annotations PEP563 (#112) (f7f6996), closes #112
from __future__ import annotations
from dataclasses import dataclass
from serde import deserialize, serialize
@deserialize
@serialize
@dataclass
class Foo:
i: int
s: str
f: float
b: bool
def foo(self, cls: Foo): # You can use "Foo" type before it's defined.
print('foo')
def serializer(cls, o):
...
def deserializer(cls, o):
...
@deserialize(deserializer=deserializer)
@serialize(serializer=serializer)
@dataclass
class Foo:
i: int
# Class serializer/deserializer is used as default.
dt1: datetime
# Override by field serializer/deserializer.
dt2: datetime = field(
metadata={
'serde_serializer': lambda x: x.strftime('%y.%m.%d'),
'serde_deserializer': lambda x: datetime.strptime(x, '%y.%m.%d'),
}
)
feat: Improve error description for union type
This release had contibutions from 1 person: @ydylla. Thank you so much! :tada: :joy:
fix: Add type annotation to serde decorators
You can get the code completion from the class with serialize and deserialize decorators. I would recommend everyone to upgrade to v0.3.1.
feat: Support PEP585 type hint annotation (81d3f4f) `python @deserialize @serialize @dataclass class Foo: l: list[str] t: tuple[str, bool] d: dict[str
@deserialize
@serialize
@dataclass
class Foo:
l: list[str]
t: tuple[str, bool]
d: dict[str, list[int]]
@deserialize
@serialize
@dataclass
class Foo:
v: Union[int, str]
c: Union[Dict[str, int], List[int]]
This release had contibutions from 2 people: @ydylla, @alexmisk. Thank you so much! :tada: :joy:
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →