zinc 2026.7.17__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 (141) hide show
  1. zinc-2026.7.17/PKG-INFO +256 -0
  2. zinc-2026.7.17/README.md +224 -0
  3. zinc-2026.7.17/pyproject.toml +97 -0
  4. zinc-2026.7.17/src/zincio/__init__.py +307 -0
  5. zinc-2026.7.17/src/zincio/_default_clients.py +30 -0
  6. zinc-2026.7.17/src/zincio/agent/__init__.py +55 -0
  7. zinc-2026.7.17/src/zincio/agent/client.py +1176 -0
  8. zinc-2026.7.17/src/zincio/agent/raw_client.py +1704 -0
  9. zinc-2026.7.17/src/zincio/agent/types/__init__.py +53 -0
  10. zinc-2026.7.17/src/zincio/agent/types/agent_product_details_post_request_retailer.py +5 -0
  11. zinc-2026.7.17/src/zincio/agent/types/agent_product_details_request_retailer.py +5 -0
  12. zinc-2026.7.17/src/zincio/agent/types/agent_product_offers_post_request_retailer.py +5 -0
  13. zinc-2026.7.17/src/zincio/agent/types/agent_product_offers_request_retailer.py +5 -0
  14. zinc-2026.7.17/src/zincio/agent/types/agent_product_search_post_request_retailer.py +5 -0
  15. zinc-2026.7.17/src/zincio/agent/types/agent_product_search_request_retailer.py +5 -0
  16. zinc-2026.7.17/src/zincio/client.py +399 -0
  17. zinc-2026.7.17/src/zincio/core/__init__.py +127 -0
  18. zinc-2026.7.17/src/zincio/core/api_error.py +23 -0
  19. zinc-2026.7.17/src/zincio/core/client_wrapper.py +141 -0
  20. zinc-2026.7.17/src/zincio/core/datetime_utils.py +70 -0
  21. zinc-2026.7.17/src/zincio/core/file.py +67 -0
  22. zinc-2026.7.17/src/zincio/core/force_multipart.py +18 -0
  23. zinc-2026.7.17/src/zincio/core/http_client.py +885 -0
  24. zinc-2026.7.17/src/zincio/core/http_response.py +59 -0
  25. zinc-2026.7.17/src/zincio/core/http_sse/__init__.py +42 -0
  26. zinc-2026.7.17/src/zincio/core/http_sse/_api.py +455 -0
  27. zinc-2026.7.17/src/zincio/core/http_sse/_decoders.py +74 -0
  28. zinc-2026.7.17/src/zincio/core/http_sse/_exceptions.py +7 -0
  29. zinc-2026.7.17/src/zincio/core/http_sse/_models.py +17 -0
  30. zinc-2026.7.17/src/zincio/core/jsonable_encoder.py +120 -0
  31. zinc-2026.7.17/src/zincio/core/logging.py +107 -0
  32. zinc-2026.7.17/src/zincio/core/parse_error.py +36 -0
  33. zinc-2026.7.17/src/zincio/core/pydantic_utilities.py +508 -0
  34. zinc-2026.7.17/src/zincio/core/query_encoder.py +58 -0
  35. zinc-2026.7.17/src/zincio/core/remove_none_from_dict.py +11 -0
  36. zinc-2026.7.17/src/zincio/core/request_options.py +40 -0
  37. zinc-2026.7.17/src/zincio/core/serialization.py +347 -0
  38. zinc-2026.7.17/src/zincio/environment.py +7 -0
  39. zinc-2026.7.17/src/zincio/errors/__init__.py +40 -0
  40. zinc-2026.7.17/src/zincio/errors/conflict_error.py +11 -0
  41. zinc-2026.7.17/src/zincio/errors/payment_required_error.py +10 -0
  42. zinc-2026.7.17/src/zincio/errors/unprocessable_entity_error.py +10 -0
  43. zinc-2026.7.17/src/zincio/health/__init__.py +4 -0
  44. zinc-2026.7.17/src/zincio/health/client.py +108 -0
  45. zinc-2026.7.17/src/zincio/health/raw_client.py +109 -0
  46. zinc-2026.7.17/src/zincio/managed_accounts/__init__.py +4 -0
  47. zinc-2026.7.17/src/zincio/managed_accounts/client.py +500 -0
  48. zinc-2026.7.17/src/zincio/managed_accounts/raw_client.py +639 -0
  49. zinc-2026.7.17/src/zincio/orders/__init__.py +4 -0
  50. zinc-2026.7.17/src/zincio/orders/client.py +1248 -0
  51. zinc-2026.7.17/src/zincio/orders/raw_client.py +1645 -0
  52. zinc-2026.7.17/src/zincio/products/__init__.py +46 -0
  53. zinc-2026.7.17/src/zincio/products/client.py +441 -0
  54. zinc-2026.7.17/src/zincio/products/raw_client.py +538 -0
  55. zinc-2026.7.17/src/zincio/products/types/__init__.py +48 -0
  56. zinc-2026.7.17/src/zincio/products/types/get_product_details_products_product_id_get_request_retailer.py +5 -0
  57. zinc-2026.7.17/src/zincio/products/types/get_product_offers_products_product_id_offers_get_request_retailer.py +7 -0
  58. zinc-2026.7.17/src/zincio/products/types/search_products_products_search_get_request_retailer.py +5 -0
  59. zinc-2026.7.17/src/zincio/py.typed +0 -0
  60. zinc-2026.7.17/src/zincio/retailers/__init__.py +4 -0
  61. zinc-2026.7.17/src/zincio/retailers/client.py +146 -0
  62. zinc-2026.7.17/src/zincio/retailers/raw_client.py +174 -0
  63. zinc-2026.7.17/src/zincio/returns/__init__.py +4 -0
  64. zinc-2026.7.17/src/zincio/returns/client.py +374 -0
  65. zinc-2026.7.17/src/zincio/returns/raw_client.py +494 -0
  66. zinc-2026.7.17/src/zincio/search/__init__.py +4 -0
  67. zinc-2026.7.17/src/zincio/search/client.py +126 -0
  68. zinc-2026.7.17/src/zincio/search/raw_client.py +156 -0
  69. zinc-2026.7.17/src/zincio/tracking/__init__.py +4 -0
  70. zinc-2026.7.17/src/zincio/tracking/client.py +112 -0
  71. zinc-2026.7.17/src/zincio/tracking/raw_client.py +131 -0
  72. zinc-2026.7.17/src/zincio/types/__init__.py +230 -0
  73. zinc-2026.7.17/src/zincio/types/address.py +35 -0
  74. zinc-2026.7.17/src/zincio/types/bulk_batch_list_response.py +25 -0
  75. zinc-2026.7.17/src/zincio/types/bulk_batch_response.py +34 -0
  76. zinc-2026.7.17/src/zincio/types/bulk_batch_status.py +5 -0
  77. zinc-2026.7.17/src/zincio/types/bulk_row_result.py +34 -0
  78. zinc-2026.7.17/src/zincio/types/bulk_row_validation.py +36 -0
  79. zinc-2026.7.17/src/zincio/types/bulk_upload_request.py +31 -0
  80. zinc-2026.7.17/src/zincio/types/bulk_validate_response.py +31 -0
  81. zinc-2026.7.17/src/zincio/types/components.py +24 -0
  82. zinc-2026.7.17/src/zincio/types/components_db.py +5 -0
  83. zinc-2026.7.17/src/zincio/types/components_ordering.py +5 -0
  84. zinc-2026.7.17/src/zincio/types/components_queue.py +5 -0
  85. zinc-2026.7.17/src/zincio/types/error_code.py +39 -0
  86. zinc-2026.7.17/src/zincio/types/error_detail.py +26 -0
  87. zinc-2026.7.17/src/zincio/types/error_details.py +32 -0
  88. zinc-2026.7.17/src/zincio/types/error_response.py +24 -0
  89. zinc-2026.7.17/src/zincio/types/field_error.py +31 -0
  90. zinc-2026.7.17/src/zincio/types/http_validation_error.py +20 -0
  91. zinc-2026.7.17/src/zincio/types/margin_spec.py +28 -0
  92. zinc-2026.7.17/src/zincio/types/margin_spec_type.py +5 -0
  93. zinc-2026.7.17/src/zincio/types/order_connect_info.py +48 -0
  94. zinc-2026.7.17/src/zincio/types/order_create.py +66 -0
  95. zinc-2026.7.17/src/zincio/types/order_item_response.py +39 -0
  96. zinc-2026.7.17/src/zincio/types/order_item_status.py +7 -0
  97. zinc-2026.7.17/src/zincio/types/order_job_result.py +37 -0
  98. zinc-2026.7.17/src/zincio/types/order_list_response.py +27 -0
  99. zinc-2026.7.17/src/zincio/types/order_milestone.py +29 -0
  100. zinc-2026.7.17/src/zincio/types/order_milestone_type.py +10 -0
  101. zinc-2026.7.17/src/zincio/types/order_payment.py +41 -0
  102. zinc-2026.7.17/src/zincio/types/order_payment_mode.py +5 -0
  103. zinc-2026.7.17/src/zincio/types/order_price_components.py +56 -0
  104. zinc-2026.7.17/src/zincio/types/order_product.py +46 -0
  105. zinc-2026.7.17/src/zincio/types/order_response.py +57 -0
  106. zinc-2026.7.17/src/zincio/types/order_status.py +8 -0
  107. zinc-2026.7.17/src/zincio/types/order_timeline_response.py +31 -0
  108. zinc-2026.7.17/src/zincio/types/product_condition.py +7 -0
  109. zinc-2026.7.17/src/zincio/types/product_search_response.py +29 -0
  110. zinc-2026.7.17/src/zincio/types/product_search_result.py +48 -0
  111. zinc-2026.7.17/src/zincio/types/product_variant.py +31 -0
  112. zinc-2026.7.17/src/zincio/types/public_health_response.py +24 -0
  113. zinc-2026.7.17/src/zincio/types/public_health_response_status.py +5 -0
  114. zinc-2026.7.17/src/zincio/types/public_retailer.py +66 -0
  115. zinc-2026.7.17/src/zincio/types/public_retailer_list_response.py +25 -0
  116. zinc-2026.7.17/src/zincio/types/public_tracking_destination.py +31 -0
  117. zinc-2026.7.17/src/zincio/types/public_tracking_item.py +27 -0
  118. zinc-2026.7.17/src/zincio/types/public_tracking_response.py +40 -0
  119. zinc-2026.7.17/src/zincio/types/public_tracking_shipment.py +34 -0
  120. zinc-2026.7.17/src/zincio/types/recent_call.py +28 -0
  121. zinc-2026.7.17/src/zincio/types/retailer_credentials_list_response.py +25 -0
  122. zinc-2026.7.17/src/zincio/types/retailer_credentials_response.py +65 -0
  123. zinc-2026.7.17/src/zincio/types/return_request_item.py +24 -0
  124. zinc-2026.7.17/src/zincio/types/return_request_list_response.py +21 -0
  125. zinc-2026.7.17/src/zincio/types/return_request_reason.py +19 -0
  126. zinc-2026.7.17/src/zincio/types/return_request_response.py +33 -0
  127. zinc-2026.7.17/src/zincio/types/return_request_status.py +5 -0
  128. zinc-2026.7.17/src/zincio/types/return_request_summary.py +31 -0
  129. zinc-2026.7.17/src/zincio/types/search_response.py +26 -0
  130. zinc-2026.7.17/src/zincio/types/sku.py +31 -0
  131. zinc-2026.7.17/src/zincio/types/tracking_checkpoint_response.py +47 -0
  132. zinc-2026.7.17/src/zincio/types/tracking_number_response.py +59 -0
  133. zinc-2026.7.17/src/zincio/types/tracking_status.py +5 -0
  134. zinc-2026.7.17/src/zincio/types/usage_metric.py +21 -0
  135. zinc-2026.7.17/src/zincio/types/user_usage_response.py +24 -0
  136. zinc-2026.7.17/src/zincio/types/validation_error.py +22 -0
  137. zinc-2026.7.17/src/zincio/types/validation_error_loc_item.py +5 -0
  138. zinc-2026.7.17/src/zincio/usage/__init__.py +4 -0
  139. zinc-2026.7.17/src/zincio/usage/client.py +134 -0
  140. zinc-2026.7.17/src/zincio/usage/raw_client.py +166 -0
  141. zinc-2026.7.17/src/zincio/version.py +3 -0
@@ -0,0 +1,256 @@
1
+ Metadata-Version: 2.1
2
+ Name: zinc
3
+ Version: 2026.7.17
4
+ Summary:
5
+ Requires-Python: >=3.10,<4.0
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: Operating System :: MacOS
8
+ Classifier: Operating System :: Microsoft :: Windows
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Operating System :: POSIX
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Programming Language :: Python :: 3.15
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Typing :: Typed
22
+ Provides-Extra: aiohttp
23
+ Requires-Dist: aiohttp (>=3.14.1,<4) ; (python_version >= "3.10") and (extra == "aiohttp")
24
+ Requires-Dist: httpx (>=0.21.2)
25
+ Requires-Dist: httpx-aiohttp (>=0.1.8,<0.2.0) ; (python_version >= "3.10") and (extra == "aiohttp")
26
+ Requires-Dist: pydantic (>=1.9.2)
27
+ Requires-Dist: pydantic-core (>=2.18.2,<3.0.0)
28
+ Requires-Dist: typing_extensions (>=4.0.0)
29
+ Project-URL: Repository, https://github.com/zincio/zinc-python
30
+ Description-Content-Type: text/markdown
31
+
32
+ # Zinc API Python Library
33
+
34
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fzincio%2Fzinc-python)
35
+ [![pypi](https://img.shields.io/pypi/v/zinc)](https://pypi.python.org/pypi/zinc)
36
+
37
+ **`zinc`** is the official TypeScript SDK for the [Zinc API](https://www.zinc.com/docs) —
38
+ search, buy, track, and return products from major online retailers
39
+ (Amazon, Walmart, and more) through a single, type-safe API.
40
+
41
+ Keywords: e-commerce API, place an order, buy products programmatically,
42
+ Amazon ordering API, checkout automation, order tracking, returns,
43
+ product search, AI agent commerce, autonomous purchasing, MPP / HTTP 402.
44
+
45
+ Every method is fully typed. Instantiate `ZincClient` once and call
46
+ resource methods like `zinc.orders.createOrder(...)` or `zinc.search.search(...)`.
47
+
48
+
49
+ ## Table of Contents
50
+
51
+ - [Installation](#installation)
52
+ - [Reference](#reference)
53
+ - [Usage](#usage)
54
+ - [Environments](#environments)
55
+ - [Async Client](#async-client)
56
+ - [Exception Handling](#exception-handling)
57
+ - [Advanced](#advanced)
58
+ - [Access Raw Response Data](#access-raw-response-data)
59
+ - [Retries](#retries)
60
+ - [Timeouts](#timeouts)
61
+ - [Custom Client](#custom-client)
62
+ - [Contributing](#contributing)
63
+
64
+ ## Installation
65
+
66
+ ```sh
67
+ pip install zinc
68
+ ```
69
+
70
+ ## Reference
71
+
72
+ A full reference for this library is available [here](https://github.com/zincio/zinc-python/blob/HEAD/./reference.md).
73
+
74
+ ## Usage
75
+
76
+ Instantiate and use the client with the following:
77
+
78
+ ```python
79
+ from zincio import ZincioApi, OrderProduct, Address
80
+
81
+ client = ZincioApi(
82
+ api_key="<value>",
83
+ )
84
+
85
+ client.orders.create_order(
86
+ products=[
87
+ OrderProduct(
88
+ url="https://www.amazon.com/dp/B07JGBW826",
89
+ )
90
+ ],
91
+ shipping_address=Address(
92
+ first_name="first_name",
93
+ last_name="last_name",
94
+ address_line1="address_line1",
95
+ city="city",
96
+ postal_code="postal_code",
97
+ phone_number="phone_number",
98
+ ),
99
+ max_price=1,
100
+ )
101
+ ```
102
+
103
+ ## Environments
104
+
105
+ This SDK allows you to configure different environments for API requests.
106
+
107
+ ```python
108
+ from zincio import ZincioApi
109
+ from zincio.environment import ZincioApiEnvironment
110
+
111
+ client = ZincioApi(
112
+ environment=ZincioApiEnvironment.PRODUCTION,
113
+ )
114
+ ```
115
+
116
+ ## Async Client
117
+
118
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).
119
+
120
+ ```python
121
+ import asyncio
122
+
123
+ from zincio import AsyncZincioApi
124
+
125
+ client = AsyncZincioApi(
126
+ api_key="<value>",
127
+ )
128
+
129
+
130
+ async def main() -> None:
131
+ await client.orders.create_order(
132
+ products=[
133
+ OrderProduct(
134
+ url="https://www.amazon.com/dp/B07JGBW826",
135
+ )
136
+ ],
137
+ shipping_address=Address(
138
+ first_name="first_name",
139
+ last_name="last_name",
140
+ address_line1="address_line1",
141
+ city="city",
142
+ postal_code="postal_code",
143
+ phone_number="phone_number",
144
+ ),
145
+ max_price=1,
146
+ )
147
+
148
+
149
+ asyncio.run(main())
150
+ ```
151
+
152
+ ## Exception Handling
153
+
154
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
155
+ will be thrown.
156
+
157
+ ```python
158
+ from zincio.core.api_error import ApiError
159
+
160
+ try:
161
+ client.orders.create_order(...)
162
+ except ApiError as e:
163
+ print(e.status_code)
164
+ print(e.body)
165
+ ```
166
+
167
+ ## Advanced
168
+
169
+ ### Access Raw Response Data
170
+
171
+ The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
172
+ The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
173
+
174
+ ```python
175
+ from zincio import ZincioApi
176
+
177
+ client = ZincioApi(...)
178
+ response = client.orders.with_raw_response.create_order(...)
179
+ print(response.headers) # access the response headers
180
+ print(response.status_code) # access the response status code
181
+ print(response.data) # access the underlying object
182
+ ```
183
+
184
+ ### Retries
185
+
186
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
187
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
188
+ retry limit (default: 2).
189
+
190
+ Which status codes are retried depends on the `retryStatusCodes` generator configuration:
191
+
192
+ **`legacy`** (current default): retries on
193
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
194
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
195
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
196
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)
197
+
198
+ **`recommended`**: retries on
199
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
200
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
201
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
202
+ - [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)
203
+ - [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable)
204
+ - [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout)
205
+
206
+ Use the `max_retries` request option to configure this behavior.
207
+
208
+ ```python
209
+ client.orders.create_order(..., request_options={
210
+ "max_retries": 1
211
+ })
212
+ ```
213
+
214
+ ### Timeouts
215
+
216
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
217
+
218
+ ```python
219
+ from zincio import ZincioApi
220
+
221
+ client = ZincioApi(..., timeout=20.0)
222
+
223
+ # Override timeout for a specific method
224
+ client.orders.create_order(..., request_options={
225
+ "timeout": 1
226
+ })
227
+ ```
228
+
229
+ ### Custom Client
230
+
231
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
232
+ and transports.
233
+
234
+ ```python
235
+ import httpx
236
+ from zincio import ZincioApi
237
+
238
+ client = ZincioApi(
239
+ ...,
240
+ httpx_client=httpx.Client(
241
+ proxy="http://my.test.proxy.example.com",
242
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
243
+ ),
244
+ )
245
+ ```
246
+
247
+ ## Contributing
248
+
249
+ While we value open-source contributions to this SDK, this library is generated programmatically.
250
+ Additions made directly to this library would have to be moved over to our generation code,
251
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
252
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
253
+ an issue first to discuss with us!
254
+
255
+ On the other hand, contributions to the README are always very welcome!
256
+
@@ -0,0 +1,224 @@
1
+ # Zinc API Python Library
2
+
3
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fzincio%2Fzinc-python)
4
+ [![pypi](https://img.shields.io/pypi/v/zinc)](https://pypi.python.org/pypi/zinc)
5
+
6
+ **`zinc`** is the official TypeScript SDK for the [Zinc API](https://www.zinc.com/docs) —
7
+ search, buy, track, and return products from major online retailers
8
+ (Amazon, Walmart, and more) through a single, type-safe API.
9
+
10
+ Keywords: e-commerce API, place an order, buy products programmatically,
11
+ Amazon ordering API, checkout automation, order tracking, returns,
12
+ product search, AI agent commerce, autonomous purchasing, MPP / HTTP 402.
13
+
14
+ Every method is fully typed. Instantiate `ZincClient` once and call
15
+ resource methods like `zinc.orders.createOrder(...)` or `zinc.search.search(...)`.
16
+
17
+
18
+ ## Table of Contents
19
+
20
+ - [Installation](#installation)
21
+ - [Reference](#reference)
22
+ - [Usage](#usage)
23
+ - [Environments](#environments)
24
+ - [Async Client](#async-client)
25
+ - [Exception Handling](#exception-handling)
26
+ - [Advanced](#advanced)
27
+ - [Access Raw Response Data](#access-raw-response-data)
28
+ - [Retries](#retries)
29
+ - [Timeouts](#timeouts)
30
+ - [Custom Client](#custom-client)
31
+ - [Contributing](#contributing)
32
+
33
+ ## Installation
34
+
35
+ ```sh
36
+ pip install zinc
37
+ ```
38
+
39
+ ## Reference
40
+
41
+ A full reference for this library is available [here](https://github.com/zincio/zinc-python/blob/HEAD/./reference.md).
42
+
43
+ ## Usage
44
+
45
+ Instantiate and use the client with the following:
46
+
47
+ ```python
48
+ from zincio import ZincioApi, OrderProduct, Address
49
+
50
+ client = ZincioApi(
51
+ api_key="<value>",
52
+ )
53
+
54
+ client.orders.create_order(
55
+ products=[
56
+ OrderProduct(
57
+ url="https://www.amazon.com/dp/B07JGBW826",
58
+ )
59
+ ],
60
+ shipping_address=Address(
61
+ first_name="first_name",
62
+ last_name="last_name",
63
+ address_line1="address_line1",
64
+ city="city",
65
+ postal_code="postal_code",
66
+ phone_number="phone_number",
67
+ ),
68
+ max_price=1,
69
+ )
70
+ ```
71
+
72
+ ## Environments
73
+
74
+ This SDK allows you to configure different environments for API requests.
75
+
76
+ ```python
77
+ from zincio import ZincioApi
78
+ from zincio.environment import ZincioApiEnvironment
79
+
80
+ client = ZincioApi(
81
+ environment=ZincioApiEnvironment.PRODUCTION,
82
+ )
83
+ ```
84
+
85
+ ## Async Client
86
+
87
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).
88
+
89
+ ```python
90
+ import asyncio
91
+
92
+ from zincio import AsyncZincioApi
93
+
94
+ client = AsyncZincioApi(
95
+ api_key="<value>",
96
+ )
97
+
98
+
99
+ async def main() -> None:
100
+ await client.orders.create_order(
101
+ products=[
102
+ OrderProduct(
103
+ url="https://www.amazon.com/dp/B07JGBW826",
104
+ )
105
+ ],
106
+ shipping_address=Address(
107
+ first_name="first_name",
108
+ last_name="last_name",
109
+ address_line1="address_line1",
110
+ city="city",
111
+ postal_code="postal_code",
112
+ phone_number="phone_number",
113
+ ),
114
+ max_price=1,
115
+ )
116
+
117
+
118
+ asyncio.run(main())
119
+ ```
120
+
121
+ ## Exception Handling
122
+
123
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
124
+ will be thrown.
125
+
126
+ ```python
127
+ from zincio.core.api_error import ApiError
128
+
129
+ try:
130
+ client.orders.create_order(...)
131
+ except ApiError as e:
132
+ print(e.status_code)
133
+ print(e.body)
134
+ ```
135
+
136
+ ## Advanced
137
+
138
+ ### Access Raw Response Data
139
+
140
+ The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
141
+ The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
142
+
143
+ ```python
144
+ from zincio import ZincioApi
145
+
146
+ client = ZincioApi(...)
147
+ response = client.orders.with_raw_response.create_order(...)
148
+ print(response.headers) # access the response headers
149
+ print(response.status_code) # access the response status code
150
+ print(response.data) # access the underlying object
151
+ ```
152
+
153
+ ### Retries
154
+
155
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
156
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
157
+ retry limit (default: 2).
158
+
159
+ Which status codes are retried depends on the `retryStatusCodes` generator configuration:
160
+
161
+ **`legacy`** (current default): retries on
162
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
163
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
164
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
165
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)
166
+
167
+ **`recommended`**: retries on
168
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
169
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
170
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
171
+ - [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)
172
+ - [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable)
173
+ - [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout)
174
+
175
+ Use the `max_retries` request option to configure this behavior.
176
+
177
+ ```python
178
+ client.orders.create_order(..., request_options={
179
+ "max_retries": 1
180
+ })
181
+ ```
182
+
183
+ ### Timeouts
184
+
185
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
186
+
187
+ ```python
188
+ from zincio import ZincioApi
189
+
190
+ client = ZincioApi(..., timeout=20.0)
191
+
192
+ # Override timeout for a specific method
193
+ client.orders.create_order(..., request_options={
194
+ "timeout": 1
195
+ })
196
+ ```
197
+
198
+ ### Custom Client
199
+
200
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
201
+ and transports.
202
+
203
+ ```python
204
+ import httpx
205
+ from zincio import ZincioApi
206
+
207
+ client = ZincioApi(
208
+ ...,
209
+ httpx_client=httpx.Client(
210
+ proxy="http://my.test.proxy.example.com",
211
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
212
+ ),
213
+ )
214
+ ```
215
+
216
+ ## Contributing
217
+
218
+ While we value open-source contributions to this SDK, this library is generated programmatically.
219
+ Additions made directly to this library would have to be moved over to our generation code,
220
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
221
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
222
+ an issue first to discuss with us!
223
+
224
+ On the other hand, contributions to the README are always very welcome!
@@ -0,0 +1,97 @@
1
+ [project]
2
+ name = "zinc"
3
+ dynamic = ["version"]
4
+
5
+ [tool.poetry]
6
+ name = "zinc"
7
+ version = "2026.7.17"
8
+ description = ""
9
+ readme = "README.md"
10
+ authors = []
11
+ keywords = []
12
+
13
+ classifiers = [
14
+ "Intended Audience :: Developers",
15
+ "Programming Language :: Python",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Programming Language :: Python :: 3.14",
22
+ "Programming Language :: Python :: 3.15",
23
+ "Operating System :: OS Independent",
24
+ "Operating System :: POSIX",
25
+ "Operating System :: MacOS",
26
+ "Operating System :: POSIX :: Linux",
27
+ "Operating System :: Microsoft :: Windows",
28
+ "Topic :: Software Development :: Libraries :: Python Modules",
29
+ "Typing :: Typed"
30
+ ]
31
+ packages = [
32
+ { include = "zincio", from = "src"}
33
+ ]
34
+
35
+ [tool.poetry.urls]
36
+ Repository = 'https://github.com/zincio/zinc-python'
37
+
38
+ [tool.poetry.dependencies]
39
+ python = "^3.10"
40
+ aiohttp = { version = ">=3.14.1,<4", optional = true, python = ">=3.10"}
41
+ httpx = ">=0.21.2"
42
+ httpx-aiohttp = { version = "^0.1.8", optional = true, python = ">=3.10"}
43
+ pydantic = ">= 1.9.2"
44
+ pydantic-core = ">=2.18.2,<3.0.0"
45
+ typing_extensions = ">= 4.0.0"
46
+
47
+ [tool.poetry.group.dev.dependencies]
48
+ mypy = "==1.13.0"
49
+ pytest = "^9.0.3"
50
+ pytest-asyncio = "^1.0.0"
51
+ pytest-xdist = "^3.6.1"
52
+ python-dateutil = "^2.9.0"
53
+ types-python-dateutil = "^2.9.0.20240316"
54
+ urllib3 = ">=2.6.3,<3.0.0"
55
+ ruff = "==0.11.5"
56
+
57
+ [tool.pytest.ini_options]
58
+ testpaths = [ "tests" ]
59
+ asyncio_mode = "auto"
60
+ norecursedirs = [ "src" ]
61
+ markers = [
62
+ "aiohttp: tests that require httpx_aiohttp to be installed",
63
+ ]
64
+
65
+ [tool.mypy]
66
+ plugins = ["pydantic.mypy"]
67
+
68
+ [tool.ruff]
69
+ line-length = 120
70
+
71
+ [tool.ruff.lint]
72
+ select = [
73
+ "E", # pycodestyle errors
74
+ "F", # pyflakes
75
+ "I", # isort
76
+ ]
77
+ ignore = [
78
+ "E402", # Module level import not at top of file
79
+ "E501", # Line too long
80
+ "E711", # Comparison to `None` should be `cond is not None`
81
+ "E712", # Avoid equality comparisons to `True`; use `if ...:` checks
82
+ "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks
83
+ "E722", # Do not use bare `except`
84
+ "E731", # Do not assign a `lambda` expression, use a `def`
85
+ "F821", # Undefined name
86
+ "F841" # Local variable ... is assigned to but never used
87
+ ]
88
+
89
+ [tool.ruff.lint.isort]
90
+ section-order = ["future", "standard-library", "third-party", "first-party"]
91
+
92
+ [build-system]
93
+ requires = ["poetry-core"]
94
+ build-backend = "poetry.core.masonry.api"
95
+
96
+ [tool.poetry.extras]
97
+ aiohttp=["aiohttp", "httpx-aiohttp"]