diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-05 15:08:56 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-05 15:08:56 +0000 |
| commit | 6ea2410f27c848dd7b56e51856c730943b4cc323 (patch) | |
| tree | ae007806371f3dd5764281e6395125a48046aa49 | |
| parent | ab7e38d1c0729ff5bc44fd1858025380dfaef1c5 (diff) | |
automatic import of python-amazon-sp-api-clientsopeneuler20.03
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-amazon-sp-api-clients.spec | 438 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 440 insertions, 0 deletions
@@ -0,0 +1 @@ +/amazon-sp-api-clients-1.8.9.tar.gz diff --git a/python-amazon-sp-api-clients.spec b/python-amazon-sp-api-clients.spec new file mode 100644 index 0000000..be75e10 --- /dev/null +++ b/python-amazon-sp-api-clients.spec @@ -0,0 +1,438 @@ +%global _empty_manifest_terminate_build 0 +Name: python-amazon-sp-api-clients +Version: 1.8.9 +Release: 1 +Summary: Amazon selling partner api clients. +License: MIT +URL: https://pypi.org/project/amazon-sp-api-clients/ +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/a1/9b/993e90e94f80ff58462dad1fd6f4af6571ceb1421a8c449a5ac284b07bdf/amazon-sp-api-clients-1.8.9.tar.gz +BuildArch: noarch + +Requires: python3-peewee +Requires: python3-cachetools +Requires: python3-requests +Requires: python3-boto3 +Requires: python3-pycryptodome +Requires: python3-chardet + +%description +# amazon-sp-api-clients + +This is a package generated from amazon selling partner open api models. + +The package is tested in many situations, with fully type hint supported. Enjoy it! + + + + + + + +## Attention + +V1.0.0 changes many api, compared with v0.x.x! + +注意!V1.0.0相较于v0.x.x更改了大量的API! + +## Features + +* ready to use; +* provide code to generate clients, in case that amazon update models; +* type hint; +* orders api, feed api, report api, and all other apis; +* automatically manage tokens. + +## Installation + +```shell +pip install amazon-sp-api-clients +``` + +## Note + +For technical support, please contact [panhaoyu.china@outlook.com](mailto:panhaoyu.china@outlook.com). + +Previously this lib is only open access but not open source, and now it's time to make it public to serve more developers. + +If there's any bug, please fell free to open an issue or send a pr. + +## Usage + +For saving time, I just paste part of my test code here as a demo. + +For better understanding, all the fields are the same length of actual fields, and some readable information are kept. + +```python +from datetime import datetime +import amazon_sp_api_clients +endpoint = "https://sellingpartnerapi-eu.amazon.com" +marketplace_id = "XXXXXXXXXXXXXX" +refresh_token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +role_arn = "arn:aws:iam::123456789012:role/xxxxxx" +aws_access_key = 'XXXXXXXXXXXXXXXXXXXX' +aws_secret_key = "XXXXX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +client_id = 'amzn1.application-oa2-client.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +client_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +client_config = dict( + role_arn=role_arn, + endpoint=endpoint, + marketplace_id=marketplace_id, + refresh_token=refresh_token, + aws_access_key=aws_access_key, + aws_secret_key=aws_secret_key, + lwa_client_key=client_id, + lwa_client_secret=client_secret, +) +clients = amazon_sp_api_clients.AmazonSpApiClients(**client_config) +orders = clients.orders_v0.getOrders( + MarketplaceIds=[marketplace_id], + CreatedAfter=datetime(2000, 1, 1).isoformat() +).payload.Orders +for order in orders: + print(order.AmazonOrderId, order.LastUpdateDate) +``` + +## Configuration + +The client configuration can be set both at the initiation and as environment variables. + +* SP_API_ROLE_ARN +* SP_API_ENDPOINT +* SP_API_REGION +* SP_API_MARKETPLACE_ID +* SP_API_REFRESH_TOKEN +* SP_API_AWS_ACCESS_KEY +* SP_API_AWS_SECRET_KEY +* SP_API_LWA_CLIENT_KEY +* SP_API_LWA_CLIENT_SECRET + +## Build + +The client is generated in the following steps: + +1. download amazon open api repository; +1. copy open api 2 json files from the amazon repository to a single directory; +1. convert open api 2 json files to open api 3 json files; +1. convert open api 3 json files to py clients. + +The main script of generation is the `test_main` python file. + +When convert open api to py clients, I separated the process into 6 steps, which are defined in +the `swager_client_generator.stages` module. + +If my build is not suitable for your demand, or amazon api model updates but my build do not follow, you can clone this +repo, modify the `api.pyt` template and build it by yourself, and please push a PR, thanks! + +# Acknowledgement + +The auth method is partially from +[python-amazon-sp-api](https://github.com/saleweaver/python-amazon-sp-api). + +# Note + +If this library helps you, please give me a star, thanks! + +如果这个库对您有用,请为我点亮Star,谢谢! + + +%package -n python3-amazon-sp-api-clients +Summary: Amazon selling partner api clients. +Provides: python-amazon-sp-api-clients +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-amazon-sp-api-clients +# amazon-sp-api-clients + +This is a package generated from amazon selling partner open api models. + +The package is tested in many situations, with fully type hint supported. Enjoy it! + + + + + + + +## Attention + +V1.0.0 changes many api, compared with v0.x.x! + +注意!V1.0.0相较于v0.x.x更改了大量的API! + +## Features + +* ready to use; +* provide code to generate clients, in case that amazon update models; +* type hint; +* orders api, feed api, report api, and all other apis; +* automatically manage tokens. + +## Installation + +```shell +pip install amazon-sp-api-clients +``` + +## Note + +For technical support, please contact [panhaoyu.china@outlook.com](mailto:panhaoyu.china@outlook.com). + +Previously this lib is only open access but not open source, and now it's time to make it public to serve more developers. + +If there's any bug, please fell free to open an issue or send a pr. + +## Usage + +For saving time, I just paste part of my test code here as a demo. + +For better understanding, all the fields are the same length of actual fields, and some readable information are kept. + +```python +from datetime import datetime +import amazon_sp_api_clients +endpoint = "https://sellingpartnerapi-eu.amazon.com" +marketplace_id = "XXXXXXXXXXXXXX" +refresh_token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +role_arn = "arn:aws:iam::123456789012:role/xxxxxx" +aws_access_key = 'XXXXXXXXXXXXXXXXXXXX' +aws_secret_key = "XXXXX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +client_id = 'amzn1.application-oa2-client.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +client_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +client_config = dict( + role_arn=role_arn, + endpoint=endpoint, + marketplace_id=marketplace_id, + refresh_token=refresh_token, + aws_access_key=aws_access_key, + aws_secret_key=aws_secret_key, + lwa_client_key=client_id, + lwa_client_secret=client_secret, +) +clients = amazon_sp_api_clients.AmazonSpApiClients(**client_config) +orders = clients.orders_v0.getOrders( + MarketplaceIds=[marketplace_id], + CreatedAfter=datetime(2000, 1, 1).isoformat() +).payload.Orders +for order in orders: + print(order.AmazonOrderId, order.LastUpdateDate) +``` + +## Configuration + +The client configuration can be set both at the initiation and as environment variables. + +* SP_API_ROLE_ARN +* SP_API_ENDPOINT +* SP_API_REGION +* SP_API_MARKETPLACE_ID +* SP_API_REFRESH_TOKEN +* SP_API_AWS_ACCESS_KEY +* SP_API_AWS_SECRET_KEY +* SP_API_LWA_CLIENT_KEY +* SP_API_LWA_CLIENT_SECRET + +## Build + +The client is generated in the following steps: + +1. download amazon open api repository; +1. copy open api 2 json files from the amazon repository to a single directory; +1. convert open api 2 json files to open api 3 json files; +1. convert open api 3 json files to py clients. + +The main script of generation is the `test_main` python file. + +When convert open api to py clients, I separated the process into 6 steps, which are defined in +the `swager_client_generator.stages` module. + +If my build is not suitable for your demand, or amazon api model updates but my build do not follow, you can clone this +repo, modify the `api.pyt` template and build it by yourself, and please push a PR, thanks! + +# Acknowledgement + +The auth method is partially from +[python-amazon-sp-api](https://github.com/saleweaver/python-amazon-sp-api). + +# Note + +If this library helps you, please give me a star, thanks! + +如果这个库对您有用,请为我点亮Star,谢谢! + + +%package help +Summary: Development documents and examples for amazon-sp-api-clients +Provides: python3-amazon-sp-api-clients-doc +%description help +# amazon-sp-api-clients + +This is a package generated from amazon selling partner open api models. + +The package is tested in many situations, with fully type hint supported. Enjoy it! + + + + + + + +## Attention + +V1.0.0 changes many api, compared with v0.x.x! + +注意!V1.0.0相较于v0.x.x更改了大量的API! + +## Features + +* ready to use; +* provide code to generate clients, in case that amazon update models; +* type hint; +* orders api, feed api, report api, and all other apis; +* automatically manage tokens. + +## Installation + +```shell +pip install amazon-sp-api-clients +``` + +## Note + +For technical support, please contact [panhaoyu.china@outlook.com](mailto:panhaoyu.china@outlook.com). + +Previously this lib is only open access but not open source, and now it's time to make it public to serve more developers. + +If there's any bug, please fell free to open an issue or send a pr. + +## Usage + +For saving time, I just paste part of my test code here as a demo. + +For better understanding, all the fields are the same length of actual fields, and some readable information are kept. + +```python +from datetime import datetime +import amazon_sp_api_clients +endpoint = "https://sellingpartnerapi-eu.amazon.com" +marketplace_id = "XXXXXXXXXXXXXX" +refresh_token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +role_arn = "arn:aws:iam::123456789012:role/xxxxxx" +aws_access_key = 'XXXXXXXXXXXXXXXXXXXX' +aws_secret_key = "XXXXX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +client_id = 'amzn1.application-oa2-client.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +client_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +client_config = dict( + role_arn=role_arn, + endpoint=endpoint, + marketplace_id=marketplace_id, + refresh_token=refresh_token, + aws_access_key=aws_access_key, + aws_secret_key=aws_secret_key, + lwa_client_key=client_id, + lwa_client_secret=client_secret, +) +clients = amazon_sp_api_clients.AmazonSpApiClients(**client_config) +orders = clients.orders_v0.getOrders( + MarketplaceIds=[marketplace_id], + CreatedAfter=datetime(2000, 1, 1).isoformat() +).payload.Orders +for order in orders: + print(order.AmazonOrderId, order.LastUpdateDate) +``` + +## Configuration + +The client configuration can be set both at the initiation and as environment variables. + +* SP_API_ROLE_ARN +* SP_API_ENDPOINT +* SP_API_REGION +* SP_API_MARKETPLACE_ID +* SP_API_REFRESH_TOKEN +* SP_API_AWS_ACCESS_KEY +* SP_API_AWS_SECRET_KEY +* SP_API_LWA_CLIENT_KEY +* SP_API_LWA_CLIENT_SECRET + +## Build + +The client is generated in the following steps: + +1. download amazon open api repository; +1. copy open api 2 json files from the amazon repository to a single directory; +1. convert open api 2 json files to open api 3 json files; +1. convert open api 3 json files to py clients. + +The main script of generation is the `test_main` python file. + +When convert open api to py clients, I separated the process into 6 steps, which are defined in +the `swager_client_generator.stages` module. + +If my build is not suitable for your demand, or amazon api model updates but my build do not follow, you can clone this +repo, modify the `api.pyt` template and build it by yourself, and please push a PR, thanks! + +# Acknowledgement + +The auth method is partially from +[python-amazon-sp-api](https://github.com/saleweaver/python-amazon-sp-api). + +# Note + +If this library helps you, please give me a star, thanks! + +如果这个库对您有用,请为我点亮Star,谢谢! + + +%prep +%autosetup -n amazon-sp-api-clients-1.8.9 + +%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-amazon-sp-api-clients -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 1.8.9-1 +- Package Spec generated @@ -0,0 +1 @@ +97355650a74770a367e70e14ab2613b3 amazon-sp-api-clients-1.8.9.tar.gz |
