From 0601fff01f6a95c5eceb2085a16719e2f49e4a05 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Wed, 12 Apr 2023 02:45:50 +0000 Subject: automatic import of python-pyserde --- .gitignore | 1 + python-pyserde.spec | 541 ++++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 543 insertions(+) create mode 100644 python-pyserde.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..48d189f 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/pyserde-0.10.4.tar.gz diff --git a/python-pyserde.spec b/python-pyserde.spec new file mode 100644 index 0000000..6b264fb --- /dev/null +++ b/python-pyserde.spec @@ -0,0 +1,541 @@ +%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.

+

+ + pypi + + + pypi + + + GithubActions + + + CodeCov + +

+

+ Guide | API Docs | Examples +

+ +## 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)): + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
yukinarit
yukinarit

πŸ’»
Alexander Miskaryan
Alexander Miskaryan

πŸ’»
ydylla
ydylla

πŸ’»
Kevin Squire
Kevin Squire

πŸ’»
Yushi OMOTE
Yushi OMOTE

πŸ’»
Yuji Kanagawa
Yuji Kanagawa

πŸ’»
Weiliang Li
Weiliang Li

πŸ’»
Mauve
Mauve

πŸ’»
adsharma
adsharma

πŸ’»
Guilhem C.
Guilhem C.

πŸ“–
Pierre Tardy
Pierre Tardy

πŸ’»
Raphael Nestler
Raphael Nestler

πŸ“–
Pranav V P
Pranav V P

πŸ’»
andreymal
andreymal

πŸ’»
Johann Fuechsl
Johann Fuechsl

πŸ’»
DoeringChristian
DoeringChristian

πŸ’»
Stuart Axelbrooke
Stuart Axelbrooke

πŸ’»
Jakub BerΓ‘nek
Jakub BerΓ‘nek

πŸ’»
Fredrik Reinholdsen
Fredrik Reinholdsen

πŸ’»
+ + Add your contributions + +
+ + + + + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! + +## LICENSE + +This project is licensed under the [MIT license](https://github.com/yukinarit/pyserde/blob/main/LICENSE). + + +%package -n python3-pyserde +Summary: Yet another serialization library on top of dataclasses +Provides: python-pyserde +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-pyserde +

pyserde

+

Yet another serialization library on top of dataclasses, inspired by serde-rs.

+

+ + pypi + + + pypi + + + GithubActions + + + CodeCov + +

+

+ Guide | API Docs | Examples +

+ +## 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)): + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
yukinarit
yukinarit

πŸ’»
Alexander Miskaryan
Alexander Miskaryan

πŸ’»
ydylla
ydylla

πŸ’»
Kevin Squire
Kevin Squire

πŸ’»
Yushi OMOTE
Yushi OMOTE

πŸ’»
Yuji Kanagawa
Yuji Kanagawa

πŸ’»
Weiliang Li
Weiliang Li

πŸ’»
Mauve
Mauve

πŸ’»
adsharma
adsharma

πŸ’»
Guilhem C.
Guilhem C.

πŸ“–
Pierre Tardy
Pierre Tardy

πŸ’»
Raphael Nestler
Raphael Nestler

πŸ“–
Pranav V P
Pranav V P

πŸ’»
andreymal
andreymal

πŸ’»
Johann Fuechsl
Johann Fuechsl

πŸ’»
DoeringChristian
DoeringChristian

πŸ’»
Stuart Axelbrooke
Stuart Axelbrooke

πŸ’»
Jakub BerΓ‘nek
Jakub BerΓ‘nek

πŸ’»
Fredrik Reinholdsen
Fredrik Reinholdsen

πŸ’»
+ + Add your contributions + +
+ + + + + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! + +## LICENSE + +This project is licensed under the [MIT license](https://github.com/yukinarit/pyserde/blob/main/LICENSE). + + +%package help +Summary: Development documents and examples for pyserde +Provides: python3-pyserde-doc +%description help +

pyserde

+

Yet another serialization library on top of dataclasses, inspired by serde-rs.

+

+ + pypi + + + pypi + + + GithubActions + + + CodeCov + +

+

+ Guide | API Docs | Examples +

+ +## 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)): + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
yukinarit
yukinarit

πŸ’»
Alexander Miskaryan
Alexander Miskaryan

πŸ’»
ydylla
ydylla

πŸ’»
Kevin Squire
Kevin Squire

πŸ’»
Yushi OMOTE
Yushi OMOTE

πŸ’»
Yuji Kanagawa
Yuji Kanagawa

πŸ’»
Weiliang Li
Weiliang Li

πŸ’»
Mauve
Mauve

πŸ’»
adsharma
adsharma

πŸ’»
Guilhem C.
Guilhem C.

πŸ“–
Pierre Tardy
Pierre Tardy

πŸ’»
Raphael Nestler
Raphael Nestler

πŸ“–
Pranav V P
Pranav V P

πŸ’»
andreymal
andreymal

πŸ’»
Johann Fuechsl
Johann Fuechsl

πŸ’»
DoeringChristian
DoeringChristian

πŸ’»
Stuart Axelbrooke
Stuart Axelbrooke

πŸ’»
Jakub BerΓ‘nek
Jakub BerΓ‘nek

πŸ’»
Fredrik Reinholdsen
Fredrik Reinholdsen

πŸ’»
+ + Add your contributions + +
+ + + + + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! + +## LICENSE + +This project is licensed under the [MIT license](https://github.com/yukinarit/pyserde/blob/main/LICENSE). + + +%prep +%autosetup -n pyserde-0.10.4 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-pyserde -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed Apr 12 2023 Python_Bot - 0.10.4-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..5126d2d --- /dev/null +++ b/sources @@ -0,0 +1 @@ +36f398e03a89e789b378d8224b805935 pyserde-0.10.4.tar.gz -- cgit v1.2.3