etsy-python 1.2.0__tar.gz → 1.2.2__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 (75) hide show
  1. {etsy_python-1.2.0/etsy_python.egg-info → etsy_python-1.2.2}/PKG-INFO +1 -1
  2. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/_version.py +1 -1
  3. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/enums/Listing.py +1 -1
  4. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/models/Listing.py +82 -2
  5. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/ListingVideo.py +16 -3
  6. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/Taxonomy.py +10 -3
  7. {etsy_python-1.2.0 → etsy_python-1.2.2/etsy_python.egg-info}/PKG-INFO +1 -1
  8. {etsy_python-1.2.0 → etsy_python-1.2.2}/LICENSE +0 -0
  9. {etsy_python-1.2.0 → etsy_python-1.2.2}/MANIFEST.in +0 -0
  10. {etsy_python-1.2.0 → etsy_python-1.2.2}/README.md +0 -0
  11. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/__init__.py +0 -0
  12. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/__init__.py +0 -0
  13. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/auth/OAuth.py +0 -0
  14. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/auth/__init__.py +0 -0
  15. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/common/Env.py +0 -0
  16. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/common/Request.py +0 -0
  17. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/common/Utils.py +0 -0
  18. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/common/__init__.py +0 -0
  19. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/enums/HolidayPreferences.py +0 -0
  20. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/enums/Language.py +0 -0
  21. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/enums/ListingInventory.py +0 -0
  22. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/enums/ProcessingProfile.py +0 -0
  23. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/enums/ShippingProfile.py +0 -0
  24. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/enums/ShopReceipt.py +0 -0
  25. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/enums/__init__.py +0 -0
  26. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/exceptions/BaseAPIException.py +0 -0
  27. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/exceptions/RequestException.py +0 -0
  28. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/exceptions/__init__.py +0 -0
  29. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/models/FileRequest.py +0 -0
  30. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/models/HolidayPreferences.py +0 -0
  31. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/models/Miscellaneous.py +0 -0
  32. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/models/ProcessingProfile.py +0 -0
  33. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/models/Product.py +0 -0
  34. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/models/Receipt.py +0 -0
  35. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/models/Request.py +0 -0
  36. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/models/ShippingProfile.py +0 -0
  37. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/models/Shop.py +0 -0
  38. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/models/ShopReturnPolicy.py +0 -0
  39. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/models/Utils.py +0 -0
  40. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/models/__init__.py +0 -0
  41. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/HolidayPreferences.py +0 -0
  42. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/Listing.py +0 -0
  43. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/ListingFile.py +0 -0
  44. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/ListingImage.py +0 -0
  45. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/ListingInventory.py +0 -0
  46. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/ListingOffering.py +0 -0
  47. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/ListingProduct.py +0 -0
  48. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/ListingTranslation.py +0 -0
  49. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/ListingVariationImages.py +0 -0
  50. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/Miscellaneous.py +0 -0
  51. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/Payment.py +0 -0
  52. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/PaymentLedgerEntry.py +0 -0
  53. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/ProcessingProfile.py +0 -0
  54. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/Receipt.py +0 -0
  55. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/ReceiptTransactions.py +0 -0
  56. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/Response.py +0 -0
  57. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/Review.py +0 -0
  58. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/Session.py +0 -0
  59. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/ShippingProfile.py +0 -0
  60. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/Shop.py +0 -0
  61. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/ShopProductionPartner.py +0 -0
  62. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/ShopReturnPolicy.py +0 -0
  63. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/ShopSection.py +0 -0
  64. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/User.py +0 -0
  65. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/UserAddress.py +0 -0
  66. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/__init__.py +0 -0
  67. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/enums/RateLimit.py +0 -0
  68. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/enums/Request.py +0 -0
  69. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python/v3/resources/enums/__init__.py +0 -0
  70. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python.egg-info/SOURCES.txt +0 -0
  71. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python.egg-info/dependency_links.txt +0 -0
  72. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python.egg-info/requires.txt +0 -0
  73. {etsy_python-1.2.0 → etsy_python-1.2.2}/etsy_python.egg-info/top_level.txt +0 -0
  74. {etsy_python-1.2.0 → etsy_python-1.2.2}/setup.cfg +0 -0
  75. {etsy_python-1.2.0 → etsy_python-1.2.2}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: etsy-python
3
- Version: 1.2.0
3
+ Version: 1.2.2
4
4
  Summary: Etsy API Client Library for Python
5
5
  Author: Amit Ray
6
6
  Author-email: mail@amitray.dev
@@ -1,3 +1,3 @@
1
1
  """Version information for etsy-python package."""
2
2
 
3
- __version__ = "1.2.0"
3
+ __version__ = "1.2.2"
@@ -58,7 +58,7 @@ class State(Enum):
58
58
  SOLD_OUT = "sold_out"
59
59
  DRAFT = "draft"
60
60
  EXPIRED = "expired"
61
- REMOVED = "removed" # Not in OAS spec; kept for backward compatibility, may be removed in next major version
61
+ REMOVED = "removed"
62
62
 
63
63
 
64
64
  class VideoState(Enum):
@@ -127,7 +127,53 @@ class _PersonalizationFieldsMixin:
127
127
  )
128
128
 
129
129
 
130
- class CreateDraftListingRequest(_PersonalizationFieldsMixin, Request):
130
+ #: EU commercial guarantee / GPSR fields (ECGT), shared by createDraftListing
131
+ #: and updateListing. All are optional and nullable. Etsy silently ignores them
132
+ #: for sellers who are not eligible EU traders. ``ecgt_software_update_details``
133
+ #: is ignored for physical listings; the other six are ignored for digital ones.
134
+ #: ``ecgt_garan_brand``, ``ecgt_garan_model``, ``ecgt_garan_years`` and
135
+ #: ``ecgt_garan_guarantee_details`` are required *together* -- Etsy enforces
136
+ #: that server-side and rejects a partial set.
137
+ ECGT_FIELDS = (
138
+ "ecgt_garan_brand",
139
+ "ecgt_garan_model",
140
+ "ecgt_garan_years",
141
+ "ecgt_garan_guarantee_details",
142
+ "ecgt_other_commercial_guarantee_details",
143
+ "ecgt_after_sales_service_info",
144
+ "ecgt_software_update_details",
145
+ )
146
+
147
+
148
+ class _ECGTFieldsMixin:
149
+ """Storage for the EU commercial guarantee (ECGT) listing fields.
150
+
151
+ Both listing request models accept the same seven fields, so the
152
+ assignment lives here instead of being duplicated. See ``ECGT_FIELDS``.
153
+ """
154
+
155
+ def _store_ecgt(
156
+ self,
157
+ ecgt_garan_brand: Optional[str],
158
+ ecgt_garan_model: Optional[str],
159
+ ecgt_garan_years: Optional[int],
160
+ ecgt_garan_guarantee_details: Optional[str],
161
+ ecgt_other_commercial_guarantee_details: Optional[str],
162
+ ecgt_after_sales_service_info: Optional[str],
163
+ ecgt_software_update_details: Optional[str],
164
+ ) -> None:
165
+ self.ecgt_garan_brand = ecgt_garan_brand
166
+ self.ecgt_garan_model = ecgt_garan_model
167
+ self.ecgt_garan_years = ecgt_garan_years
168
+ self.ecgt_garan_guarantee_details = ecgt_garan_guarantee_details
169
+ self.ecgt_other_commercial_guarantee_details = (
170
+ ecgt_other_commercial_guarantee_details
171
+ )
172
+ self.ecgt_after_sales_service_info = ecgt_after_sales_service_info
173
+ self.ecgt_software_update_details = ecgt_software_update_details
174
+
175
+
176
+ class CreateDraftListingRequest(_PersonalizationFieldsMixin, _ECGTFieldsMixin, Request):
131
177
  nullable = [
132
178
  "shipping_profile_id",
133
179
  "return_policy_id",
@@ -146,6 +192,7 @@ class CreateDraftListingRequest(_PersonalizationFieldsMixin, Request):
146
192
  "production_partner_ids",
147
193
  "image_ids",
148
194
  "readiness_state_id",
195
+ *ECGT_FIELDS,
149
196
  ]
150
197
  mandatory = [
151
198
  "quantity",
@@ -192,6 +239,13 @@ class CreateDraftListingRequest(_PersonalizationFieldsMixin, Request):
192
239
  is_taxable: Optional[bool] = None,
193
240
  listing_type: Optional[Type] = None,
194
241
  readiness_state_id: Optional[int] = None,
242
+ ecgt_garan_brand: Optional[str] = None,
243
+ ecgt_garan_model: Optional[str] = None,
244
+ ecgt_garan_years: Optional[int] = None,
245
+ ecgt_garan_guarantee_details: Optional[str] = None,
246
+ ecgt_other_commercial_guarantee_details: Optional[str] = None,
247
+ ecgt_after_sales_service_info: Optional[str] = None,
248
+ ecgt_software_update_details: Optional[str] = None,
195
249
  ):
196
250
  self.quantity = quantity
197
251
  self.title = title
@@ -228,13 +282,22 @@ class CreateDraftListingRequest(_PersonalizationFieldsMixin, Request):
228
282
  self.is_taxable = is_taxable
229
283
  self._type = listing_type
230
284
  self.readiness_state_id = readiness_state_id
285
+ self._store_ecgt(
286
+ ecgt_garan_brand,
287
+ ecgt_garan_model,
288
+ ecgt_garan_years,
289
+ ecgt_garan_guarantee_details,
290
+ ecgt_other_commercial_guarantee_details,
291
+ ecgt_after_sales_service_info,
292
+ ecgt_software_update_details,
293
+ )
231
294
  super().__init__(
232
295
  nullable=CreateDraftListingRequest.nullable,
233
296
  mandatory=CreateDraftListingRequest.mandatory,
234
297
  )
235
298
 
236
299
 
237
- class UpdateListingRequest(_PersonalizationFieldsMixin, Request):
300
+ class UpdateListingRequest(_PersonalizationFieldsMixin, _ECGTFieldsMixin, Request):
238
301
  nullable: List[str] = [
239
302
  "materials",
240
303
  "shipping_profile_id",
@@ -250,6 +313,7 @@ class UpdateListingRequest(_PersonalizationFieldsMixin, Request):
250
313
  "featured_rank",
251
314
  "production_partner_ids",
252
315
  "_type",
316
+ *ECGT_FIELDS,
253
317
  ]
254
318
 
255
319
  mandatory: List[str] = []
@@ -284,6 +348,13 @@ class UpdateListingRequest(_PersonalizationFieldsMixin, Request):
284
348
  is_supply: Optional[bool] = None,
285
349
  production_partner_ids: Optional[List[int]] = None,
286
350
  listing_type: Optional[Type] = None,
351
+ ecgt_garan_brand: Optional[str] = None,
352
+ ecgt_garan_model: Optional[str] = None,
353
+ ecgt_garan_years: Optional[int] = None,
354
+ ecgt_garan_guarantee_details: Optional[str] = None,
355
+ ecgt_other_commercial_guarantee_details: Optional[str] = None,
356
+ ecgt_after_sales_service_info: Optional[str] = None,
357
+ ecgt_software_update_details: Optional[str] = None,
287
358
  ):
288
359
  self.image_ids = image_ids
289
360
  self.title = title
@@ -315,6 +386,15 @@ class UpdateListingRequest(_PersonalizationFieldsMixin, Request):
315
386
  self.is_supply = is_supply
316
387
  self.production_partner_ids = production_partner_ids
317
388
  self._type = listing_type
389
+ self._store_ecgt(
390
+ ecgt_garan_brand,
391
+ ecgt_garan_model,
392
+ ecgt_garan_years,
393
+ ecgt_garan_guarantee_details,
394
+ ecgt_other_commercial_guarantee_details,
395
+ ecgt_after_sales_service_info,
396
+ ecgt_software_update_details,
397
+ )
318
398
  super().__init__(
319
399
  nullable=UpdateListingRequest.nullable,
320
400
  mandatory=UpdateListingRequest.mandatory,
@@ -1,5 +1,5 @@
1
1
  from dataclasses import dataclass
2
- from typing import Union
2
+ from typing import Optional, Union
3
3
 
4
4
  from etsy_python.v3.exceptions.RequestException import RequestException
5
5
  from etsy_python.v3.models.Listing import UpdateListingVideoRequest
@@ -29,9 +29,22 @@ class ListingVideoResource:
29
29
  return self.session.make_request(endpoint)
30
30
 
31
31
  def upload_listing_video(
32
- self, shop_id: int, listing_id: int, listing_video: UpdateListingVideoRequest
32
+ self,
33
+ shop_id: int,
34
+ listing_id: int,
35
+ listing_video: UpdateListingVideoRequest,
36
+ is_multi_video: Optional[bool] = None,
33
37
  ) -> Union[Response, RequestException]:
38
+ """Upload a video to a listing.
39
+
40
+ Pass ``is_multi_video=True`` to keep existing videos on the listing.
41
+ Omitting it preserves the former single-video behaviour, where the
42
+ upload replaces any video already attached.
43
+ """
34
44
  endpoint = f"/shops/{shop_id}/listings/{listing_id}/videos"
35
45
  return self.session.make_request(
36
- endpoint, method=Method.POST, payload=listing_video
46
+ endpoint,
47
+ method=Method.POST,
48
+ payload=listing_video,
49
+ query_params={"is_multi_video": is_multi_video},
37
50
  )
@@ -1,5 +1,5 @@
1
1
  from dataclasses import dataclass
2
- from typing import Union
2
+ from typing import Any, Dict, Optional, Union
3
3
 
4
4
  from etsy_python.v3.exceptions.RequestException import RequestException
5
5
  from etsy_python.v3.resources.Response import Response
@@ -30,7 +30,14 @@ class SellerTaxonomyResource:
30
30
  return self.session.make_request(endpoint)
31
31
 
32
32
  def get_properties_by_taxonomy_id(
33
- self, taxonomy_id: int
33
+ self,
34
+ taxonomy_id: int,
35
+ supports_variations: Optional[bool] = None,
36
+ supports_attributes: Optional[bool] = None,
34
37
  ) -> Union[Response, RequestException]:
35
38
  endpoint = f"/seller-taxonomy/nodes/{taxonomy_id}/properties"
36
- return self.session.make_request(endpoint)
39
+ query_params: Dict[str, Any] = {
40
+ "supports_variations": supports_variations,
41
+ "supports_attributes": supports_attributes,
42
+ }
43
+ return self.session.make_request(endpoint, query_params=query_params)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: etsy-python
3
- Version: 1.2.0
3
+ Version: 1.2.2
4
4
  Summary: Etsy API Client Library for Python
5
5
  Author: Amit Ray
6
6
  Author-email: mail@amitray.dev
File without changes
File without changes
File without changes
File without changes
File without changes