Skip to content

Commit c6380e2

Browse files
authored
Merge pull request #1975 from saleweaver/improve_versions
Improve versions, add all clients, automate client creation.
2 parents 6d16695 + 328e1f4 commit c6380e2

File tree

273 files changed

+30960
-16761
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

273 files changed

+30960
-16761
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,5 @@ dmypy.json
141141
cython_debug/
142142

143143
env.env
144+
AGENTS.md
145+
models

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ from sp_api.api import DataKiosk
7070
from sp_api.api import Feeds
7171
from sp_api.base import SellingApiException
7272
from sp_api.base.reportTypes import ReportType
73-
from datetime import datetime, timedelta
73+
from datetime import datetime, timedelta, timezone
7474

7575
# DATA KIOSK API
7676
client = DataKiosk()
@@ -80,7 +80,7 @@ print(res)
8080

8181
# orders API
8282
try:
83-
res = Orders().get_orders(CreatedAfter=(datetime.utcnow() - timedelta(days=7)).isoformat())
83+
res = Orders().get_orders(CreatedAfter=(datetime.now(timezone.utc) - timedelta(days=7)).isoformat())
8484
print(res.payload) # json data
8585
except SellingApiException as ex:
8686
print(ex)
@@ -96,11 +96,11 @@ Feeds().submit_feed(<feed_type>, <file_or_bytes_io>, content_type='text/tsv', **
9696

9797
# PII Data
9898

99-
Orders(restricted_data_token='<token>').get_orders(CreatedAfter=(datetime.utcnow() - timedelta(days=7)).isoformat())
99+
Orders(restricted_data_token='<token>').get_orders(CreatedAfter=(datetime.now(timezone.utc) - timedelta(days=7)).isoformat())
100100

101101
# or use the shortcut
102102
orders = Orders().get_orders(
103-
LastUpdatedAfter=(datetime.utcnow() - timedelta(days=1)).isoformat()
103+
LastUpdatedAfter=(datetime.now(timezone.utc) - timedelta(days=1)).isoformat()
104104
)
105105
```
106106

@@ -110,7 +110,7 @@ orders = Orders().get_orders(
110110

111111
```python
112112
import asyncio
113-
from datetime import datetime, timedelta
113+
from datetime import datetime, timedelta, timezone
114114

115115
from sp_api.asyncio.api import Orders, Reports
116116
from sp_api.base.reportTypes import ReportType
@@ -119,7 +119,7 @@ from sp_api.base.reportTypes import ReportType
119119
async def main():
120120
async with Orders() as orders_client:
121121
res = await orders_client.get_orders(
122-
LastUpdatedAfter=(datetime.utcnow() - timedelta(days=1)).isoformat()
122+
LastUpdatedAfter=(datetime.now(timezone.utc) - timedelta(days=1)).isoformat()
123123
)
124124
print(res.payload)
125125

docs/async.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Basic usage
2121
.. code-block:: python
2222
2323
import asyncio
24-
from datetime import datetime, timedelta
24+
from datetime import datetime, timedelta, timezone
2525
2626
from sp_api.asyncio.api import Orders, Reports
2727
from sp_api.base.reportTypes import ReportType
@@ -30,7 +30,7 @@ Basic usage
3030
async def main():
3131
async with Orders() as orders_client:
3232
res = await orders_client.get_orders(
33-
LastUpdatedAfter=(datetime.utcnow() - timedelta(days=1)).isoformat()
33+
LastUpdatedAfter=(datetime.now(timezone.utc) - timedelta(days=1)).isoformat()
3434
)
3535
print(res.payload)
3636

docs/config_file.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ Usage with default account
5151
5252
.. code-block:: python
5353
54-
Orders().get_orders(CreatedAfter=(datetime.utcnow() - timedelta(days=7)).isoformat())
54+
from datetime import datetime, timedelta, timezone
55+
Orders().get_orders(CreatedAfter=(datetime.now(timezone.utc) - timedelta(days=7)).isoformat())
5556
5657
5758
**************************
@@ -62,15 +63,15 @@ You can use every account's name from the config file for account
6263
6364
.. code-block:: python
6465
65-
Orders(account=another_account).get_orders(CreatedAfter=(datetime.utcnow() - timedelta(days=7)).isoformat())
66+
Orders(account=another_account).get_orders(CreatedAfter=(datetime.now(timezone.utc) - timedelta(days=7)).isoformat())
6667
6768
.. note::
6869
6970
The refresh token can be passed directly to the client, too. You don't need to pass the whole credentials if all that changes is the refresh token.
7071
7172
.. code-block:: python
7273
73-
Orders(account='another_account', refresh_token='<refresh_token_for_this_request>').get_orders(CreatedAfter=(datetime.utcnow() - timedelta(days=7)).isoformat())
74+
Orders(account='another_account', refresh_token='<refresh_token_for_this_request>').get_orders(CreatedAfter=(datetime.now(timezone.utc) - timedelta(days=7)).isoformat())
7475
7576
7677
**********
@@ -81,5 +82,3 @@ References
8182
8283
.. _`credentials.yml`: https://github.com/saleweaver/python-amazon-sp-api/blob/master/credentials.yml
8384
.. _`confused`: https://confuse.readthedocs.io/en/latest/usage.html#search-paths
84-
85-

docs/endpoints.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,19 @@ You can use the playground to test endpoints:
1616
endpoints/catalog
1717
endpoints/catalog_items
1818
endpoints/data_kiosk
19+
endpoints/delivery_by_amazon
1920
endpoints/easy_ship
21+
endpoints/external_fulfillment_inventory
22+
endpoints/external_fulfillment_returns
23+
endpoints/external_fulfillment_shipping
2024
endpoints/fba_inbound_eligibility
2125
endpoints/fba_small_and_light
2226
endpoints/feeds
2327
endpoints/finances
2428
endpoints/fulfillment_inbound
2529
endpoints/fulfillment_outbound
2630
endpoints/inventories
31+
endpoints/invoices
2732
endpoints/listings_items
2833
endpoints/listings_restrictions
2934
endpoints/merchant_fulfillment
@@ -36,9 +41,11 @@ You can use the playground to test endpoints:
3641
endpoints/replenishment
3742
endpoints/reports
3843
endpoints/sales
44+
endpoints/seller_wallet
3945
endpoints/sellers
4046
endpoints/services
4147
endpoints/shipping
48+
endpoints/shipment_invoicing
4249
endpoints/solicitations
4350
endpoints/supply_sources
4451
endpoints/tokens
@@ -47,10 +54,10 @@ You can use the playground to test endpoints:
4754
endpoints/vendor_direct_fulfillment_orders
4855
endpoints/vendor_direct_fulfillment_payments
4956
endpoints/vendor_direct_fulfillment_shipping
57+
endpoints/vendor_direct_fulfillment_sandbox_test_data
5058
endpoints/vendor_direct_fulfillment_transactions
5159
endpoints/vendor_invoices
5260
endpoints/vendor_orders
5361
endpoints/vendor_shipments
5462
endpoints/vendor_transaction_status
55-
56-
63+
endpoints/vehicles

docs/endpoints/awd.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ AmazonWarehousingAndDistribution
22
================================
33

44

5+
.. toctree::
6+
:maxdepth: 1
57

6-
.. autoclass:: sp_api.api.AmazonWarehousingAndDistribution
7-
:members:
8-
:inherited-members:
8+
awd_v2024_05_09

docs/endpoints/awd_v2024_05_09.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
AmazonWarehousingAndDistribution V2024_05_09
2+
============================================
3+
4+
5+
.. autoclass:: sp_api.api.AmazonWarehousingAndDistributionV20240509
6+
:members:
7+
:inherited-members:

docs/endpoints/catalog_items.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@ CatalogItems
22
============
33

44

5-
6-
.. autoclass:: sp_api.api.CatalogItems
5+
.. toctree::
6+
:maxdepth: 1
7+
8+
catalog_items_v2020_12_01
9+
catalog_items_v2022_04_01
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CatalogItems V2020_12_01
2+
========================
3+
4+
5+
.. autoclass:: sp_api.api.CatalogItemsV20201201
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CatalogItems V2022_04_01
2+
========================
3+
4+
5+
.. autoclass:: sp_api.api.CatalogItemsV20220401

0 commit comments

Comments
 (0)