pyserde
pyserde copied to clipboard
Yet another serialization library on top of dataclasses, inspired by serde-rs.
toml and yaml support native datetime types (see e.g., https://toml.io/en/v1.0.0#offset-date-time). Currently pyserde converts all datetime types to string, which prevents tomli and pyyaml from handling these types directly.
Similarly to [field attributes](https://serde.rs/field-attrs.html) in the serde.rs crate it would be very useful to be able to describe multiple aliases for the same field, that way you're not stuck if...
I would like to implement type coercion and strict type checking like the one in [pydantic](https://pydantic-docs.helpmanual.io/usage/types/#strict-types).
I think that `skip_if_default`, `skip_if_false`, and `skip_if` don't work if there is a custom serializer? Example: ```python3 from serde import serde, field from dataclasses import dataclass from serde.json import to_json...
I think there is a bug with tuples of variable lengths: ## Example ```python from serde.de import deserialize from serde.json import from_json @deserialize class Foo: values: tuple[int, ...] foo =...
```python from typing import NewType, Dict from serde import deserialize, from_dict @deserialize class A: a: Dict assert from_dict(A, {'a': {'x': 'y'}}).a == {'x': 'y'} MyType = NewType('MyType', Dict) @deserialize class...
> it would also be nice to be able to set that option to skip_if_default more globally, e.g. at the class level (in the @serialize decorator maybe) in addition to...
Thanks @yukinarit and others for an awesome library, this is exactly what I wanted when working with dataclasses. I did have some issues though, because I noticed that the documentation...