%global _empty_manifest_terminate_build 0 Name: python-pyserde Version: 0.10.4 Release: 1 Summary: Yet another serialization library on top of dataclasses License: MIT URL: https://github.com/yukinarit/pyserde Source0: https://mirrors.nju.edu.cn/pypi/web/packages/51/16/f499d7c48777d4ae0d6ce0c0f980b27d461778dd61883ea2e22597ce475a/pyserde-0.10.4.tar.gz BuildArch: noarch Requires: python3-typing_inspect Requires: python3-typing_extensions Requires: python3-casefy Requires: python3-jinja2 Requires: python3-msgpack Requires: python3-tomli Requires: python3-tomli-w Requires: python3-pyyaml Requires: python3-numpy Requires: python3-numpy Requires: python3-numpy Requires: python3-numpy Requires: python3-orjson %description
pyserde
Yet another serialization library on top of dataclasses, inspired by serde-rs.
## Overview Declare a class with pyserde's `@serde` decorator. ```python @serde @dataclass class Foo: i: int s: str f: float b: bool ``` You can serialize `Foo` object into JSON. ```python >>> to_json(Foo(i=10, s='foo', f=100.0, b=True)) '{"i":10,"s":"foo","f":100.0,"b":true}' ``` You can deserialize JSON into `Foo` object. ```python >>> from_json(Foo, '{"i": 10, "s": "foo", "f": 100.0, "b": true}') Foo(i=10, s='foo', f=100.0, b=True) ``` ## Features - Supported data formats - dict - tuple - JSON - Yaml - Toml - MsgPack - Pickle - Supported types - Primitives (`int`, `float`, `str`, `bool`) - Containers - `List`, `Set`, `Tuple`, `Dict` - [`FrozenSet`](https://docs.python.org/3/library/stdtypes.html#frozenset), [`DefaultDict`](https://docs.python.org/3/library/collections.html#collections.defaultdict) - [`typing.Optional`](https://docs.python.org/3/library/typing.html#typing.Optional) - [`typing.Union`](https://docs.python.org/3/library/typing.html#typing.Union) - User defined class with [`@dataclass`](https://docs.python.org/3/library/dataclasses.html) - [`typing.NewType`](https://docs.python.org/3/library/typing.html#newtype) for primitive types - [`typing.Any`](https://docs.python.org/3/library/typing.html#the-any-type) - [`typing.Literal`](https://docs.python.org/3/library/typing.html#typing.Literal) - [`typing.Generic`](https://docs.python.org/3/library/typing.html#user-defined-generic-types) - [`typing.ClassVar`](https://docs.python.org/3/library/typing.html#user-defined-generic-type://docs.python.org/3/library/typing.html#typing.ClassVar) - [`Enum`](https://docs.python.org/3/library/enum.html#enum.Enum) and [`IntEnum`](https://docs.python.org/3/library/enum.html#enum.IntEnum) - Standard library - [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html) - [`decimal.Decimal`](https://docs.python.org/3/library/decimal.html) - [`uuid.UUID`](https://docs.python.org/3/library/uuid.html) - [`datetime.date`](https://docs.python.org/3/library/datetime.html#date-objects), [`datetime.time`](https://docs.python.org/3/library/datetime.html#time-objects), [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime-objects) - [`ipaddress`](https://docs.python.org/3/library/ipaddress.html) - PyPI library - [`numpy`](https://github.com/numpy/numpy) types - [Attributes](https://github.com/yukinarit/pyserde/blob/main/docs/features/attributes.md) - [Decorators](https://github.com/yukinarit/pyserde/blob/main/docs/features/decorators.md) - [TypeCheck](https://github.com/yukinarit/pyserde/blob/main/docs/features/type-check.md) - [Union Representation](https://github.com/yukinarit/pyserde/blob/main/docs/features/union.md) - [Python 3.10 Union operator](https://github.com/yukinarit/pyserde/blob/main/docs/features/union-operator.md) - [Python 3.9 type hinting](https://github.com/yukinarit/pyserde/blob/main/docs/features/python3.9-type-hinting.md) - [Postponed evaluation of type annotation](https://github.com/yukinarit/pyserde/blob/main/docs/features/postponed-evaluation-of-type-annotation.md) - [Forward reference](https://github.com/yukinarit/pyserde/blob/main/docs/features/forward-reference.md) - [Case Conversion](https://github.com/yukinarit/pyserde/blob/main/docs/features/case-conversion.md) - [Rename](https://github.com/yukinarit/pyserde/blob/main/docs/features/rename.md) - [Alias](https://github.com/yukinarit/pyserde/blob/main/docs/features/alias.md) - [Skip](https://github.com/yukinarit/pyserde/blob/main/docs/features/skip.md) - [Conditional Skip](https://github.com/yukinarit/pyserde/blob/main/docs/features/conditional-skip.md) - [Custom field (de)serializer](https://github.com/yukinarit/pyserde/blob/main/docs/features/custom-field-serializer.md) - [Custom class (de)serializer](https://github.com/yukinarit/pyserde/blob/main/docs/features/custom-class-serializer.md) - [Flatten](https://github.com/yukinarit/pyserde/blob/main/docs/features/flatten.md) ## Contributors β¨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):pyserde
Yet another serialization library on top of dataclasses, inspired by serde-rs.
## Overview Declare a class with pyserde's `@serde` decorator. ```python @serde @dataclass class Foo: i: int s: str f: float b: bool ``` You can serialize `Foo` object into JSON. ```python >>> to_json(Foo(i=10, s='foo', f=100.0, b=True)) '{"i":10,"s":"foo","f":100.0,"b":true}' ``` You can deserialize JSON into `Foo` object. ```python >>> from_json(Foo, '{"i": 10, "s": "foo", "f": 100.0, "b": true}') Foo(i=10, s='foo', f=100.0, b=True) ``` ## Features - Supported data formats - dict - tuple - JSON - Yaml - Toml - MsgPack - Pickle - Supported types - Primitives (`int`, `float`, `str`, `bool`) - Containers - `List`, `Set`, `Tuple`, `Dict` - [`FrozenSet`](https://docs.python.org/3/library/stdtypes.html#frozenset), [`DefaultDict`](https://docs.python.org/3/library/collections.html#collections.defaultdict) - [`typing.Optional`](https://docs.python.org/3/library/typing.html#typing.Optional) - [`typing.Union`](https://docs.python.org/3/library/typing.html#typing.Union) - User defined class with [`@dataclass`](https://docs.python.org/3/library/dataclasses.html) - [`typing.NewType`](https://docs.python.org/3/library/typing.html#newtype) for primitive types - [`typing.Any`](https://docs.python.org/3/library/typing.html#the-any-type) - [`typing.Literal`](https://docs.python.org/3/library/typing.html#typing.Literal) - [`typing.Generic`](https://docs.python.org/3/library/typing.html#user-defined-generic-types) - [`typing.ClassVar`](https://docs.python.org/3/library/typing.html#user-defined-generic-type://docs.python.org/3/library/typing.html#typing.ClassVar) - [`Enum`](https://docs.python.org/3/library/enum.html#enum.Enum) and [`IntEnum`](https://docs.python.org/3/library/enum.html#enum.IntEnum) - Standard library - [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html) - [`decimal.Decimal`](https://docs.python.org/3/library/decimal.html) - [`uuid.UUID`](https://docs.python.org/3/library/uuid.html) - [`datetime.date`](https://docs.python.org/3/library/datetime.html#date-objects), [`datetime.time`](https://docs.python.org/3/library/datetime.html#time-objects), [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime-objects) - [`ipaddress`](https://docs.python.org/3/library/ipaddress.html) - PyPI library - [`numpy`](https://github.com/numpy/numpy) types - [Attributes](https://github.com/yukinarit/pyserde/blob/main/docs/features/attributes.md) - [Decorators](https://github.com/yukinarit/pyserde/blob/main/docs/features/decorators.md) - [TypeCheck](https://github.com/yukinarit/pyserde/blob/main/docs/features/type-check.md) - [Union Representation](https://github.com/yukinarit/pyserde/blob/main/docs/features/union.md) - [Python 3.10 Union operator](https://github.com/yukinarit/pyserde/blob/main/docs/features/union-operator.md) - [Python 3.9 type hinting](https://github.com/yukinarit/pyserde/blob/main/docs/features/python3.9-type-hinting.md) - [Postponed evaluation of type annotation](https://github.com/yukinarit/pyserde/blob/main/docs/features/postponed-evaluation-of-type-annotation.md) - [Forward reference](https://github.com/yukinarit/pyserde/blob/main/docs/features/forward-reference.md) - [Case Conversion](https://github.com/yukinarit/pyserde/blob/main/docs/features/case-conversion.md) - [Rename](https://github.com/yukinarit/pyserde/blob/main/docs/features/rename.md) - [Alias](https://github.com/yukinarit/pyserde/blob/main/docs/features/alias.md) - [Skip](https://github.com/yukinarit/pyserde/blob/main/docs/features/skip.md) - [Conditional Skip](https://github.com/yukinarit/pyserde/blob/main/docs/features/conditional-skip.md) - [Custom field (de)serializer](https://github.com/yukinarit/pyserde/blob/main/docs/features/custom-field-serializer.md) - [Custom class (de)serializer](https://github.com/yukinarit/pyserde/blob/main/docs/features/custom-class-serializer.md) - [Flatten](https://github.com/yukinarit/pyserde/blob/main/docs/features/flatten.md) ## Contributors β¨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):pyserde
Yet another serialization library on top of dataclasses, inspired by serde-rs.
## Overview Declare a class with pyserde's `@serde` decorator. ```python @serde @dataclass class Foo: i: int s: str f: float b: bool ``` You can serialize `Foo` object into JSON. ```python >>> to_json(Foo(i=10, s='foo', f=100.0, b=True)) '{"i":10,"s":"foo","f":100.0,"b":true}' ``` You can deserialize JSON into `Foo` object. ```python >>> from_json(Foo, '{"i": 10, "s": "foo", "f": 100.0, "b": true}') Foo(i=10, s='foo', f=100.0, b=True) ``` ## Features - Supported data formats - dict - tuple - JSON - Yaml - Toml - MsgPack - Pickle - Supported types - Primitives (`int`, `float`, `str`, `bool`) - Containers - `List`, `Set`, `Tuple`, `Dict` - [`FrozenSet`](https://docs.python.org/3/library/stdtypes.html#frozenset), [`DefaultDict`](https://docs.python.org/3/library/collections.html#collections.defaultdict) - [`typing.Optional`](https://docs.python.org/3/library/typing.html#typing.Optional) - [`typing.Union`](https://docs.python.org/3/library/typing.html#typing.Union) - User defined class with [`@dataclass`](https://docs.python.org/3/library/dataclasses.html) - [`typing.NewType`](https://docs.python.org/3/library/typing.html#newtype) for primitive types - [`typing.Any`](https://docs.python.org/3/library/typing.html#the-any-type) - [`typing.Literal`](https://docs.python.org/3/library/typing.html#typing.Literal) - [`typing.Generic`](https://docs.python.org/3/library/typing.html#user-defined-generic-types) - [`typing.ClassVar`](https://docs.python.org/3/library/typing.html#user-defined-generic-type://docs.python.org/3/library/typing.html#typing.ClassVar) - [`Enum`](https://docs.python.org/3/library/enum.html#enum.Enum) and [`IntEnum`](https://docs.python.org/3/library/enum.html#enum.IntEnum) - Standard library - [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html) - [`decimal.Decimal`](https://docs.python.org/3/library/decimal.html) - [`uuid.UUID`](https://docs.python.org/3/library/uuid.html) - [`datetime.date`](https://docs.python.org/3/library/datetime.html#date-objects), [`datetime.time`](https://docs.python.org/3/library/datetime.html#time-objects), [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime-objects) - [`ipaddress`](https://docs.python.org/3/library/ipaddress.html) - PyPI library - [`numpy`](https://github.com/numpy/numpy) types - [Attributes](https://github.com/yukinarit/pyserde/blob/main/docs/features/attributes.md) - [Decorators](https://github.com/yukinarit/pyserde/blob/main/docs/features/decorators.md) - [TypeCheck](https://github.com/yukinarit/pyserde/blob/main/docs/features/type-check.md) - [Union Representation](https://github.com/yukinarit/pyserde/blob/main/docs/features/union.md) - [Python 3.10 Union operator](https://github.com/yukinarit/pyserde/blob/main/docs/features/union-operator.md) - [Python 3.9 type hinting](https://github.com/yukinarit/pyserde/blob/main/docs/features/python3.9-type-hinting.md) - [Postponed evaluation of type annotation](https://github.com/yukinarit/pyserde/blob/main/docs/features/postponed-evaluation-of-type-annotation.md) - [Forward reference](https://github.com/yukinarit/pyserde/blob/main/docs/features/forward-reference.md) - [Case Conversion](https://github.com/yukinarit/pyserde/blob/main/docs/features/case-conversion.md) - [Rename](https://github.com/yukinarit/pyserde/blob/main/docs/features/rename.md) - [Alias](https://github.com/yukinarit/pyserde/blob/main/docs/features/alias.md) - [Skip](https://github.com/yukinarit/pyserde/blob/main/docs/features/skip.md) - [Conditional Skip](https://github.com/yukinarit/pyserde/blob/main/docs/features/conditional-skip.md) - [Custom field (de)serializer](https://github.com/yukinarit/pyserde/blob/main/docs/features/custom-field-serializer.md) - [Custom class (de)serializer](https://github.com/yukinarit/pyserde/blob/main/docs/features/custom-class-serializer.md) - [Flatten](https://github.com/yukinarit/pyserde/blob/main/docs/features/flatten.md) ## Contributors β¨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):