python-amazon-ad-api 0.6.2__tar.gz → 0.6.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. {python_amazon_ad_api-0.6.2/python_amazon_ad_api.egg-info → python_amazon_ad_api-0.6.4}/PKG-INFO +93 -32
  2. python_amazon_ad_api-0.6.2/PKG-INFO → python_amazon_ad_api-0.6.4/README.md +81 -48
  3. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/__init__.py +1 -0
  4. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/portfolios.py +6 -0
  5. python_amazon_ad_api-0.6.4/ad_api/api/portfolios_v3.py +68 -0
  6. python_amazon_ad_api-0.6.4/ad_api/version.py +1 -0
  7. python_amazon_ad_api-0.6.2/README.md → python_amazon_ad_api-0.6.4/python_amazon_ad_api.egg-info/PKG-INFO +109 -27
  8. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/python_amazon_ad_api.egg-info/SOURCES.txt +1 -0
  9. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/python_amazon_ad_api.egg-info/requires.txt +3 -3
  10. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/setup.cfg +1 -1
  11. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/setup.py +4 -4
  12. python_amazon_ad_api-0.6.2/ad_api/version.py +0 -1
  13. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/LICENSE +0 -0
  14. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/__init__.py +0 -0
  15. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/account.py +0 -0
  16. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/advertising_test_account.py +0 -0
  17. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/attribution.py +0 -0
  18. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/audiences.py +0 -0
  19. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/billing.py +0 -0
  20. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/brand_metrics.py +0 -0
  21. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/creative_assets.py +0 -0
  22. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/dsp/__init__.py +0 -0
  23. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/dsp/access_token_client.py +0 -0
  24. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/dsp/client.py +0 -0
  25. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/dsp/credential_provider.py +0 -0
  26. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/dsp/reports.py +0 -0
  27. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/eligibility.py +0 -0
  28. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/exports.py +0 -0
  29. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/history.py +0 -0
  30. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/insights.py +0 -0
  31. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/invoices.py +0 -0
  32. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/localization.py +0 -0
  33. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/manager_accounts.py +0 -0
  34. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/metadata.py +0 -0
  35. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/profiles.py +0 -0
  36. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/recommendations.py +0 -0
  37. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/reports.py +0 -0
  38. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/__init__.py +0 -0
  39. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/ad_creatives_v4.py +0 -0
  40. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/ad_groups.py +0 -0
  41. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/ad_groups_v4.py +0 -0
  42. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/ads_v4.py +0 -0
  43. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/benchmarks.py +0 -0
  44. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/bid_recommendations.py +0 -0
  45. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/brands.py +0 -0
  46. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/campaigns.py +0 -0
  47. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/campaigns_v4.py +0 -0
  48. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/forecast.py +0 -0
  49. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/keywords.py +0 -0
  50. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/keywords_recommendations.py +0 -0
  51. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/landing_page_asins.py +0 -0
  52. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/media.py +0 -0
  53. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/moderation.py +0 -0
  54. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/negative_keywords.py +0 -0
  55. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/negative_product_targeting.py +0 -0
  56. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/product_targeting.py +0 -0
  57. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/recommendations.py +0 -0
  58. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/reports.py +0 -0
  59. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/snapshots.py +0 -0
  60. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/stores.py +0 -0
  61. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/targeting_recommendations.py +0 -0
  62. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/__init__.py +0 -0
  63. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/ad_groups.py +0 -0
  64. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/bid_recommendations.py +0 -0
  65. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/brand_safety.py +0 -0
  66. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/budget_rules.py +0 -0
  67. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/campaigns.py +0 -0
  68. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/campaigns_budget_usage.py +0 -0
  69. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/creatives.py +0 -0
  70. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/forecast.py +0 -0
  71. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/negative_product_targeting.py +0 -0
  72. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/product_ads.py +0 -0
  73. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/product_targeting.py +0 -0
  74. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/recommendations.py +0 -0
  75. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/reports.py +0 -0
  76. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/snapshots.py +0 -0
  77. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/targeting_recommendations.py +0 -0
  78. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/__init__.py +0 -0
  79. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/ad_groups.py +0 -0
  80. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/ad_groups_v3.py +0 -0
  81. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/bid_recommendations.py +0 -0
  82. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/bid_recommendations_v3.py +0 -0
  83. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/budget_initial_recommendation.py +0 -0
  84. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/budget_recommendations.py +0 -0
  85. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/budget_rules.py +0 -0
  86. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/budget_rules_recommendations.py +0 -0
  87. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaign_consolidated_recommendations.py +0 -0
  88. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaign_negative_keywords.py +0 -0
  89. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaign_negative_keywords_v3.py +0 -0
  90. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaign_negative_targets.py +0 -0
  91. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaigns.py +0 -0
  92. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaigns_budget_usage.py +0 -0
  93. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaigns_v3.py +0 -0
  94. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaings_optimization.py +0 -0
  95. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/keywords.py +0 -0
  96. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/keywords_v3.py +0 -0
  97. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/negative_keywords.py +0 -0
  98. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/negative_keywords_v3.py +0 -0
  99. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/negative_product_targeting.py +0 -0
  100. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/negative_product_targeting_v3.py +0 -0
  101. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/product_ads.py +0 -0
  102. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/product_ads_v3.py +0 -0
  103. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/product_recommendations.py +0 -0
  104. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/product_targeting.py +0 -0
  105. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/product_targeting_v3.py +0 -0
  106. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/ranked_keywords_recommendations.py +0 -0
  107. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/reports.py +0 -0
  108. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/schedule_based_bid_optimization.py +0 -0
  109. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/snapshots.py +0 -0
  110. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/suggested_keywords.py +0 -0
  111. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/stores.py +0 -0
  112. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/stream.py +0 -0
  113. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/api/validation_configurations.py +0 -0
  114. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/auth/__init__.py +0 -0
  115. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/auth/access_token_client.py +0 -0
  116. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/auth/access_token_response.py +0 -0
  117. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/auth/credentials.py +0 -0
  118. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/auth/exceptions.py +0 -0
  119. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/base/__init__.py +0 -0
  120. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/base/api_response.py +0 -0
  121. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/base/base_client.py +0 -0
  122. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/base/client.py +0 -0
  123. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/base/config.py +0 -0
  124. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/base/credential_provider.py +0 -0
  125. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/base/exceptions.py +0 -0
  126. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/base/helpers.py +0 -0
  127. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/base/marketplaces.py +0 -0
  128. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/ad_api/base/utils.py +0 -0
  129. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/pyproject.toml +0 -0
  130. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/python_amazon_ad_api.egg-info/dependency_links.txt +0 -0
  131. {python_amazon_ad_api-0.6.2 → python_amazon_ad_api-0.6.4}/python_amazon_ad_api.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: python-amazon-ad-api
3
- Version: 0.6.2
3
+ Version: 0.6.4
4
4
  Summary: Python wrapper for the Amazon Advertising API
5
5
  Home-page: https://github.com/denisneuf/python-amazon-ad-api
6
6
  Author: Daniel Alvaro
@@ -13,11 +13,18 @@ Classifier: Operating System :: OS Independent
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: requests<2.33.0,>=2.27.1
16
- Requires-Dist: six~=1.16.0
16
+ Requires-Dist: six<1.18,>=1.16
17
17
  Requires-Dist: cachetools<5.6,>=5.0
18
- Requires-Dist: pycryptodome<3.22,>=3.13
19
- Requires-Dist: pytz<2025.0,>=2021.3
18
+ Requires-Dist: pycryptodome<3.23,>=3.13
19
+ Requires-Dist: pytz<2026.0,>=2021.3
20
20
  Requires-Dist: confuse<2.1,>=1.7
21
+ Dynamic: author
22
+ Dynamic: author-email
23
+ Dynamic: home-page
24
+ Dynamic: license
25
+ Dynamic: license-file
26
+ Dynamic: requires-dist
27
+ Dynamic: summary
21
28
 
22
29
  # PYTHON-AMAZON-AD-API
23
30
 
@@ -25,7 +32,9 @@ Requires-Dist: confuse<2.1,>=1.7
25
32
  ![CodeQL](https://img.shields.io/badge/Docs-sphinx-green)
26
33
  ![CodeQL](https://img.shields.io/github/v/release/denisneuf/python-amazon-ad-api)
27
34
  [![Documentation Status](https://readthedocs.org/projects/python-amazon-ad-api/badge/?version=latest)](https://python-amazon-ad-api.readthedocs.io/en/latest/?badge=latest)
28
-
35
+ ![PyPI Downloads](https://static.pepy.tech/badge/python-amazon-ad-api)
36
+ [![Downloads](https://static.pepy.tech/badge/python-amazon-ad-api/month)](https://pepy.tech/project/python-amazon-ad-api)
37
+ [![Downloads](https://static.pepy.tech/badge/python-amazon-ad-api/week)](https://pepy.tech/project/python-amazon-ad-api)
29
38
 
30
39
  ## Amazon's Advertising API
31
40
 
@@ -67,7 +76,19 @@ my_credentials = dict(
67
76
  profile_id='your-profile_id',
68
77
  )
69
78
 
70
- result=sponsored_products.Campaigns(credentials=my_credentials).list_campaigns()
79
+ info = \
80
+ {
81
+ "stateFilter":
82
+ {
83
+ "include": [
84
+ "ENABLED"
85
+ ]
86
+ }
87
+ }
88
+
89
+ result = sponsored_products.CampaignsV3(credentials=my_credentials).list_campaigns(
90
+ body=info
91
+ )
71
92
 
72
93
  ```
73
94
 
@@ -99,9 +120,9 @@ Python code
99
120
  from ad_api.api import sponsored_products
100
121
 
101
122
  # Leave empty will use the 'default' account
102
- result=sponsored_products.Campaigns().list_campaigns()
123
+ result=sponsored_products.CampaignsV3().list_campaigns()
103
124
  # will use germany account data
104
- result=sponsored_products.Campaigns(account="germany").list_campaigns()
125
+ result=sponsored_products.CampaignsV3(account="germany").list_campaigns()
105
126
  ```
106
127
 
107
128
 
@@ -125,7 +146,7 @@ from ad_api.api import sponsored_products
125
146
  from ad_api.base import Marketplaces
126
147
 
127
148
  # You can pass NA or US, CA, MX or BR for North America and JP, AU or SG for Far East
128
- result=sponsored_products.Campaigns(marketplace=Marketplaces.NA).list_campaigns()
149
+ result=sponsored_products.CampaignsV3(marketplace=Marketplaces.NA).list_campaigns()
129
150
 
130
151
  ```
131
152
 
@@ -137,10 +158,20 @@ You can use a [try](https://docs.python.org/3.10/reference/compound_stmts.html#t
137
158
  from ad_api.api import sponsored_products
138
159
  from ad_api.base import AdvertisingApiException
139
160
 
161
+ info = \
162
+ {
163
+ "stateFilter":
164
+ {
165
+ "include": [
166
+ "ENABLED"
167
+ ]
168
+ }
169
+ }
170
+
140
171
  try:
141
172
 
142
- result = sponsored_products.Campaigns().get_campaign_extended(
143
- campaignId=campaign_id
173
+ result = sponsored_products.CampaignsV3().list_campaigns(
174
+ body=info
144
175
  )
145
176
 
146
177
  logging.info(result)
@@ -157,10 +188,21 @@ Use debug=True if you want see some logs like the header you submit to the api e
157
188
  from ad_api.api import sponsored_products
158
189
  from ad_api.base import AdvertisingApiException
159
190
 
191
+
192
+ info = \
193
+ {
194
+ "stateFilter":
195
+ {
196
+ "include": [
197
+ "ENABLED"
198
+ ]
199
+ }
200
+ }
201
+
160
202
  try:
161
203
 
162
- result = sponsored_products.Campaigns(debug=True).get_campaign_extended(
163
- campaignId=campaign_id
204
+ result = sponsored_products.CampaignsV3(debug=True).list_campaigns(
205
+ body=info
164
206
  )
165
207
 
166
208
  logging.info(result)
@@ -220,7 +262,12 @@ curl \
220
262
 
221
263
  * [Profiles](https://python-amazon-ad-api.readthedocs.io/en/latest/api/profiles.html)
222
264
  * [Manager Accounts](https://python-amazon-ad-api.readthedocs.io/en/latest/api/manager_accounts.html)
265
+
266
+ Warning: [PLANNED DEPRECATION 1/3/2025]
267
+ There is a new version 3 Portfolios API, please check the [migration guide](https://advertising.amazon.com/API/docs/en-us/reference/migration-guides/portfolios-v2-v3).
268
+
223
269
  * [Portfolios](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfolios.html)
270
+ * [PortfoliosV3](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfoliosV3.html)
224
271
  * [Invoices](https://python-amazon-ad-api.readthedocs.io/en/latest/api/invoices.html)
225
272
  * [Billing](https://python-amazon-ad-api.readthedocs.io/en/latest/api/billing.html)
226
273
  * [Audiences](https://python-amazon-ad-api.readthedocs.io/en/latest/api/audiences.html)
@@ -332,38 +379,52 @@ There is a new version 3 of Sponsored Product API, please check the [migration g
332
379
  ```python
333
380
  import logging
334
381
  from ad_api.base import AdvertisingApiException
335
- from ad_api.api.sp import Campaigns
382
+ from ad_api.api import sponsored_products
336
383
 
337
384
  logging.basicConfig(
338
385
  level=logging.DEBUG,
339
386
  format="%(asctime)s:%(levelname)s:%(message)s"
340
387
  )
341
388
 
389
+ def sp_list_campaigns_v3(info: dict = None):
342
390
 
343
- credentials = dict(
344
- refresh_token='your-refresh_token',
345
- client_id='your-client_id',
346
- client_secret='your-client_secret',
347
- profile_id='your-profile_id',
348
- )
391
+ credentials = dict(
392
+ refresh_token='your-refresh_token',
393
+ client_id='your-client_id',
394
+ client_secret='your-client_secret',
395
+ profile_id='your-profile_id',
396
+ )
349
397
 
350
- try:
398
+ try:
399
+ result = sponsored_products.CampaignsV3(credentials=credentials, debug=True).list_campaigns(
400
+ body=info
401
+ )
402
+ payload = result.payload
403
+ return payload
404
+ except AdvertisingApiException as error:
405
+ logging.error(error)
406
+ logging.error(error.code)
351
407
 
352
- states = 'enabled'
353
408
 
354
- res = Campaigns(credentials=credentials, debug=True).list_campaigns_extended(
355
- stateFilter=states
356
- )
409
+ state_filter = \
410
+ {
411
+ "stateFilter":
412
+ {
413
+ "include": [
414
+ "ENABLED"
415
+ ]
416
+ }
417
+ }
357
418
 
358
- campaigns = res.payload
359
- for campaign in campaigns:
360
- logging.info(campaign)
419
+ enabled_campaigns = sp_list_campaigns_v3(state_filter).get("campaigns")
361
420
 
362
- logging.info(len(campaigns))
421
+
422
+ for campaign in enabled_campaigns:
423
+ logging.info(campaign)
424
+
425
+ logging.info(len(campaigns))
363
426
 
364
427
 
365
- except AdvertisingApiException as error:
366
- logging.info(error)
367
428
 
368
429
  ```
369
430
 
@@ -1,31 +1,12 @@
1
- Metadata-Version: 2.1
2
- Name: python-amazon-ad-api
3
- Version: 0.6.2
4
- Summary: Python wrapper for the Amazon Advertising API
5
- Home-page: https://github.com/denisneuf/python-amazon-ad-api
6
- Author: Daniel Alvaro
7
- Author-email: denisneuf@hotmail.com
8
- License: MIT
9
- Project-URL: Bug Tracker, https://github.com/denisneuf/python-amazon-ad-api/issues
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: License :: OSI Approved :: MIT License
12
- Classifier: Operating System :: OS Independent
13
- Description-Content-Type: text/markdown
14
- License-File: LICENSE
15
- Requires-Dist: requests<2.33.0,>=2.27.1
16
- Requires-Dist: six~=1.16.0
17
- Requires-Dist: cachetools<5.6,>=5.0
18
- Requires-Dist: pycryptodome<3.22,>=3.13
19
- Requires-Dist: pytz<2025.0,>=2021.3
20
- Requires-Dist: confuse<2.1,>=1.7
21
-
22
1
  # PYTHON-AMAZON-AD-API
23
2
 
24
3
  ![CodeQL](https://img.shields.io/badge/coverage-95%25-green)
25
4
  ![CodeQL](https://img.shields.io/badge/Docs-sphinx-green)
26
5
  ![CodeQL](https://img.shields.io/github/v/release/denisneuf/python-amazon-ad-api)
27
6
  [![Documentation Status](https://readthedocs.org/projects/python-amazon-ad-api/badge/?version=latest)](https://python-amazon-ad-api.readthedocs.io/en/latest/?badge=latest)
28
-
7
+ ![PyPI Downloads](https://static.pepy.tech/badge/python-amazon-ad-api)
8
+ [![Downloads](https://static.pepy.tech/badge/python-amazon-ad-api/month)](https://pepy.tech/project/python-amazon-ad-api)
9
+ [![Downloads](https://static.pepy.tech/badge/python-amazon-ad-api/week)](https://pepy.tech/project/python-amazon-ad-api)
29
10
 
30
11
  ## Amazon's Advertising API
31
12
 
@@ -67,7 +48,19 @@ my_credentials = dict(
67
48
  profile_id='your-profile_id',
68
49
  )
69
50
 
70
- result=sponsored_products.Campaigns(credentials=my_credentials).list_campaigns()
51
+ info = \
52
+ {
53
+ "stateFilter":
54
+ {
55
+ "include": [
56
+ "ENABLED"
57
+ ]
58
+ }
59
+ }
60
+
61
+ result = sponsored_products.CampaignsV3(credentials=my_credentials).list_campaigns(
62
+ body=info
63
+ )
71
64
 
72
65
  ```
73
66
 
@@ -99,9 +92,9 @@ Python code
99
92
  from ad_api.api import sponsored_products
100
93
 
101
94
  # Leave empty will use the 'default' account
102
- result=sponsored_products.Campaigns().list_campaigns()
95
+ result=sponsored_products.CampaignsV3().list_campaigns()
103
96
  # will use germany account data
104
- result=sponsored_products.Campaigns(account="germany").list_campaigns()
97
+ result=sponsored_products.CampaignsV3(account="germany").list_campaigns()
105
98
  ```
106
99
 
107
100
 
@@ -125,7 +118,7 @@ from ad_api.api import sponsored_products
125
118
  from ad_api.base import Marketplaces
126
119
 
127
120
  # You can pass NA or US, CA, MX or BR for North America and JP, AU or SG for Far East
128
- result=sponsored_products.Campaigns(marketplace=Marketplaces.NA).list_campaigns()
121
+ result=sponsored_products.CampaignsV3(marketplace=Marketplaces.NA).list_campaigns()
129
122
 
130
123
  ```
131
124
 
@@ -137,10 +130,20 @@ You can use a [try](https://docs.python.org/3.10/reference/compound_stmts.html#t
137
130
  from ad_api.api import sponsored_products
138
131
  from ad_api.base import AdvertisingApiException
139
132
 
133
+ info = \
134
+ {
135
+ "stateFilter":
136
+ {
137
+ "include": [
138
+ "ENABLED"
139
+ ]
140
+ }
141
+ }
142
+
140
143
  try:
141
144
 
142
- result = sponsored_products.Campaigns().get_campaign_extended(
143
- campaignId=campaign_id
145
+ result = sponsored_products.CampaignsV3().list_campaigns(
146
+ body=info
144
147
  )
145
148
 
146
149
  logging.info(result)
@@ -157,10 +160,21 @@ Use debug=True if you want see some logs like the header you submit to the api e
157
160
  from ad_api.api import sponsored_products
158
161
  from ad_api.base import AdvertisingApiException
159
162
 
163
+
164
+ info = \
165
+ {
166
+ "stateFilter":
167
+ {
168
+ "include": [
169
+ "ENABLED"
170
+ ]
171
+ }
172
+ }
173
+
160
174
  try:
161
175
 
162
- result = sponsored_products.Campaigns(debug=True).get_campaign_extended(
163
- campaignId=campaign_id
176
+ result = sponsored_products.CampaignsV3(debug=True).list_campaigns(
177
+ body=info
164
178
  )
165
179
 
166
180
  logging.info(result)
@@ -220,7 +234,12 @@ curl \
220
234
 
221
235
  * [Profiles](https://python-amazon-ad-api.readthedocs.io/en/latest/api/profiles.html)
222
236
  * [Manager Accounts](https://python-amazon-ad-api.readthedocs.io/en/latest/api/manager_accounts.html)
237
+
238
+ Warning: [PLANNED DEPRECATION 1/3/2025]
239
+ There is a new version 3 Portfolios API, please check the [migration guide](https://advertising.amazon.com/API/docs/en-us/reference/migration-guides/portfolios-v2-v3).
240
+
223
241
  * [Portfolios](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfolios.html)
242
+ * [PortfoliosV3](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfoliosV3.html)
224
243
  * [Invoices](https://python-amazon-ad-api.readthedocs.io/en/latest/api/invoices.html)
225
244
  * [Billing](https://python-amazon-ad-api.readthedocs.io/en/latest/api/billing.html)
226
245
  * [Audiences](https://python-amazon-ad-api.readthedocs.io/en/latest/api/audiences.html)
@@ -332,38 +351,52 @@ There is a new version 3 of Sponsored Product API, please check the [migration g
332
351
  ```python
333
352
  import logging
334
353
  from ad_api.base import AdvertisingApiException
335
- from ad_api.api.sp import Campaigns
354
+ from ad_api.api import sponsored_products
336
355
 
337
356
  logging.basicConfig(
338
357
  level=logging.DEBUG,
339
358
  format="%(asctime)s:%(levelname)s:%(message)s"
340
359
  )
341
360
 
361
+ def sp_list_campaigns_v3(info: dict = None):
342
362
 
343
- credentials = dict(
344
- refresh_token='your-refresh_token',
345
- client_id='your-client_id',
346
- client_secret='your-client_secret',
347
- profile_id='your-profile_id',
348
- )
363
+ credentials = dict(
364
+ refresh_token='your-refresh_token',
365
+ client_id='your-client_id',
366
+ client_secret='your-client_secret',
367
+ profile_id='your-profile_id',
368
+ )
349
369
 
350
- try:
370
+ try:
371
+ result = sponsored_products.CampaignsV3(credentials=credentials, debug=True).list_campaigns(
372
+ body=info
373
+ )
374
+ payload = result.payload
375
+ return payload
376
+ except AdvertisingApiException as error:
377
+ logging.error(error)
378
+ logging.error(error.code)
351
379
 
352
- states = 'enabled'
353
380
 
354
- res = Campaigns(credentials=credentials, debug=True).list_campaigns_extended(
355
- stateFilter=states
356
- )
381
+ state_filter = \
382
+ {
383
+ "stateFilter":
384
+ {
385
+ "include": [
386
+ "ENABLED"
387
+ ]
388
+ }
389
+ }
357
390
 
358
- campaigns = res.payload
359
- for campaign in campaigns:
360
- logging.info(campaign)
391
+ enabled_campaigns = sp_list_campaigns_v3(state_filter).get("campaigns")
361
392
 
362
- logging.info(len(campaigns))
393
+
394
+ for campaign in enabled_campaigns:
395
+ logging.info(campaign)
396
+
397
+ logging.info(len(campaigns))
363
398
 
364
399
 
365
- except AdvertisingApiException as error:
366
- logging.info(error)
367
400
 
368
401
  ```
369
402
 
@@ -10,6 +10,7 @@ from .creative_assets import CreativeAssets
10
10
  from .localization import Localization
11
11
  from .audiences import Audiences
12
12
  from .portfolios import Portfolios
13
+ from .portfolios_v3 import PortfoliosV3
13
14
  from .insights import Insights
14
15
  from . import sp as sponsored_products
15
16
  from . import sb as sponsored_brands
@@ -5,6 +5,7 @@ class Portfolios(Client):
5
5
  """ """
6
6
 
7
7
  @sp_endpoint('/v2/portfolios', method='GET')
8
+ @Utils.deprecated
8
9
  def list_portfolios(self, **kwargs) -> ApiResponse:
9
10
  r"""
10
11
 
@@ -27,6 +28,7 @@ class Portfolios(Client):
27
28
  return self._request(kwargs.pop('path'), params=kwargs)
28
29
 
29
30
  @sp_endpoint('/v2/portfolios/extended', method='GET')
31
+ @Utils.deprecated
30
32
  def list_portfolios_extended(self, **kwargs) -> ApiResponse:
31
33
  r"""
32
34
  list_portfolios_extended(**kwargs) -> ApiResponse
@@ -47,6 +49,7 @@ class Portfolios(Client):
47
49
  return self._request(kwargs.pop('path'), params=kwargs)
48
50
 
49
51
  @sp_endpoint('/v2/portfolios/{}', method='GET')
52
+ @Utils.deprecated
50
53
  def get_portfolio(self, portfolioId, **kwargs) -> ApiResponse:
51
54
  r"""
52
55
  get_portfolio(portfolioId) -> ApiResponse
@@ -59,6 +62,7 @@ class Portfolios(Client):
59
62
  return self._request(fill_query_params(kwargs.pop('path'), portfolioId), params=kwargs)
60
63
 
61
64
  @sp_endpoint('/v2/portfolios/extended/{}', method='GET')
65
+ @Utils.deprecated
62
66
  def get_portfolio_extended(self, portfolioId, **kwargs) -> ApiResponse:
63
67
  r"""
64
68
  get_portfolio_extended(portfolioId) -> ApiResponse
@@ -71,6 +75,7 @@ class Portfolios(Client):
71
75
  return self._request(fill_query_params(kwargs.pop('path'), portfolioId), params=kwargs)
72
76
 
73
77
  @sp_endpoint('/v2/portfolios', method='POST')
78
+ @Utils.deprecated
74
79
  def create_portfolios(self, **kwargs) -> ApiResponse:
75
80
  r"""
76
81
 
@@ -98,6 +103,7 @@ class Portfolios(Client):
98
103
  return self._request(kwargs.pop('path'), data=body, params=kwargs)
99
104
 
100
105
  @sp_endpoint('/v2/portfolios', method='PUT')
106
+ @Utils.deprecated
101
107
  def edit_portfolios(self, **kwargs) -> ApiResponse:
102
108
  r"""
103
109
 
@@ -0,0 +1,68 @@
1
+ from ad_api.base import Client, sp_endpoint, ApiResponse, Utils
2
+
3
+
4
+ class PortfoliosV3(Client):
5
+ """ """
6
+
7
+ @sp_endpoint('/portfolios/list', method='POST')
8
+ def list_portfolios(self, version: int = 3, prefer: bool = False, **kwargs) -> ApiResponse:
9
+ r"""
10
+
11
+ list_portfolios(body: (str, dict)) -> ApiResponse
12
+
13
+ """
14
+
15
+ schema_version = 'application/vnd.spPortfolio.v' + str(version) + '+json'
16
+ headers = {"Accept": schema_version, "Content-Type": schema_version}
17
+ prefer_value = 'return=representation'
18
+ if prefer:
19
+ headers.update({"Prefer": prefer_value})
20
+
21
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
22
+
23
+
24
+
25
+ @sp_endpoint('/portfolios', method='POST')
26
+ def create_portfolios(self, version: int = 3, prefer: bool = False, **kwargs) -> ApiResponse:
27
+ r"""
28
+
29
+ create_portfolios(body: (str, dict)) -> ApiResponse
30
+
31
+
32
+ """
33
+ schema_version = 'application/vnd.spPortfolio.v' + str(version) + '+json'
34
+ headers = {"Accept": schema_version, "Content-Type": schema_version}
35
+ prefer_value = 'return=representation'
36
+ if prefer:
37
+ headers.update({"Prefer": prefer_value})
38
+
39
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
40
+
41
+ @sp_endpoint('/portfolios', method='PUT')
42
+ def edit_portfolios(self, version: int = 3, prefer: bool = False, **kwargs) -> ApiResponse:
43
+ r"""
44
+
45
+ edit_portfolios(body: (str, dict)) -> ApiResponse
46
+
47
+
48
+ """
49
+ schema_version = 'application/vnd.spPortfolio.v' + str(version) + '+json'
50
+ headers = {"Accept": schema_version, "Content-Type": schema_version}
51
+ prefer_value = 'return=representation'
52
+ if prefer:
53
+ headers.update({"Prefer": prefer_value})
54
+
55
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
56
+
57
+
58
+ @sp_endpoint('/portfolios/budget/usage', method='POST')
59
+ def get_budget_usage_for_portfolios(self, version: int = 1, **kwargs) -> ApiResponse:
60
+ r"""
61
+
62
+ get_budget_usage_for_portfolios(body: (str, dict)) -> ApiResponse
63
+
64
+
65
+ """
66
+ schema_version = 'application/vnd.portfoliobudgetusage.v' + str(version) + '+json'
67
+ headers = {"Accept": schema_version, "Content-Type": schema_version}
68
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
@@ -0,0 +1 @@
1
+ __version__ = "0.6.3"