asindotdev 0.1.0__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.
@@ -0,0 +1,14 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ venv/
5
+ build/
6
+ dist/
7
+ *.egg-info/
8
+ .pytest_cache/
9
+ .mypy_cache/
10
+ .ruff_cache/
11
+ .coverage
12
+ htmlcov/
13
+ .env
14
+ .DS_Store
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Asin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,201 @@
1
+ Metadata-Version: 2.5
2
+ Name: asindotdev
3
+ Version: 0.1.0
4
+ Summary: Official Python SDK for the Asin Amazon price tracking API.
5
+ Project-URL: Homepage, https://www.asin.dev
6
+ Project-URL: Documentation, https://www.asin.dev/docs
7
+ Project-URL: Repository, https://github.com/asindotdev/asin-python
8
+ Project-URL: Issues, https://github.com/asindotdev/asin-python/issues
9
+ Author-email: Asin <contact@asin.dev>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: amazon-api,api,asin,price-history,price-tracking,sdk
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Internet :: WWW/HTTP
21
+ Classifier: Typing :: Typed
22
+ Requires-Python: >=3.11
23
+ Requires-Dist: httpx<1,>=0.27
24
+ Provides-Extra: dev
25
+ Requires-Dist: build<2,>=1.2; extra == 'dev'
26
+ Requires-Dist: mypy>=1.13; extra == 'dev'
27
+ Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
28
+ Requires-Dist: pytest>=8.3; extra == 'dev'
29
+ Requires-Dist: ruff<1,>=0.8; extra == 'dev'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # Asin Python SDK
33
+
34
+ The official Python SDK for the [Asin](https://www.asin.dev) Amazon price tracking API.
35
+
36
+ Track Amazon prices and products with a scheduled watchlist, price history, offers and alerts.
37
+
38
+ The SDK exposes **11 typed methods**, one per documented endpoint, with blocking and `asyncio` clients built on [HTTPX](https://www.python-httpx.org/), plus a generic `request()`.
39
+
40
+ ## Requirements
41
+
42
+ - Python 3.11 or newer
43
+
44
+ ## Installation
45
+
46
+ ```sh
47
+ pip install asindotdev
48
+ ```
49
+
50
+ ## Get your API key
51
+
52
+ [Sign up for Asin](https://www.asin.dev/signup) or sign in, then copy your API key from the [dashboard](https://www.asin.dev/app). The client reads the `ASIN_API_KEY` environment variable when no key is passed.
53
+
54
+ ## Quick start
55
+
56
+ ```python
57
+ import os
58
+
59
+ from asin import AsinClient
60
+
61
+ with AsinClient(os.environ["ASIN_API_KEY"]) as client:
62
+ response = client.search_amazon(query="wireless earbuds")
63
+ print(response.data)
64
+ ```
65
+
66
+ Keyword arguments mirror the [API reference](https://www.asin.dev/docs). Python keywords get a trailing underscore (`from_=`), and the wire name is used on the request.
67
+
68
+ ## Async I/O
69
+
70
+ ```python
71
+ import asyncio
72
+
73
+ from asin import AsyncAsinClient
74
+
75
+
76
+ async def main() -> None:
77
+ async with AsyncAsinClient() as client:
78
+ response = await client.search_amazon(query="wireless earbuds")
79
+ print(response.data)
80
+
81
+
82
+ asyncio.run(main())
83
+ ```
84
+
85
+ ## HTTP methods
86
+
87
+ Each method uses the HTTP verb of its endpoint. `GET` and `DELETE` send parameters in the query string; `POST` and `PATCH` send them as a JSON body, except `wait` on `/products/{id}/check`, which stays in the query string. Null values are never sent, so `target_price` cannot be removed through the SDK yet.
88
+
89
+ `None` values are omitted, `False` and `0` are sent, and sequences repeat the parameter name.
90
+
91
+ ## Any endpoint
92
+
93
+ ```python
94
+ response = client.request("GET", "/account")
95
+ ```
96
+
97
+ ## Errors
98
+
99
+ ```python
100
+ from asin import AsinAPIError
101
+
102
+ try:
103
+ client.search_amazon(query="wireless earbuds")
104
+ except AsinAPIError as error:
105
+ print(error.status, error, error.response_body)
106
+ ```
107
+
108
+ | Error | When |
109
+ | --- | --- |
110
+ | `AsinConfigurationError` | Missing API key, invalid options, unsupported method, closed client. |
111
+ | `AsinSerializationError` | A required parameter is missing or a value can't be sent. |
112
+ | `AsinTransportError` | Network failure or timeout. |
113
+ | `AsinAPIError` | Non-2xx status (`status`, `error_message`, `response_body`, `raw_response`). |
114
+ | `AsinResponseDecodingError` | A success response could not be decoded. |
115
+
116
+ All of them extend `AsinError`.
117
+
118
+ ## Retries
119
+
120
+ Requests are retried up to 3 times after a network error, a `408`, `429`, `500`, `502`, `503` or `504`. Other statuses, such as `400`, `401`, `402` or `404`, and client-side timeouts are not retried. The delay starts at 1 second and grows 1.5× per retry (capped at 30 seconds); a `Retry-After` header wins.
121
+
122
+ ```python
123
+ client = AsinClient(max_retries=5, retry_delay=0.5)
124
+
125
+ # or for one request
126
+ client.search_amazon(query="wireless earbuds", request_options=RequestOptions(max_retries=0))
127
+ ```
128
+
129
+ ## Batch requests
130
+
131
+ `batch()` runs a function per item on 10 threads (`concurrency`) and returns one `BatchResult` per item, in input order. A failing item never stops the others. `AsyncAsinClient.batch()` does the same with `asyncio`.
132
+
133
+ ```python
134
+ inputs = ["wireless earbuds", "mechanical keyboard", "usb-c hub"]
135
+ results = client.batch(inputs, lambda query: client.search_amazon(query=query), concurrency=5)
136
+
137
+ for result in results:
138
+ if result.ok:
139
+ print(result.value.data)
140
+ else:
141
+ print(inputs[result.index], result.error)
142
+ ```
143
+
144
+ | Constant | Default | Description |
145
+ | --- | --- | --- |
146
+ | `DEFAULT_CONCURRENCY` | `10` | Tasks run at the same time by batch |
147
+ | `DEFAULT_TIMEOUT` | `120.0` | Request timeout (seconds) |
148
+ | `MAX_RETRIES` | `3` | Retry attempts after a network error, a 408/429/5xx |
149
+ | `RETRY_BACKOFF_FACTOR` | `1.5` | Exponential backoff multiplier |
150
+ | `DEFAULT_RETRY_DELAY` | `1.0` | Delay before the first retry (seconds) |
151
+
152
+ ## Timeouts and custom HTTPX clients
153
+
154
+ ```python
155
+ import httpx
156
+
157
+ from asin import AsinClient, RequestOptions
158
+
159
+ client = AsinClient(timeout=60) # seconds, default 120, None disables
160
+ client.search_amazon(query="wireless earbuds", request_options=RequestOptions(timeout=30))
161
+
162
+ # Bring your own HTTPX client (proxies, limits, event hooks…). You keep ownership of it.
163
+ http_client = httpx.Client(proxy="http://localhost:8080")
164
+ client = AsinClient(http_client=http_client)
165
+ ```
166
+
167
+ ## Endpoints
168
+
169
+ 11 methods, generated from the [OpenAPI document](https://www.asin.dev/openapi.json).
170
+
171
+ | Method | HTTP | Description |
172
+ | --- | --- | --- |
173
+ | `check_product()` | POST `/products/{id}/check` | Asks for a check right away (1 credit), at most once per 5 minutes; earlier calls return the product unchanged. A paused product has to be… |
174
+ | `delete_product()` | DELETE `/products/{id}` | Removes the product and its price history. |
175
+ | `fetch_offers()` | POST `/offers` | Reads the offers on Amazon for 1 credit, refunded if it doesn't answer. A read made in the last 3 hours, by anyone, is returned instead, fo… |
176
+ | `get_account()` | GET `/account` | Your plan, the credits left (monthly allowance and packs), how many products you track and the credits they use per month. |
177
+ | `get_asin_history()` | GET `/history` | Every price Asin read for an ASIN on a marketplace over the period, whoever tracks it, oldest first, with the lowest, highest and average o… |
178
+ | `get_offers()` | GET `/offers` | Who sells the product and at what price, as last read, cheapest first, with Amazon's own price and the cheapest new and used offers (used i… |
179
+ | `get_product()` | GET `/products/{id}` | The product's latest state and every price read of the period, oldest first. The history covers every read of this ASIN on this marketplace… |
180
+ | `list_products()` | GET `/products` | Your watchlist, newest first, with each product's latest state and its recent prices (trend). Filter with asin (and marketplace) to know if… |
181
+ | `search_amazon()` | GET `/search` | Amazon search results (up to 60, sponsored included), to find the ASIN of a product. Free, limited to 30 searches per hour. |
182
+ | `track_product()` | POST `/products` | Adds an ASIN, an Amazon link or a short link (amzn.to, a.co…) to your watchlist. The first check runs in the background within seconds (che… |
183
+ | `update_product()` | PATCH `/products/{id}` | Target price, drop alerts, check interval, or pause. Send only what changes. |
184
+
185
+ ## All Asin SDKs
186
+
187
+ | SDK | Package | Install |
188
+ | --- | --- | --- |
189
+ | Node.js | [`@asindev/sdk`](https://www.npmjs.com/package/@asindev/sdk) | `npm install @asindev/sdk` |
190
+ | Python | [`asindotdev`](https://pypi.org/project/asindotdev/) | `pip install asindotdev` |
191
+ | Go | [`asin-go`](https://pkg.go.dev/github.com/asindotdev/asin-go) | `go get github.com/asindotdev/asin-go` |
192
+ | .NET | [`Asin`](https://www.nuget.org/packages/Asin) | `dotnet add package Asin` |
193
+ | Ruby | [`asindotdev`](https://rubygems.org/gems/asindotdev) | `gem install asindotdev` |
194
+ | PHP | [`asindotdev/sdk`](https://packagist.org/packages/asindotdev/sdk) | `composer require asindotdev/sdk` |
195
+ | Java | [`asin-java`](https://github.com/asindotdev/asin-java) | build from source, see its README |
196
+ | CLI | [`@asindev/cli`](https://www.npmjs.com/package/@asindev/cli) | `npm install -g @asindev/cli` |
197
+ | MCP server | [`@asindev/mcp`](https://www.npmjs.com/package/@asindev/mcp) | `npx -y @asindev/mcp` |
198
+
199
+ ## License
200
+
201
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,170 @@
1
+ # Asin Python SDK
2
+
3
+ The official Python SDK for the [Asin](https://www.asin.dev) Amazon price tracking API.
4
+
5
+ Track Amazon prices and products with a scheduled watchlist, price history, offers and alerts.
6
+
7
+ The SDK exposes **11 typed methods**, one per documented endpoint, with blocking and `asyncio` clients built on [HTTPX](https://www.python-httpx.org/), plus a generic `request()`.
8
+
9
+ ## Requirements
10
+
11
+ - Python 3.11 or newer
12
+
13
+ ## Installation
14
+
15
+ ```sh
16
+ pip install asindotdev
17
+ ```
18
+
19
+ ## Get your API key
20
+
21
+ [Sign up for Asin](https://www.asin.dev/signup) or sign in, then copy your API key from the [dashboard](https://www.asin.dev/app). The client reads the `ASIN_API_KEY` environment variable when no key is passed.
22
+
23
+ ## Quick start
24
+
25
+ ```python
26
+ import os
27
+
28
+ from asin import AsinClient
29
+
30
+ with AsinClient(os.environ["ASIN_API_KEY"]) as client:
31
+ response = client.search_amazon(query="wireless earbuds")
32
+ print(response.data)
33
+ ```
34
+
35
+ Keyword arguments mirror the [API reference](https://www.asin.dev/docs). Python keywords get a trailing underscore (`from_=`), and the wire name is used on the request.
36
+
37
+ ## Async I/O
38
+
39
+ ```python
40
+ import asyncio
41
+
42
+ from asin import AsyncAsinClient
43
+
44
+
45
+ async def main() -> None:
46
+ async with AsyncAsinClient() as client:
47
+ response = await client.search_amazon(query="wireless earbuds")
48
+ print(response.data)
49
+
50
+
51
+ asyncio.run(main())
52
+ ```
53
+
54
+ ## HTTP methods
55
+
56
+ Each method uses the HTTP verb of its endpoint. `GET` and `DELETE` send parameters in the query string; `POST` and `PATCH` send them as a JSON body, except `wait` on `/products/{id}/check`, which stays in the query string. Null values are never sent, so `target_price` cannot be removed through the SDK yet.
57
+
58
+ `None` values are omitted, `False` and `0` are sent, and sequences repeat the parameter name.
59
+
60
+ ## Any endpoint
61
+
62
+ ```python
63
+ response = client.request("GET", "/account")
64
+ ```
65
+
66
+ ## Errors
67
+
68
+ ```python
69
+ from asin import AsinAPIError
70
+
71
+ try:
72
+ client.search_amazon(query="wireless earbuds")
73
+ except AsinAPIError as error:
74
+ print(error.status, error, error.response_body)
75
+ ```
76
+
77
+ | Error | When |
78
+ | --- | --- |
79
+ | `AsinConfigurationError` | Missing API key, invalid options, unsupported method, closed client. |
80
+ | `AsinSerializationError` | A required parameter is missing or a value can't be sent. |
81
+ | `AsinTransportError` | Network failure or timeout. |
82
+ | `AsinAPIError` | Non-2xx status (`status`, `error_message`, `response_body`, `raw_response`). |
83
+ | `AsinResponseDecodingError` | A success response could not be decoded. |
84
+
85
+ All of them extend `AsinError`.
86
+
87
+ ## Retries
88
+
89
+ Requests are retried up to 3 times after a network error, a `408`, `429`, `500`, `502`, `503` or `504`. Other statuses, such as `400`, `401`, `402` or `404`, and client-side timeouts are not retried. The delay starts at 1 second and grows 1.5× per retry (capped at 30 seconds); a `Retry-After` header wins.
90
+
91
+ ```python
92
+ client = AsinClient(max_retries=5, retry_delay=0.5)
93
+
94
+ # or for one request
95
+ client.search_amazon(query="wireless earbuds", request_options=RequestOptions(max_retries=0))
96
+ ```
97
+
98
+ ## Batch requests
99
+
100
+ `batch()` runs a function per item on 10 threads (`concurrency`) and returns one `BatchResult` per item, in input order. A failing item never stops the others. `AsyncAsinClient.batch()` does the same with `asyncio`.
101
+
102
+ ```python
103
+ inputs = ["wireless earbuds", "mechanical keyboard", "usb-c hub"]
104
+ results = client.batch(inputs, lambda query: client.search_amazon(query=query), concurrency=5)
105
+
106
+ for result in results:
107
+ if result.ok:
108
+ print(result.value.data)
109
+ else:
110
+ print(inputs[result.index], result.error)
111
+ ```
112
+
113
+ | Constant | Default | Description |
114
+ | --- | --- | --- |
115
+ | `DEFAULT_CONCURRENCY` | `10` | Tasks run at the same time by batch |
116
+ | `DEFAULT_TIMEOUT` | `120.0` | Request timeout (seconds) |
117
+ | `MAX_RETRIES` | `3` | Retry attempts after a network error, a 408/429/5xx |
118
+ | `RETRY_BACKOFF_FACTOR` | `1.5` | Exponential backoff multiplier |
119
+ | `DEFAULT_RETRY_DELAY` | `1.0` | Delay before the first retry (seconds) |
120
+
121
+ ## Timeouts and custom HTTPX clients
122
+
123
+ ```python
124
+ import httpx
125
+
126
+ from asin import AsinClient, RequestOptions
127
+
128
+ client = AsinClient(timeout=60) # seconds, default 120, None disables
129
+ client.search_amazon(query="wireless earbuds", request_options=RequestOptions(timeout=30))
130
+
131
+ # Bring your own HTTPX client (proxies, limits, event hooks…). You keep ownership of it.
132
+ http_client = httpx.Client(proxy="http://localhost:8080")
133
+ client = AsinClient(http_client=http_client)
134
+ ```
135
+
136
+ ## Endpoints
137
+
138
+ 11 methods, generated from the [OpenAPI document](https://www.asin.dev/openapi.json).
139
+
140
+ | Method | HTTP | Description |
141
+ | --- | --- | --- |
142
+ | `check_product()` | POST `/products/{id}/check` | Asks for a check right away (1 credit), at most once per 5 minutes; earlier calls return the product unchanged. A paused product has to be… |
143
+ | `delete_product()` | DELETE `/products/{id}` | Removes the product and its price history. |
144
+ | `fetch_offers()` | POST `/offers` | Reads the offers on Amazon for 1 credit, refunded if it doesn't answer. A read made in the last 3 hours, by anyone, is returned instead, fo… |
145
+ | `get_account()` | GET `/account` | Your plan, the credits left (monthly allowance and packs), how many products you track and the credits they use per month. |
146
+ | `get_asin_history()` | GET `/history` | Every price Asin read for an ASIN on a marketplace over the period, whoever tracks it, oldest first, with the lowest, highest and average o… |
147
+ | `get_offers()` | GET `/offers` | Who sells the product and at what price, as last read, cheapest first, with Amazon's own price and the cheapest new and used offers (used i… |
148
+ | `get_product()` | GET `/products/{id}` | The product's latest state and every price read of the period, oldest first. The history covers every read of this ASIN on this marketplace… |
149
+ | `list_products()` | GET `/products` | Your watchlist, newest first, with each product's latest state and its recent prices (trend). Filter with asin (and marketplace) to know if… |
150
+ | `search_amazon()` | GET `/search` | Amazon search results (up to 60, sponsored included), to find the ASIN of a product. Free, limited to 30 searches per hour. |
151
+ | `track_product()` | POST `/products` | Adds an ASIN, an Amazon link or a short link (amzn.to, a.co…) to your watchlist. The first check runs in the background within seconds (che… |
152
+ | `update_product()` | PATCH `/products/{id}` | Target price, drop alerts, check interval, or pause. Send only what changes. |
153
+
154
+ ## All Asin SDKs
155
+
156
+ | SDK | Package | Install |
157
+ | --- | --- | --- |
158
+ | Node.js | [`@asindev/sdk`](https://www.npmjs.com/package/@asindev/sdk) | `npm install @asindev/sdk` |
159
+ | Python | [`asindotdev`](https://pypi.org/project/asindotdev/) | `pip install asindotdev` |
160
+ | Go | [`asin-go`](https://pkg.go.dev/github.com/asindotdev/asin-go) | `go get github.com/asindotdev/asin-go` |
161
+ | .NET | [`Asin`](https://www.nuget.org/packages/Asin) | `dotnet add package Asin` |
162
+ | Ruby | [`asindotdev`](https://rubygems.org/gems/asindotdev) | `gem install asindotdev` |
163
+ | PHP | [`asindotdev/sdk`](https://packagist.org/packages/asindotdev/sdk) | `composer require asindotdev/sdk` |
164
+ | Java | [`asin-java`](https://github.com/asindotdev/asin-java) | build from source, see its README |
165
+ | CLI | [`@asindev/cli`](https://www.npmjs.com/package/@asindev/cli) | `npm install -g @asindev/cli` |
166
+ | MCP server | [`@asindev/mcp`](https://www.npmjs.com/package/@asindev/mcp) | `npx -y @asindev/mcp` |
167
+
168
+ ## License
169
+
170
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,11 @@
1
+ # Examples
2
+
3
+ ```sh
4
+ pip install asindotdev
5
+ export ASIN_API_KEY="YOUR_API_KEY"
6
+ python examples/json_response.py
7
+ ```
8
+
9
+ - `json_response.py` — call the featured endpoint and print the JSON result.
10
+ - `async_client.py` — use `AsyncAsinClient`.
11
+ - `any_endpoint.py` — call any path with `request()` and handle API errors.
@@ -0,0 +1,11 @@
1
+ """Call any path with request() and handle API errors."""
2
+
3
+ from asin import AsinAPIError, AsinClient, JsonResponse
4
+
5
+ with AsinClient() as client: # reads ASIN_API_KEY
6
+ try:
7
+ response = client.request("GET", "/account")
8
+ if isinstance(response, JsonResponse):
9
+ print(response.data)
10
+ except AsinAPIError as error:
11
+ print(f"HTTP {error.status}: {error}")
@@ -0,0 +1,14 @@
1
+ """Use the asyncio client."""
2
+
3
+ import asyncio
4
+
5
+ from asin import AsyncAsinClient
6
+
7
+
8
+ async def main() -> None:
9
+ async with AsyncAsinClient() as client: # reads ASIN_API_KEY
10
+ response = await client.search_amazon(query="wireless earbuds")
11
+ print(response.data)
12
+
13
+
14
+ asyncio.run(main())
@@ -0,0 +1,10 @@
1
+ """Call the featured endpoint and print the JSON result."""
2
+
3
+ import json
4
+ import os
5
+
6
+ from asin import AsinClient
7
+
8
+ with AsinClient(os.environ["ASIN_API_KEY"]) as client:
9
+ response = client.search_amazon(query="wireless earbuds")
10
+ print(json.dumps(response.data, indent=2))
@@ -0,0 +1,79 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.26,<2"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "asindotdev"
7
+ version = "0.1.0"
8
+ description = "Official Python SDK for the Asin Amazon price tracking API."
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [
14
+ { name = "Asin", email = "contact@asin.dev" },
15
+ ]
16
+ keywords = [
17
+ "amazon-api",
18
+ "price-tracking",
19
+ "price-history",
20
+ "asin",
21
+ "api",
22
+ "sdk",
23
+ "asin",
24
+ ]
25
+ classifiers = [
26
+ "Intended Audience :: Developers",
27
+ "Operating System :: OS Independent",
28
+ "Programming Language :: Python :: 3 :: Only",
29
+ "Programming Language :: Python :: 3.11",
30
+ "Programming Language :: Python :: 3.12",
31
+ "Programming Language :: Python :: 3.13",
32
+ "Programming Language :: Python :: 3.14",
33
+ "Topic :: Internet :: WWW/HTTP",
34
+ "Typing :: Typed",
35
+ ]
36
+ dependencies = [
37
+ "httpx>=0.27,<1",
38
+ ]
39
+
40
+ [project.optional-dependencies]
41
+ dev = [
42
+ "build>=1.2,<2",
43
+ "mypy>=1.13",
44
+ "pytest>=8.3",
45
+ "pytest-asyncio>=0.24",
46
+ "ruff>=0.8,<1",
47
+ ]
48
+
49
+ [project.urls]
50
+ Homepage = "https://www.asin.dev"
51
+ Documentation = "https://www.asin.dev/docs"
52
+ Repository = "https://github.com/asindotdev/asin-python"
53
+ Issues = "https://github.com/asindotdev/asin-python/issues"
54
+
55
+ [tool.hatch.build.targets.sdist]
56
+ include = ["/examples", "/src", "/tests", "/LICENSE", "/README.md", "/pyproject.toml"]
57
+
58
+ [tool.hatch.build.targets.wheel]
59
+ packages = ["src/asin"]
60
+
61
+ [tool.mypy]
62
+ python_version = "3.11"
63
+ strict = true
64
+ files = ["src", "tests", "examples"]
65
+
66
+ [tool.pytest.ini_options]
67
+ addopts = "-ra"
68
+ asyncio_mode = "strict"
69
+ asyncio_default_fixture_loop_scope = "function"
70
+ testpaths = ["tests"]
71
+
72
+ [tool.ruff]
73
+ target-version = "py311"
74
+ line-length = 100
75
+ src = ["src", "tests", "examples"]
76
+ extend-exclude = ["*.md"]
77
+
78
+ [tool.ruff.lint]
79
+ select = ["E4", "E7", "E9", "F", "I", "UP", "B"]
@@ -0,0 +1,59 @@
1
+ """Official Python SDK for the Asin API."""
2
+
3
+ from ._endpoints import ENDPOINTS
4
+ from ._version import __version__
5
+ from .client import (
6
+ DEFAULT_BASE_URL,
7
+ DEFAULT_CONCURRENCY,
8
+ DEFAULT_RETRY_DELAY,
9
+ DEFAULT_TIMEOUT,
10
+ MAX_RETRIES,
11
+ RETRY_BACKOFF_FACTOR,
12
+ AsinClient,
13
+ AsyncAsinClient,
14
+ )
15
+ from .errors import (
16
+ AsinAPIError,
17
+ AsinConfigurationError,
18
+ AsinError,
19
+ AsinResponseDecodingError,
20
+ AsinSerializationError,
21
+ AsinTransportError,
22
+ )
23
+ from .models import (
24
+ APIResponse,
25
+ BatchResult,
26
+ BinaryResponse,
27
+ EndpointDefinition,
28
+ HTTPMethod,
29
+ JsonResponse,
30
+ RawResponse,
31
+ RequestOptions,
32
+ )
33
+
34
+ __all__ = [
35
+ "APIResponse",
36
+ "AsyncAsinClient",
37
+ "BatchResult",
38
+ "BinaryResponse",
39
+ "DEFAULT_BASE_URL",
40
+ "DEFAULT_CONCURRENCY",
41
+ "DEFAULT_RETRY_DELAY",
42
+ "DEFAULT_TIMEOUT",
43
+ "MAX_RETRIES",
44
+ "RETRY_BACKOFF_FACTOR",
45
+ "ENDPOINTS",
46
+ "EndpointDefinition",
47
+ "HTTPMethod",
48
+ "JsonResponse",
49
+ "RawResponse",
50
+ "RequestOptions",
51
+ "AsinAPIError",
52
+ "AsinClient",
53
+ "AsinConfigurationError",
54
+ "AsinError",
55
+ "AsinResponseDecodingError",
56
+ "AsinSerializationError",
57
+ "AsinTransportError",
58
+ "__version__",
59
+ ]
@@ -0,0 +1,74 @@
1
+ """Generated from the Asin OpenAPI document. Do not edit by hand."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from .models import EndpointDefinition
6
+
7
+ ENDPOINTS: dict[str, EndpointDefinition] = {
8
+ "check_product": EndpointDefinition(
9
+ path="/products/{id}/check",
10
+ methods=("POST",),
11
+ response="json",
12
+ required=("id",),
13
+ ),
14
+ "delete_product": EndpointDefinition(
15
+ path="/products/{id}",
16
+ methods=("DELETE",),
17
+ response="json",
18
+ required=("id",),
19
+ ),
20
+ "fetch_offers": EndpointDefinition(
21
+ path="/offers",
22
+ methods=("POST",),
23
+ response="json",
24
+ required=("asin",),
25
+ ),
26
+ "get_account": EndpointDefinition(
27
+ path="/account",
28
+ methods=("GET",),
29
+ response="json",
30
+ required=(),
31
+ ),
32
+ "get_asin_history": EndpointDefinition(
33
+ path="/history",
34
+ methods=("GET",),
35
+ response="json",
36
+ required=("asin",),
37
+ ),
38
+ "get_offers": EndpointDefinition(
39
+ path="/offers",
40
+ methods=("GET",),
41
+ response="json",
42
+ required=("asin",),
43
+ ),
44
+ "get_product": EndpointDefinition(
45
+ path="/products/{id}",
46
+ methods=("GET",),
47
+ response="json",
48
+ required=("id",),
49
+ ),
50
+ "list_products": EndpointDefinition(
51
+ path="/products",
52
+ methods=("GET",),
53
+ response="json",
54
+ required=(),
55
+ ),
56
+ "search_amazon": EndpointDefinition(
57
+ path="/search",
58
+ methods=("GET",),
59
+ response="json",
60
+ required=("query",),
61
+ ),
62
+ "track_product": EndpointDefinition(
63
+ path="/products",
64
+ methods=("POST",),
65
+ response="json",
66
+ required=("product",),
67
+ ),
68
+ "update_product": EndpointDefinition(
69
+ path="/products/{id}",
70
+ methods=("PATCH",),
71
+ response="json",
72
+ required=("id",),
73
+ ),
74
+ }