huntapi 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
huntapi-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 HuntAPI
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.
huntapi-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,201 @@
1
+ Metadata-Version: 2.5
2
+ Name: huntapi
3
+ Version: 0.1.0
4
+ Summary: Official Python SDK for the HuntAPI media download API.
5
+ Project-URL: Homepage, https://www.huntapi.com
6
+ Project-URL: Documentation, https://docs.huntapi.com
7
+ Project-URL: Repository, https://github.com/huntapi/huntapi-python
8
+ Project-URL: Issues, https://github.com/huntapi/huntapi-python/issues
9
+ Author-email: HuntAPI <contact@huntapi.com>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: api,async-api,audio-download-api,huntapi,media-metadata,sdk,video-download-api
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
+ # HuntAPI Python SDK
33
+
34
+ The official Python SDK for the [HuntAPI](https://www.huntapi.com) media download API.
35
+
36
+ Download video and audio from public media URLs, or extract their metadata, with one async REST API.
37
+
38
+ The SDK exposes **6 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 huntapi
48
+ ```
49
+
50
+ ## Get your API key
51
+
52
+ [Sign up for HuntAPI](https://app.huntapi.com/register) or sign in, then copy your API key from the [dashboard](https://app.huntapi.com). The client reads the `HUNTAPI_API_KEY` environment variable when no key is passed.
53
+
54
+ ## Quick start
55
+
56
+ ```python
57
+ import os
58
+
59
+ from huntapi import HuntApiClient
60
+
61
+ with HuntApiClient(os.environ["HUNTAPI_API_KEY"]) as client:
62
+ response = client.media_metadata(query="https://www.youtube.com/watch?v=Z5YP8kznWZs")
63
+ print(response.data)
64
+ ```
65
+
66
+ Keyword arguments mirror the [API reference](https://docs.huntapi.com). Python keywords get a trailing underscore (`from_=`), and the wire name is used on the request.
67
+
68
+ ## Async jobs
69
+
70
+ Download endpoints are asynchronous: they return a `job_id`, and jobs can run for up to 12 hours. `wait_for_job()` polls `GET /v1/jobs/{id}` until the job reaches a terminal status (`CompletedJob`, `Error`, `NotFound`, `BadRequest`):
71
+
72
+ ```python
73
+ submitted = client.video_download(query="https://www.youtube.com/watch?v=Z5YP8kznWZs", video_quality="720p")
74
+ job = client.wait_for_job(
75
+ submitted.data["job_id"],
76
+ on_progress=lambda j: print(j["status"], j.get("progress")),
77
+ )
78
+ print(job.data)
79
+ ```
80
+
81
+ ## Async I/O
82
+
83
+ ```python
84
+ import asyncio
85
+
86
+ from huntapi import AsyncHuntApiClient
87
+
88
+
89
+ async def main() -> None:
90
+ async with AsyncHuntApiClient() as client:
91
+ response = await client.media_metadata(query="https://www.youtube.com/watch?v=Z5YP8kznWZs")
92
+ print(response.data)
93
+
94
+
95
+ asyncio.run(main())
96
+ ```
97
+
98
+ ## GET or POST
99
+
100
+ Methods use GET when the endpoint supports it (parameters in the query string). POST sends the same parameters as a JSON body:
101
+
102
+ ```python
103
+ from huntapi import RequestOptions
104
+
105
+ client.audio_download(query="test", request_options=RequestOptions(method="POST"))
106
+ ```
107
+
108
+ `None` values are omitted, `False` and `0` are sent, and sequences repeat the parameter name.
109
+
110
+ ## Any endpoint
111
+
112
+ ```python
113
+ response = client.request("GET", "/v1/usage")
114
+ ```
115
+
116
+ ## Errors
117
+
118
+ ```python
119
+ from huntapi import HuntApiAPIError
120
+
121
+ try:
122
+ client.media_metadata(query="https://www.youtube.com/watch?v=Z5YP8kznWZs")
123
+ except HuntApiAPIError as error:
124
+ print(error.status, error, error.response_body)
125
+ ```
126
+
127
+ | Error | When |
128
+ | --- | --- |
129
+ | `HuntApiConfigurationError` | Missing API key, invalid options, unsupported method, closed client. |
130
+ | `HuntApiSerializationError` | A required parameter is missing or a value can't be sent. |
131
+ | `HuntApiTransportError` | Network failure or timeout. |
132
+ | `HuntApiAPIError` | Non-2xx status (`status`, `error_message`, `response_body`, `raw_response`). |
133
+ | `HuntApiResponseDecodingError` | A success response could not be decoded. |
134
+
135
+ All of them extend `HuntApiError`.
136
+
137
+ ## Retries
138
+
139
+ Requests are retried up to 3 times after a network error, a `408`, `500`, `502`, `503` or `504`, or a rate limit — which the API returns as `401` (or `429`) with a `Rate limit exceeded` message. Per-key quota errors (`…: quota daily`) are not retried, nor are `400`, `402`, `404` or client-side timeouts. The delay starts at 1 second and grows 1.5× per retry (capped at 30 seconds); a `Retry-After` header wins.
140
+
141
+ ```python
142
+ client = HuntApiClient(max_retries=5, retry_delay=0.5)
143
+
144
+ # or for one request
145
+ client.media_metadata(query="https://www.youtube.com/watch?v=Z5YP8kznWZs", request_options=RequestOptions(max_retries=0))
146
+ ```
147
+
148
+ ## Batch requests
149
+
150
+ `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. `AsyncHuntApiClient.batch()` does the same with `asyncio`.
151
+
152
+ ```python
153
+ inputs = ["https://www.youtube.com/watch?v=Z5YP8kznWZs", "https://www.youtube.com/watch?v=jNQXAC9IVRw"]
154
+ results = client.batch(inputs, lambda query: client.media_metadata(query=query), concurrency=5)
155
+
156
+ for result in results:
157
+ if result.ok:
158
+ print(result.value.data)
159
+ else:
160
+ print(inputs[result.index], result.error)
161
+ ```
162
+
163
+ | Constant | Default | Description |
164
+ | --- | --- | --- |
165
+ | `DEFAULT_CONCURRENCY` | `10` | Tasks run at the same time by batch |
166
+ | `DEFAULT_TIMEOUT` | `120.0` | Request timeout (seconds) |
167
+ | `MAX_RETRIES` | `3` | Retry attempts after a network error, a 408/5xx or a rate limit |
168
+ | `RETRY_BACKOFF_FACTOR` | `1.5` | Exponential backoff multiplier |
169
+ | `DEFAULT_RETRY_DELAY` | `1.0` | Delay before the first retry (seconds) |
170
+
171
+ ## Timeouts and custom HTTPX clients
172
+
173
+ ```python
174
+ import httpx
175
+
176
+ from huntapi import HuntApiClient, RequestOptions
177
+
178
+ client = HuntApiClient(timeout=60) # seconds, default 120, None disables
179
+ client.media_metadata(query="https://www.youtube.com/watch?v=Z5YP8kznWZs", request_options=RequestOptions(timeout=30))
180
+
181
+ # Bring your own HTTPX client (proxies, limits, event hooks…). You keep ownership of it.
182
+ http_client = httpx.Client(proxy="http://localhost:8080")
183
+ client = HuntApiClient(http_client=http_client)
184
+ ```
185
+
186
+ ## Endpoints
187
+
188
+ 6 methods, generated from the [OpenAPI document](https://app.huntapi.com/openapi).
189
+
190
+ | Method | HTTP | Description |
191
+ | --- | --- | --- |
192
+ | `audio_download()` | GET / POST `/v1/audio/download` | Download audio from a URL via HuntAPI and receive a job id. |
193
+ | `jobs()` | GET `/v1/jobs/{id}` | Poll status, progress (0–100), and result of an async HuntAPI job. |
194
+ | `media_metadata()` | GET `/v1/media/metadata` | Extract metadata from a media URL without downloading the file. |
195
+ | `stats()` | GET `/v1/stats` | Infrastructure health for an engine or endpoint over the last hour. Not scoped to your account or tenant. Enabled per account: HTTP 403 mea… |
196
+ | `usage()` | GET `/v1/usage` | Retrieve real-time usage statistics and credit balance for your Huntapi account. |
197
+ | `video_download()` | GET / POST `/v1/video/download` | Video Download |
198
+
199
+ ## License
200
+
201
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,170 @@
1
+ # HuntAPI Python SDK
2
+
3
+ The official Python SDK for the [HuntAPI](https://www.huntapi.com) media download API.
4
+
5
+ Download video and audio from public media URLs, or extract their metadata, with one async REST API.
6
+
7
+ The SDK exposes **6 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 huntapi
17
+ ```
18
+
19
+ ## Get your API key
20
+
21
+ [Sign up for HuntAPI](https://app.huntapi.com/register) or sign in, then copy your API key from the [dashboard](https://app.huntapi.com). The client reads the `HUNTAPI_API_KEY` environment variable when no key is passed.
22
+
23
+ ## Quick start
24
+
25
+ ```python
26
+ import os
27
+
28
+ from huntapi import HuntApiClient
29
+
30
+ with HuntApiClient(os.environ["HUNTAPI_API_KEY"]) as client:
31
+ response = client.media_metadata(query="https://www.youtube.com/watch?v=Z5YP8kznWZs")
32
+ print(response.data)
33
+ ```
34
+
35
+ Keyword arguments mirror the [API reference](https://docs.huntapi.com). Python keywords get a trailing underscore (`from_=`), and the wire name is used on the request.
36
+
37
+ ## Async jobs
38
+
39
+ Download endpoints are asynchronous: they return a `job_id`, and jobs can run for up to 12 hours. `wait_for_job()` polls `GET /v1/jobs/{id}` until the job reaches a terminal status (`CompletedJob`, `Error`, `NotFound`, `BadRequest`):
40
+
41
+ ```python
42
+ submitted = client.video_download(query="https://www.youtube.com/watch?v=Z5YP8kznWZs", video_quality="720p")
43
+ job = client.wait_for_job(
44
+ submitted.data["job_id"],
45
+ on_progress=lambda j: print(j["status"], j.get("progress")),
46
+ )
47
+ print(job.data)
48
+ ```
49
+
50
+ ## Async I/O
51
+
52
+ ```python
53
+ import asyncio
54
+
55
+ from huntapi import AsyncHuntApiClient
56
+
57
+
58
+ async def main() -> None:
59
+ async with AsyncHuntApiClient() as client:
60
+ response = await client.media_metadata(query="https://www.youtube.com/watch?v=Z5YP8kznWZs")
61
+ print(response.data)
62
+
63
+
64
+ asyncio.run(main())
65
+ ```
66
+
67
+ ## GET or POST
68
+
69
+ Methods use GET when the endpoint supports it (parameters in the query string). POST sends the same parameters as a JSON body:
70
+
71
+ ```python
72
+ from huntapi import RequestOptions
73
+
74
+ client.audio_download(query="test", request_options=RequestOptions(method="POST"))
75
+ ```
76
+
77
+ `None` values are omitted, `False` and `0` are sent, and sequences repeat the parameter name.
78
+
79
+ ## Any endpoint
80
+
81
+ ```python
82
+ response = client.request("GET", "/v1/usage")
83
+ ```
84
+
85
+ ## Errors
86
+
87
+ ```python
88
+ from huntapi import HuntApiAPIError
89
+
90
+ try:
91
+ client.media_metadata(query="https://www.youtube.com/watch?v=Z5YP8kznWZs")
92
+ except HuntApiAPIError as error:
93
+ print(error.status, error, error.response_body)
94
+ ```
95
+
96
+ | Error | When |
97
+ | --- | --- |
98
+ | `HuntApiConfigurationError` | Missing API key, invalid options, unsupported method, closed client. |
99
+ | `HuntApiSerializationError` | A required parameter is missing or a value can't be sent. |
100
+ | `HuntApiTransportError` | Network failure or timeout. |
101
+ | `HuntApiAPIError` | Non-2xx status (`status`, `error_message`, `response_body`, `raw_response`). |
102
+ | `HuntApiResponseDecodingError` | A success response could not be decoded. |
103
+
104
+ All of them extend `HuntApiError`.
105
+
106
+ ## Retries
107
+
108
+ Requests are retried up to 3 times after a network error, a `408`, `500`, `502`, `503` or `504`, or a rate limit — which the API returns as `401` (or `429`) with a `Rate limit exceeded` message. Per-key quota errors (`…: quota daily`) are not retried, nor are `400`, `402`, `404` or client-side timeouts. The delay starts at 1 second and grows 1.5× per retry (capped at 30 seconds); a `Retry-After` header wins.
109
+
110
+ ```python
111
+ client = HuntApiClient(max_retries=5, retry_delay=0.5)
112
+
113
+ # or for one request
114
+ client.media_metadata(query="https://www.youtube.com/watch?v=Z5YP8kznWZs", request_options=RequestOptions(max_retries=0))
115
+ ```
116
+
117
+ ## Batch requests
118
+
119
+ `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. `AsyncHuntApiClient.batch()` does the same with `asyncio`.
120
+
121
+ ```python
122
+ inputs = ["https://www.youtube.com/watch?v=Z5YP8kznWZs", "https://www.youtube.com/watch?v=jNQXAC9IVRw"]
123
+ results = client.batch(inputs, lambda query: client.media_metadata(query=query), concurrency=5)
124
+
125
+ for result in results:
126
+ if result.ok:
127
+ print(result.value.data)
128
+ else:
129
+ print(inputs[result.index], result.error)
130
+ ```
131
+
132
+ | Constant | Default | Description |
133
+ | --- | --- | --- |
134
+ | `DEFAULT_CONCURRENCY` | `10` | Tasks run at the same time by batch |
135
+ | `DEFAULT_TIMEOUT` | `120.0` | Request timeout (seconds) |
136
+ | `MAX_RETRIES` | `3` | Retry attempts after a network error, a 408/5xx or a rate limit |
137
+ | `RETRY_BACKOFF_FACTOR` | `1.5` | Exponential backoff multiplier |
138
+ | `DEFAULT_RETRY_DELAY` | `1.0` | Delay before the first retry (seconds) |
139
+
140
+ ## Timeouts and custom HTTPX clients
141
+
142
+ ```python
143
+ import httpx
144
+
145
+ from huntapi import HuntApiClient, RequestOptions
146
+
147
+ client = HuntApiClient(timeout=60) # seconds, default 120, None disables
148
+ client.media_metadata(query="https://www.youtube.com/watch?v=Z5YP8kznWZs", request_options=RequestOptions(timeout=30))
149
+
150
+ # Bring your own HTTPX client (proxies, limits, event hooks…). You keep ownership of it.
151
+ http_client = httpx.Client(proxy="http://localhost:8080")
152
+ client = HuntApiClient(http_client=http_client)
153
+ ```
154
+
155
+ ## Endpoints
156
+
157
+ 6 methods, generated from the [OpenAPI document](https://app.huntapi.com/openapi).
158
+
159
+ | Method | HTTP | Description |
160
+ | --- | --- | --- |
161
+ | `audio_download()` | GET / POST `/v1/audio/download` | Download audio from a URL via HuntAPI and receive a job id. |
162
+ | `jobs()` | GET `/v1/jobs/{id}` | Poll status, progress (0–100), and result of an async HuntAPI job. |
163
+ | `media_metadata()` | GET `/v1/media/metadata` | Extract metadata from a media URL without downloading the file. |
164
+ | `stats()` | GET `/v1/stats` | Infrastructure health for an engine or endpoint over the last hour. Not scoped to your account or tenant. Enabled per account: HTTP 403 mea… |
165
+ | `usage()` | GET `/v1/usage` | Retrieve real-time usage statistics and credit balance for your Huntapi account. |
166
+ | `video_download()` | GET / POST `/v1/video/download` | Video Download |
167
+
168
+ ## License
169
+
170
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,12 @@
1
+ # Examples
2
+
3
+ ```sh
4
+ pip install huntapi
5
+ export HUNTAPI_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 `AsyncHuntApiClient`.
11
+ - `any_endpoint.py` — call any path with `request()` and handle API errors.
12
+ - `wait_for_job.py` — start an async job and wait for its result.
@@ -0,0 +1,11 @@
1
+ """Call any path with request() and handle API errors."""
2
+
3
+ from huntapi import HuntApiAPIError, HuntApiClient, JsonResponse
4
+
5
+ with HuntApiClient() as client: # reads HUNTAPI_API_KEY
6
+ try:
7
+ response = client.request("GET", "/v1/usage")
8
+ if isinstance(response, JsonResponse):
9
+ print(response.data)
10
+ except HuntApiAPIError 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 huntapi import AsyncHuntApiClient
6
+
7
+
8
+ async def main() -> None:
9
+ async with AsyncHuntApiClient() as client: # reads HUNTAPI_API_KEY
10
+ response = await client.media_metadata(query="https://www.youtube.com/watch?v=Z5YP8kznWZs")
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 huntapi import HuntApiClient
7
+
8
+ with HuntApiClient(os.environ["HUNTAPI_API_KEY"]) as client:
9
+ response = client.media_metadata(query="https://www.youtube.com/watch?v=Z5YP8kznWZs")
10
+ print(json.dumps(response.data, indent=2))
@@ -0,0 +1,13 @@
1
+ """Start an async job and wait for its result."""
2
+
3
+ from huntapi import HuntApiClient
4
+
5
+ with HuntApiClient() as client: # reads HUNTAPI_API_KEY
6
+ submitted = client.video_download(
7
+ query="https://www.youtube.com/watch?v=Z5YP8kznWZs", video_quality="720p"
8
+ )
9
+ job = client.wait_for_job(
10
+ submitted.data["job_id"],
11
+ on_progress=lambda j: print(j["status"], j.get("progress")),
12
+ )
13
+ print(job.data)
@@ -0,0 +1,79 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.26,<2"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "huntapi"
7
+ version = "0.1.0"
8
+ description = "Official Python SDK for the HuntAPI media download API."
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [
14
+ { name = "HuntAPI", email = "contact@huntapi.com" },
15
+ ]
16
+ keywords = [
17
+ "video-download-api",
18
+ "audio-download-api",
19
+ "media-metadata",
20
+ "async-api",
21
+ "api",
22
+ "sdk",
23
+ "huntapi",
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.huntapi.com"
51
+ Documentation = "https://docs.huntapi.com"
52
+ Repository = "https://github.com/huntapi/huntapi-python"
53
+ Issues = "https://github.com/huntapi/huntapi-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/huntapi"]
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,61 @@
1
+ """Official Python SDK for the HuntAPI 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
+ AsyncHuntApiClient,
13
+ HuntApiClient,
14
+ )
15
+ from .errors import (
16
+ HuntApiAPIError,
17
+ HuntApiConfigurationError,
18
+ HuntApiError,
19
+ HuntApiJobTimeoutError,
20
+ HuntApiResponseDecodingError,
21
+ HuntApiSerializationError,
22
+ HuntApiTransportError,
23
+ )
24
+ from .models import (
25
+ APIResponse,
26
+ BatchResult,
27
+ BinaryResponse,
28
+ EndpointDefinition,
29
+ HTTPMethod,
30
+ JsonResponse,
31
+ RawResponse,
32
+ RequestOptions,
33
+ )
34
+
35
+ __all__ = [
36
+ "APIResponse",
37
+ "AsyncHuntApiClient",
38
+ "BatchResult",
39
+ "BinaryResponse",
40
+ "DEFAULT_BASE_URL",
41
+ "DEFAULT_CONCURRENCY",
42
+ "DEFAULT_RETRY_DELAY",
43
+ "DEFAULT_TIMEOUT",
44
+ "MAX_RETRIES",
45
+ "RETRY_BACKOFF_FACTOR",
46
+ "ENDPOINTS",
47
+ "EndpointDefinition",
48
+ "HTTPMethod",
49
+ "JsonResponse",
50
+ "RawResponse",
51
+ "RequestOptions",
52
+ "HuntApiAPIError",
53
+ "HuntApiClient",
54
+ "HuntApiConfigurationError",
55
+ "HuntApiError",
56
+ "HuntApiJobTimeoutError",
57
+ "HuntApiResponseDecodingError",
58
+ "HuntApiSerializationError",
59
+ "HuntApiTransportError",
60
+ "__version__",
61
+ ]
@@ -0,0 +1,50 @@
1
+ """Generated from the HuntAPI 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
+ "audio_download": EndpointDefinition(
9
+ path="/v1/audio/download",
10
+ methods=(
11
+ "GET",
12
+ "POST",
13
+ ),
14
+ response="json",
15
+ required=("query",),
16
+ ),
17
+ "jobs": EndpointDefinition(
18
+ path="/v1/jobs/{id}",
19
+ methods=("GET",),
20
+ response="json",
21
+ required=("id",),
22
+ ),
23
+ "media_metadata": EndpointDefinition(
24
+ path="/v1/media/metadata",
25
+ methods=("GET",),
26
+ response="json",
27
+ required=("query",),
28
+ ),
29
+ "stats": EndpointDefinition(
30
+ path="/v1/stats",
31
+ methods=("GET",),
32
+ response="json",
33
+ required=(),
34
+ ),
35
+ "usage": EndpointDefinition(
36
+ path="/v1/usage",
37
+ methods=("GET",),
38
+ response="json",
39
+ required=(),
40
+ ),
41
+ "video_download": EndpointDefinition(
42
+ path="/v1/video/download",
43
+ methods=(
44
+ "GET",
45
+ "POST",
46
+ ),
47
+ response="json",
48
+ required=("query",),
49
+ ),
50
+ }