decodo-sdk 2.4.1__tar.gz → 3.0.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.
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/PKG-INFO +10 -9
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/README.md +4 -7
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/pyproject.toml +7 -2
- decodo_sdk-3.0.0/src/decodo/_compat.py +20 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/codegen/web_scraping_api/generate_targets.py +1 -1
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/generated/decodo.ir.json +9 -92
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/generated/parameters.py +1 -1
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/generated/targets.py +5 -74
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/schema/types.py +3 -1
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/targets.py +1 -4
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo_sdk.egg-info/PKG-INFO +10 -9
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo_sdk.egg-info/SOURCES.txt +1 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo_sdk.egg-info/requires.txt +1 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/LICENSE +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/setup.cfg +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/__init__.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/api/__init__.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/api/web_scraping_api.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/client.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/codegen/__init__.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/codegen/codegen.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/codegen/web_scraping_api/__init__.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/codegen/web_scraping_api/generate_parameters.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/codegen/web_scraping_api/shared.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/codegen/web_scraping_api/types.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/errors.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/generated/__init__.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/http.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/py.typed +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/schema/__init__.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/schema/build_target_meta.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/schema/bundled_schema.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/schema/constants.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/schema/expand_path.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/schema/remote_schema.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/schema/resolve_latest_ir.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/types/__init__.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/types/data_api.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/types/requests.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/types/responses.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo_sdk.egg-info/dependency_links.txt +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo_sdk.egg-info/top_level.txt +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/tests/test_client.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/tests/test_data_api.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/tests/test_generated_exports.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/tests/test_http.py +0 -0
- {decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/tests/test_web_scraping_api.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: decodo-sdk
|
|
3
|
-
Version:
|
|
3
|
+
Version: 3.0.0
|
|
4
4
|
Summary: Official Python SDK for the Decodo APIs
|
|
5
5
|
Author: Decodo
|
|
6
6
|
License: MIT License
|
|
@@ -30,16 +30,20 @@ Project-URL: Documentation, https://help.decodo.com/docs/introduction
|
|
|
30
30
|
Project-URL: Repository, https://github.com/Decodo/sdk-python
|
|
31
31
|
Keywords: decodo,scraping,web-scraping,api
|
|
32
32
|
Classifier: Programming Language :: Python :: 3
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
33
35
|
Classifier: Programming Language :: Python :: 3.12
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
34
37
|
Classifier: License :: OSI Approved :: MIT License
|
|
35
38
|
Classifier: Intended Audience :: Developers
|
|
36
39
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
37
|
-
Requires-Python: >=3.
|
|
40
|
+
Requires-Python: >=3.10
|
|
38
41
|
Description-Content-Type: text/markdown
|
|
39
42
|
License-File: LICENSE
|
|
40
43
|
Requires-Dist: httpx>=0.27.0
|
|
41
44
|
Requires-Dist: pydantic>=2.0
|
|
42
45
|
Requires-Dist: jsonschema>=4.0
|
|
46
|
+
Requires-Dist: typing-extensions>=4.6
|
|
43
47
|
Provides-Extra: dev
|
|
44
48
|
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
45
49
|
Requires-Dist: pytest-mock>=3.14.0; extra == "dev"
|
|
@@ -50,7 +54,7 @@ Dynamic: license-file
|
|
|
50
54
|
|
|
51
55
|
# Decodo Python SDK
|
|
52
56
|
|
|
53
|
-

|
|
54
58
|

|
|
55
59
|
|
|
56
60
|
[](https://discord.gg/Ja8dqKgvbZ)
|
|
@@ -64,13 +68,13 @@ Build scraping workflows for search engines, eCommerce platforms, social media,
|
|
|
64
68
|
|
|
65
69
|
- Fully typed targets and parameters with IDE autocomplete
|
|
66
70
|
- Sync, async, and batch scraping methods
|
|
67
|
-
- Built on `httpx`, Python 3.
|
|
71
|
+
- Built on `httpx`, Python 3.10+
|
|
68
72
|
- Typed error hierarchy for safer integrations
|
|
69
73
|
- Built for Python and modern tooling
|
|
70
74
|
|
|
71
75
|
# What is Decodo Python SDK?
|
|
72
76
|
|
|
73
|
-
Decodo Python SDK is the official Python SDK for the Decodo Web Scraping API. It provides a typed interface for interacting with Decodo targets like Google, Amazon, TikTok,
|
|
77
|
+
Decodo Python SDK is the official Python SDK for the Decodo Web Scraping API. It provides a typed interface for interacting with Decodo targets like Google, Amazon, TikTok, YouTube, ChatGPT, Perplexity, and more.
|
|
74
78
|
|
|
75
79
|
Instead of manually constructing HTTP requests and validating payloads, you can work with fully typed methods and target-specific parameters directly in your editor.
|
|
76
80
|
|
|
@@ -84,7 +88,7 @@ Instead of manually constructing HTTP requests and validating payloads, you can
|
|
|
84
88
|
|
|
85
89
|
## Requirements
|
|
86
90
|
|
|
87
|
-
- Python 3.
|
|
91
|
+
- Python 3.10+
|
|
88
92
|
|
|
89
93
|
## Installation
|
|
90
94
|
|
|
@@ -621,9 +625,6 @@ Each target accepts one primary input parameter (`url`, `query`, `product_id`, o
|
|
|
621
625
|
|
|
622
626
|
| Target | Parameter class | Description | Example input |
|
|
623
627
|
| -------------------------------- | ------------------------------- | -------------------------------------- | --------------------------------------------- |
|
|
624
|
-
| `Target.RedditPost` | `RedditPostParams` | Reddit post by URL | `url="https://reddit.com/r/nba/comments/..."` |
|
|
625
|
-
| `Target.RedditSubreddit` | `RedditSubredditParams` | Reddit subreddit by URL | `url="https://reddit.com/r/nba/"` |
|
|
626
|
-
| `Target.RedditUser` | `RedditUserParams` | Reddit user profile by URL | `url="https://reddit.com/user/example/"` |
|
|
627
628
|
| `Target.YoutubeSearch` | `YoutubeSearchParams` | YouTube search results | `query="ambient music"` |
|
|
628
629
|
| `Target.YoutubeMetadata` | `YoutubeMetadataParams` | YouTube video metadata by ID | `query="dFu9aKJoqGg"` |
|
|
629
630
|
| `Target.YoutubeSubtitles` | `YoutubeSubtitlesParams` | YouTube video subtitles by ID | `query="dFu9aKJoqGg"` |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Decodo Python SDK
|
|
2
2
|
|
|
3
|
-

|
|
4
4
|

|
|
5
5
|
|
|
6
6
|
[](https://discord.gg/Ja8dqKgvbZ)
|
|
@@ -14,13 +14,13 @@ Build scraping workflows for search engines, eCommerce platforms, social media,
|
|
|
14
14
|
|
|
15
15
|
- Fully typed targets and parameters with IDE autocomplete
|
|
16
16
|
- Sync, async, and batch scraping methods
|
|
17
|
-
- Built on `httpx`, Python 3.
|
|
17
|
+
- Built on `httpx`, Python 3.10+
|
|
18
18
|
- Typed error hierarchy for safer integrations
|
|
19
19
|
- Built for Python and modern tooling
|
|
20
20
|
|
|
21
21
|
# What is Decodo Python SDK?
|
|
22
22
|
|
|
23
|
-
Decodo Python SDK is the official Python SDK for the Decodo Web Scraping API. It provides a typed interface for interacting with Decodo targets like Google, Amazon, TikTok,
|
|
23
|
+
Decodo Python SDK is the official Python SDK for the Decodo Web Scraping API. It provides a typed interface for interacting with Decodo targets like Google, Amazon, TikTok, YouTube, ChatGPT, Perplexity, and more.
|
|
24
24
|
|
|
25
25
|
Instead of manually constructing HTTP requests and validating payloads, you can work with fully typed methods and target-specific parameters directly in your editor.
|
|
26
26
|
|
|
@@ -34,7 +34,7 @@ Instead of manually constructing HTTP requests and validating payloads, you can
|
|
|
34
34
|
|
|
35
35
|
## Requirements
|
|
36
36
|
|
|
37
|
-
- Python 3.
|
|
37
|
+
- Python 3.10+
|
|
38
38
|
|
|
39
39
|
## Installation
|
|
40
40
|
|
|
@@ -571,9 +571,6 @@ Each target accepts one primary input parameter (`url`, `query`, `product_id`, o
|
|
|
571
571
|
|
|
572
572
|
| Target | Parameter class | Description | Example input |
|
|
573
573
|
| -------------------------------- | ------------------------------- | -------------------------------------- | --------------------------------------------- |
|
|
574
|
-
| `Target.RedditPost` | `RedditPostParams` | Reddit post by URL | `url="https://reddit.com/r/nba/comments/..."` |
|
|
575
|
-
| `Target.RedditSubreddit` | `RedditSubredditParams` | Reddit subreddit by URL | `url="https://reddit.com/r/nba/"` |
|
|
576
|
-
| `Target.RedditUser` | `RedditUserParams` | Reddit user profile by URL | `url="https://reddit.com/user/example/"` |
|
|
577
574
|
| `Target.YoutubeSearch` | `YoutubeSearchParams` | YouTube search results | `query="ambient music"` |
|
|
578
575
|
| `Target.YoutubeMetadata` | `YoutubeMetadataParams` | YouTube video metadata by ID | `query="dFu9aKJoqGg"` |
|
|
579
576
|
| `Target.YoutubeSubtitles` | `YoutubeSubtitlesParams` | YouTube video subtitles by ID | `query="dFu9aKJoqGg"` |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "decodo-sdk"
|
|
3
|
-
version = "
|
|
3
|
+
version = "3.0.0"
|
|
4
4
|
description = "Official Python SDK for the Decodo APIs"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = { file = "LICENSE" }
|
|
@@ -8,16 +8,20 @@ authors = [{ name = "Decodo" }]
|
|
|
8
8
|
keywords = ["decodo", "scraping", "web-scraping", "api"]
|
|
9
9
|
classifiers = [
|
|
10
10
|
"Programming Language :: Python :: 3",
|
|
11
|
+
"Programming Language :: Python :: 3.10",
|
|
12
|
+
"Programming Language :: Python :: 3.11",
|
|
11
13
|
"Programming Language :: Python :: 3.12",
|
|
14
|
+
"Programming Language :: Python :: 3.13",
|
|
12
15
|
"License :: OSI Approved :: MIT License",
|
|
13
16
|
"Intended Audience :: Developers",
|
|
14
17
|
"Topic :: Internet :: WWW/HTTP",
|
|
15
18
|
]
|
|
16
|
-
requires-python = ">=3.
|
|
19
|
+
requires-python = ">=3.10"
|
|
17
20
|
dependencies = [
|
|
18
21
|
"httpx>=0.27.0",
|
|
19
22
|
"pydantic>=2.0",
|
|
20
23
|
"jsonschema>=4.0",
|
|
24
|
+
"typing-extensions>=4.6",
|
|
21
25
|
]
|
|
22
26
|
|
|
23
27
|
[project.urls]
|
|
@@ -54,6 +58,7 @@ select = ["E", "F", "I", "UP"]
|
|
|
54
58
|
|
|
55
59
|
[tool.mypy]
|
|
56
60
|
strict = true
|
|
61
|
+
python_version = "3.10"
|
|
57
62
|
packages = ["decodo"]
|
|
58
63
|
exclude = "src/decodo/generated|^examples/|^build/"
|
|
59
64
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
from enum import Enum
|
|
5
|
+
|
|
6
|
+
if sys.version_info >= (3, 11):
|
|
7
|
+
from enum import StrEnum
|
|
8
|
+
else:
|
|
9
|
+
|
|
10
|
+
class StrEnum(str, Enum):
|
|
11
|
+
"""Backport of ``enum.StrEnum`` (3.11+): members are strings and ``str()`` gives the value."""
|
|
12
|
+
|
|
13
|
+
def __str__(self) -> str:
|
|
14
|
+
return str(self.value)
|
|
15
|
+
|
|
16
|
+
def __format__(self, format_spec: str) -> str:
|
|
17
|
+
return str.__format__(str(self.value), format_spec)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
__all__ = ["StrEnum"]
|
{decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/codegen/web_scraping_api/generate_targets.py
RENAMED
|
@@ -58,7 +58,7 @@ def _get_targets_enum_file_contents(api: WebScrapingApiIR) -> str:
|
|
|
58
58
|
lines.append("# Run `python -m decodo.codegen.codegen` to regenerate when the IR schema changes.")
|
|
59
59
|
lines.append("from __future__ import annotations")
|
|
60
60
|
lines.append("")
|
|
61
|
-
lines.append("from
|
|
61
|
+
lines.append("from decodo._compat import StrEnum")
|
|
62
62
|
lines.append("")
|
|
63
63
|
lines.append("")
|
|
64
64
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.5.0",
|
|
3
3
|
"apis": {
|
|
4
4
|
"webScrapingApi": {
|
|
5
5
|
"label": "Web Scraping API",
|
|
@@ -1541,6 +1541,9 @@
|
|
|
1541
1541
|
"markdown": {
|
|
1542
1542
|
"type": "boolean"
|
|
1543
1543
|
},
|
|
1544
|
+
"main_content": {
|
|
1545
|
+
"type": "boolean"
|
|
1546
|
+
},
|
|
1544
1547
|
"callback_url": {
|
|
1545
1548
|
"type": "string"
|
|
1546
1549
|
}
|
|
@@ -2011,96 +2014,6 @@
|
|
|
2011
2014
|
"additionalProperties": false
|
|
2012
2015
|
}
|
|
2013
2016
|
},
|
|
2014
|
-
"reddit_post": {
|
|
2015
|
-
"group": "Reddit",
|
|
2016
|
-
"response_format": "json",
|
|
2017
|
-
"parameter_schema": {
|
|
2018
|
-
"type": "object",
|
|
2019
|
-
"properties": {
|
|
2020
|
-
"target": {
|
|
2021
|
-
"const": "reddit_post"
|
|
2022
|
-
},
|
|
2023
|
-
"url": {
|
|
2024
|
-
"type": "string",
|
|
2025
|
-
"maxLength": 2056
|
|
2026
|
-
},
|
|
2027
|
-
"locale": {
|
|
2028
|
-
"type": "string"
|
|
2029
|
-
},
|
|
2030
|
-
"geo": {
|
|
2031
|
-
"type": "string"
|
|
2032
|
-
},
|
|
2033
|
-
"callback_url": {
|
|
2034
|
-
"type": "string"
|
|
2035
|
-
}
|
|
2036
|
-
},
|
|
2037
|
-
"required": [
|
|
2038
|
-
"target"
|
|
2039
|
-
],
|
|
2040
|
-
"additionalProperties": false
|
|
2041
|
-
}
|
|
2042
|
-
},
|
|
2043
|
-
"reddit_subreddit": {
|
|
2044
|
-
"group": "Reddit",
|
|
2045
|
-
"response_format": "json",
|
|
2046
|
-
"parameter_schema": {
|
|
2047
|
-
"type": "object",
|
|
2048
|
-
"properties": {
|
|
2049
|
-
"target": {
|
|
2050
|
-
"const": "reddit_subreddit"
|
|
2051
|
-
},
|
|
2052
|
-
"url": {
|
|
2053
|
-
"type": "string",
|
|
2054
|
-
"maxLength": 2056
|
|
2055
|
-
},
|
|
2056
|
-
"locale": {
|
|
2057
|
-
"type": "string"
|
|
2058
|
-
},
|
|
2059
|
-
"geo": {
|
|
2060
|
-
"type": "string"
|
|
2061
|
-
},
|
|
2062
|
-
"callback_url": {
|
|
2063
|
-
"type": "string"
|
|
2064
|
-
}
|
|
2065
|
-
},
|
|
2066
|
-
"required": [
|
|
2067
|
-
"target"
|
|
2068
|
-
],
|
|
2069
|
-
"additionalProperties": false
|
|
2070
|
-
}
|
|
2071
|
-
},
|
|
2072
|
-
"reddit_user": {
|
|
2073
|
-
"group": "Reddit",
|
|
2074
|
-
"response_format": "json",
|
|
2075
|
-
"parameter_schema": {
|
|
2076
|
-
"type": "object",
|
|
2077
|
-
"properties": {
|
|
2078
|
-
"target": {
|
|
2079
|
-
"const": "reddit_user"
|
|
2080
|
-
},
|
|
2081
|
-
"url": {
|
|
2082
|
-
"type": "string",
|
|
2083
|
-
"maxLength": 2056
|
|
2084
|
-
},
|
|
2085
|
-
"locale": {
|
|
2086
|
-
"type": "string"
|
|
2087
|
-
},
|
|
2088
|
-
"geo": {
|
|
2089
|
-
"type": "string"
|
|
2090
|
-
},
|
|
2091
|
-
"sort": {
|
|
2092
|
-
"type": "string"
|
|
2093
|
-
},
|
|
2094
|
-
"callback_url": {
|
|
2095
|
-
"type": "string"
|
|
2096
|
-
}
|
|
2097
|
-
},
|
|
2098
|
-
"required": [
|
|
2099
|
-
"target"
|
|
2100
|
-
],
|
|
2101
|
-
"additionalProperties": false
|
|
2102
|
-
}
|
|
2103
|
-
},
|
|
2104
2017
|
"youtube_metadata": {
|
|
2105
2018
|
"group": "YouTube",
|
|
2106
2019
|
"response_format": "json",
|
|
@@ -2469,7 +2382,7 @@
|
|
|
2469
2382
|
"method": "POST",
|
|
2470
2383
|
"path": "/v1/map",
|
|
2471
2384
|
"summary": "Discover the links on a site",
|
|
2472
|
-
"description": "Unknown fields are ignored. The rate limit is charged before the body is\nvalidated, so a malformed body still spends quota. Upstream failures are\nmapped: a vendor 401 or 403 becomes 401, a vendor
|
|
2385
|
+
"description": "Unknown fields are ignored. The rate limit is charged before the body is\nvalidated, so a malformed body still spends quota. Upstream failures are\nmapped: a vendor 401 or 403 becomes 401, a vendor 408 becomes 504, a vendor\n429 stays 429, any other vendor 4xx becomes 400 with the vendor's message,\nand 5xx becomes 502. A target page answering 404 or 410 becomes 422; any\nother non-2xx from the target becomes 502.\nLinks come from the page at url and from the site's sitemaps, found through\nthe Sitemap lines of robots.txt or, when robots.txt names none that can be\nread, at /sitemap.xml, /sitemap_index.xml or /wp-sitemap.xml. A missing\nrobots.txt is ignored. When a sitemap is an index, its child sitemaps are\nread too, nested indexes two levels deep, at most 25 sitemap files per\ncall, gzipped children included. Sitemaps that cannot be read are skipped\nand the rest is still returned, with a warning.",
|
|
2473
2386
|
"requestSchema": {
|
|
2474
2387
|
"type": "object",
|
|
2475
2388
|
"required": [
|
|
@@ -2610,6 +2523,10 @@
|
|
|
2610
2523
|
"skip"
|
|
2611
2524
|
]
|
|
2612
2525
|
},
|
|
2526
|
+
"warning": {
|
|
2527
|
+
"type": "string",
|
|
2528
|
+
"description": "Present when discovery was incomplete, for example the seed page or the sitemap could not be read, child sitemaps were skipped, or the sitemap file cap was hit. Absent when every source was read in full."
|
|
2529
|
+
},
|
|
2613
2530
|
"map_id": {
|
|
2614
2531
|
"type": "string"
|
|
2615
2532
|
},
|
|
@@ -57,11 +57,11 @@ parameter_meta: dict[str, ParameterMeta] = {
|
|
|
57
57
|
"cookies": ParameterMeta(type="object"),
|
|
58
58
|
"force_headers": ParameterMeta(type="boolean"),
|
|
59
59
|
"force_cookies": ParameterMeta(type="boolean"),
|
|
60
|
+
"main_content": ParameterMeta(type="boolean"),
|
|
60
61
|
"prompt": ParameterMeta(type="string", max_length=8192),
|
|
61
62
|
"search": ParameterMeta(type="boolean"),
|
|
62
63
|
"country": ParameterMeta(type="string"),
|
|
63
64
|
"user_agent_type": ParameterMeta(type="string"),
|
|
64
|
-
"sort": ParameterMeta(type="string"),
|
|
65
65
|
"360": ParameterMeta(type="boolean"),
|
|
66
66
|
"upload_date": ParameterMeta(type="string"),
|
|
67
67
|
"type": ParameterMeta(type="string"),
|
|
@@ -322,6 +322,7 @@ class UniversalParams(pydantic.BaseModel):
|
|
|
322
322
|
force_cookies: bool | None = None
|
|
323
323
|
xhr: bool | None = None
|
|
324
324
|
markdown: bool | None = None
|
|
325
|
+
main_content: bool | None = None
|
|
325
326
|
callback_url: str | None = None
|
|
326
327
|
|
|
327
328
|
class ChatgptParams(pydantic.BaseModel):
|
|
@@ -447,31 +448,6 @@ class TiktokParams(pydantic.BaseModel):
|
|
|
447
448
|
user_agent_type: str | None = None
|
|
448
449
|
callback_url: str | None = None
|
|
449
450
|
|
|
450
|
-
class RedditPostParams(pydantic.BaseModel):
|
|
451
|
-
model_config = pydantic.ConfigDict(populate_by_name=True, extra='forbid')
|
|
452
|
-
target: Literal[Target.RedditPost] = Target.RedditPost
|
|
453
|
-
url: str | None = None
|
|
454
|
-
locale: str | None = None
|
|
455
|
-
geo: str | None = None
|
|
456
|
-
callback_url: str | None = None
|
|
457
|
-
|
|
458
|
-
class RedditSubredditParams(pydantic.BaseModel):
|
|
459
|
-
model_config = pydantic.ConfigDict(populate_by_name=True, extra='forbid')
|
|
460
|
-
target: Literal[Target.RedditSubreddit] = Target.RedditSubreddit
|
|
461
|
-
url: str | None = None
|
|
462
|
-
locale: str | None = None
|
|
463
|
-
geo: str | None = None
|
|
464
|
-
callback_url: str | None = None
|
|
465
|
-
|
|
466
|
-
class RedditUserParams(pydantic.BaseModel):
|
|
467
|
-
model_config = pydantic.ConfigDict(populate_by_name=True, extra='forbid')
|
|
468
|
-
target: Literal[Target.RedditUser] = Target.RedditUser
|
|
469
|
-
url: str | None = None
|
|
470
|
-
locale: str | None = None
|
|
471
|
-
geo: str | None = None
|
|
472
|
-
sort: str | None = None
|
|
473
|
-
callback_url: str | None = None
|
|
474
|
-
|
|
475
451
|
class YoutubeMetadataParams(pydantic.BaseModel):
|
|
476
452
|
model_config = pydantic.ConfigDict(populate_by_name=True, extra='forbid')
|
|
477
453
|
target: Literal[Target.YoutubeMetadata] = Target.YoutubeMetadata
|
|
@@ -831,6 +807,7 @@ class UniversalBatchParams(pydantic.BaseModel):
|
|
|
831
807
|
force_cookies: bool | None = None
|
|
832
808
|
xhr: bool | None = None
|
|
833
809
|
markdown: bool | None = None
|
|
810
|
+
main_content: bool | None = None
|
|
834
811
|
callback_url: str | None = None
|
|
835
812
|
|
|
836
813
|
class ChatgptBatchParams(pydantic.BaseModel):
|
|
@@ -956,31 +933,6 @@ class TiktokBatchParams(pydantic.BaseModel):
|
|
|
956
933
|
user_agent_type: str | None = None
|
|
957
934
|
callback_url: str | None = None
|
|
958
935
|
|
|
959
|
-
class RedditPostBatchParams(pydantic.BaseModel):
|
|
960
|
-
model_config = pydantic.ConfigDict(populate_by_name=True, extra='forbid')
|
|
961
|
-
target: Literal[Target.RedditPost] = Target.RedditPost
|
|
962
|
-
url: list[str] | None = None
|
|
963
|
-
locale: str | None = None
|
|
964
|
-
geo: str | None = None
|
|
965
|
-
callback_url: str | None = None
|
|
966
|
-
|
|
967
|
-
class RedditSubredditBatchParams(pydantic.BaseModel):
|
|
968
|
-
model_config = pydantic.ConfigDict(populate_by_name=True, extra='forbid')
|
|
969
|
-
target: Literal[Target.RedditSubreddit] = Target.RedditSubreddit
|
|
970
|
-
url: list[str] | None = None
|
|
971
|
-
locale: str | None = None
|
|
972
|
-
geo: str | None = None
|
|
973
|
-
callback_url: str | None = None
|
|
974
|
-
|
|
975
|
-
class RedditUserBatchParams(pydantic.BaseModel):
|
|
976
|
-
model_config = pydantic.ConfigDict(populate_by_name=True, extra='forbid')
|
|
977
|
-
target: Literal[Target.RedditUser] = Target.RedditUser
|
|
978
|
-
url: list[str] | None = None
|
|
979
|
-
locale: str | None = None
|
|
980
|
-
geo: str | None = None
|
|
981
|
-
sort: str | None = None
|
|
982
|
-
callback_url: str | None = None
|
|
983
|
-
|
|
984
936
|
class YoutubeMetadataBatchParams(pydantic.BaseModel):
|
|
985
937
|
model_config = pydantic.ConfigDict(populate_by_name=True, extra='forbid')
|
|
986
938
|
target: Literal[Target.YoutubeMetadata] = Target.YoutubeMetadata
|
|
@@ -1129,7 +1081,7 @@ target_meta: dict[str, dict[str, Any]] = {
|
|
|
1129
1081
|
Target.Universal.value: {
|
|
1130
1082
|
"group": "Universal",
|
|
1131
1083
|
"response_format": "html",
|
|
1132
|
-
"parameters": ["url", "payload", "proxy_pool", "http_method", "headless", "geo", "locale", "device_type", "session_id", "successful_status_codes", "headers", "cookies", "force_headers", "force_cookies", "xhr", "markdown", "callback_url"],
|
|
1084
|
+
"parameters": ["url", "payload", "proxy_pool", "http_method", "headless", "geo", "locale", "device_type", "session_id", "successful_status_codes", "headers", "cookies", "force_headers", "force_cookies", "xhr", "markdown", "main_content", "callback_url"],
|
|
1133
1085
|
},
|
|
1134
1086
|
Target.Chatgpt.value: {
|
|
1135
1087
|
"group": "AI Tools",
|
|
@@ -1191,21 +1143,6 @@ target_meta: dict[str, dict[str, Any]] = {
|
|
|
1191
1143
|
"response_format": "html",
|
|
1192
1144
|
"parameters": ["url", "headless", "user_agent_type", "callback_url"],
|
|
1193
1145
|
},
|
|
1194
|
-
Target.RedditPost.value: {
|
|
1195
|
-
"group": "Reddit",
|
|
1196
|
-
"response_format": "json",
|
|
1197
|
-
"parameters": ["url", "locale", "geo", "callback_url"],
|
|
1198
|
-
},
|
|
1199
|
-
Target.RedditSubreddit.value: {
|
|
1200
|
-
"group": "Reddit",
|
|
1201
|
-
"response_format": "json",
|
|
1202
|
-
"parameters": ["url", "locale", "geo", "callback_url"],
|
|
1203
|
-
},
|
|
1204
|
-
Target.RedditUser.value: {
|
|
1205
|
-
"group": "Reddit",
|
|
1206
|
-
"response_format": "json",
|
|
1207
|
-
"parameters": ["url", "locale", "geo", "sort", "callback_url"],
|
|
1208
|
-
},
|
|
1209
1146
|
Target.YoutubeMetadata.value: {
|
|
1210
1147
|
"group": "YouTube",
|
|
1211
1148
|
"response_format": "json",
|
|
@@ -1229,12 +1166,12 @@ target_meta: dict[str, dict[str, Any]] = {
|
|
|
1229
1166
|
}
|
|
1230
1167
|
|
|
1231
1168
|
ScrapeRequest = Annotated[
|
|
1232
|
-
Union[GoogleSearchParams | GoogleTravelHotelsParams | GoogleParams | GoogleAiModeParams | GoogleAdsParams | GoogleLensParams | BingSearchParams | BingParams | AmazonProductParams | AmazonPricingParams | AmazonSearchParams | AmazonSellersParams | AmazonBestsellersParams | AmazonParams | WalmartProductParams | WalmartSearchParams | WalmartParams | TargetProductParams | TargetSearchParams | TargetStoreParams | UniversalParams | ChatgptParams | PerplexityParams | GeminiParams | BbbParams | AutotraderParams | MobileParams | AirbnbParams | AppleAppStoreParams | TiktokPostParams | TiktokShopSearchParams | TiktokShopProductParams | TiktokParams |
|
|
1169
|
+
Union[GoogleSearchParams | GoogleTravelHotelsParams | GoogleParams | GoogleAiModeParams | GoogleAdsParams | GoogleLensParams | BingSearchParams | BingParams | AmazonProductParams | AmazonPricingParams | AmazonSearchParams | AmazonSellersParams | AmazonBestsellersParams | AmazonParams | WalmartProductParams | WalmartSearchParams | WalmartParams | TargetProductParams | TargetSearchParams | TargetStoreParams | UniversalParams | ChatgptParams | PerplexityParams | GeminiParams | BbbParams | AutotraderParams | MobileParams | AirbnbParams | AppleAppStoreParams | TiktokPostParams | TiktokShopSearchParams | TiktokShopProductParams | TiktokParams | YoutubeMetadataParams | YoutubeSearchParams | YoutubeSubtitlesParams | YoutubeChannelParams],
|
|
1233
1170
|
pydantic.Field(discriminator='target'),
|
|
1234
1171
|
]
|
|
1235
1172
|
|
|
1236
1173
|
BatchRequest = Annotated[
|
|
1237
|
-
Union[GoogleSearchBatchParams | GoogleTravelHotelsBatchParams | GoogleBatchParams | GoogleAiModeBatchParams | GoogleAdsBatchParams | GoogleLensBatchParams | BingSearchBatchParams | BingBatchParams | AmazonProductBatchParams | AmazonPricingBatchParams | AmazonSearchBatchParams | AmazonSellersBatchParams | AmazonBestsellersBatchParams | AmazonBatchParams | WalmartProductBatchParams | WalmartSearchBatchParams | WalmartBatchParams | TargetProductBatchParams | TargetSearchBatchParams | TargetStoreBatchParams | UniversalBatchParams | ChatgptBatchParams | PerplexityBatchParams | GeminiBatchParams | BbbBatchParams | AutotraderBatchParams | MobileBatchParams | AirbnbBatchParams | AppleAppStoreBatchParams | TiktokPostBatchParams | TiktokShopSearchBatchParams | TiktokShopProductBatchParams | TiktokBatchParams |
|
|
1174
|
+
Union[GoogleSearchBatchParams | GoogleTravelHotelsBatchParams | GoogleBatchParams | GoogleAiModeBatchParams | GoogleAdsBatchParams | GoogleLensBatchParams | BingSearchBatchParams | BingBatchParams | AmazonProductBatchParams | AmazonPricingBatchParams | AmazonSearchBatchParams | AmazonSellersBatchParams | AmazonBestsellersBatchParams | AmazonBatchParams | WalmartProductBatchParams | WalmartSearchBatchParams | WalmartBatchParams | TargetProductBatchParams | TargetSearchBatchParams | TargetStoreBatchParams | UniversalBatchParams | ChatgptBatchParams | PerplexityBatchParams | GeminiBatchParams | BbbBatchParams | AutotraderBatchParams | MobileBatchParams | AirbnbBatchParams | AppleAppStoreBatchParams | TiktokPostBatchParams | TiktokShopSearchBatchParams | TiktokShopProductBatchParams | TiktokBatchParams | YoutubeMetadataBatchParams | YoutubeSearchBatchParams | YoutubeSubtitlesBatchParams | YoutubeChannelBatchParams],
|
|
1238
1175
|
pydantic.Field(discriminator='target'),
|
|
1239
1176
|
]
|
|
1240
1177
|
|
|
@@ -1272,9 +1209,6 @@ __all__ = [
|
|
|
1272
1209
|
"TiktokShopSearchParams",
|
|
1273
1210
|
"TiktokShopProductParams",
|
|
1274
1211
|
"TiktokParams",
|
|
1275
|
-
"RedditPostParams",
|
|
1276
|
-
"RedditSubredditParams",
|
|
1277
|
-
"RedditUserParams",
|
|
1278
1212
|
"YoutubeMetadataParams",
|
|
1279
1213
|
"YoutubeSearchParams",
|
|
1280
1214
|
"YoutubeSubtitlesParams",
|
|
@@ -1312,9 +1246,6 @@ __all__ = [
|
|
|
1312
1246
|
"TiktokShopSearchBatchParams",
|
|
1313
1247
|
"TiktokShopProductBatchParams",
|
|
1314
1248
|
"TiktokBatchParams",
|
|
1315
|
-
"RedditPostBatchParams",
|
|
1316
|
-
"RedditSubredditBatchParams",
|
|
1317
|
-
"RedditUserBatchParams",
|
|
1318
1249
|
"YoutubeMetadataBatchParams",
|
|
1319
1250
|
"YoutubeSearchBatchParams",
|
|
1320
1251
|
"YoutubeSubtitlesBatchParams",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Run `python -m decodo.codegen.codegen` to regenerate when the IR schema changes.
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from
|
|
5
|
+
from decodo._compat import StrEnum
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class Target(StrEnum):
|
|
@@ -39,9 +39,6 @@ class Target(StrEnum):
|
|
|
39
39
|
TiktokShopSearch = "tiktok_shop_search"
|
|
40
40
|
TiktokShopProduct = "tiktok_shop_product"
|
|
41
41
|
Tiktok = "tiktok"
|
|
42
|
-
RedditPost = "reddit_post"
|
|
43
|
-
RedditSubreddit = "reddit_subreddit"
|
|
44
|
-
RedditUser = "reddit_user"
|
|
45
42
|
YoutubeMetadata = "youtube_metadata"
|
|
46
43
|
YoutubeSearch = "youtube_search"
|
|
47
44
|
YoutubeSubtitles = "youtube_subtitles"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: decodo-sdk
|
|
3
|
-
Version:
|
|
3
|
+
Version: 3.0.0
|
|
4
4
|
Summary: Official Python SDK for the Decodo APIs
|
|
5
5
|
Author: Decodo
|
|
6
6
|
License: MIT License
|
|
@@ -30,16 +30,20 @@ Project-URL: Documentation, https://help.decodo.com/docs/introduction
|
|
|
30
30
|
Project-URL: Repository, https://github.com/Decodo/sdk-python
|
|
31
31
|
Keywords: decodo,scraping,web-scraping,api
|
|
32
32
|
Classifier: Programming Language :: Python :: 3
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
33
35
|
Classifier: Programming Language :: Python :: 3.12
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
34
37
|
Classifier: License :: OSI Approved :: MIT License
|
|
35
38
|
Classifier: Intended Audience :: Developers
|
|
36
39
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
37
|
-
Requires-Python: >=3.
|
|
40
|
+
Requires-Python: >=3.10
|
|
38
41
|
Description-Content-Type: text/markdown
|
|
39
42
|
License-File: LICENSE
|
|
40
43
|
Requires-Dist: httpx>=0.27.0
|
|
41
44
|
Requires-Dist: pydantic>=2.0
|
|
42
45
|
Requires-Dist: jsonschema>=4.0
|
|
46
|
+
Requires-Dist: typing-extensions>=4.6
|
|
43
47
|
Provides-Extra: dev
|
|
44
48
|
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
45
49
|
Requires-Dist: pytest-mock>=3.14.0; extra == "dev"
|
|
@@ -50,7 +54,7 @@ Dynamic: license-file
|
|
|
50
54
|
|
|
51
55
|
# Decodo Python SDK
|
|
52
56
|
|
|
53
|
-

|
|
54
58
|

|
|
55
59
|
|
|
56
60
|
[](https://discord.gg/Ja8dqKgvbZ)
|
|
@@ -64,13 +68,13 @@ Build scraping workflows for search engines, eCommerce platforms, social media,
|
|
|
64
68
|
|
|
65
69
|
- Fully typed targets and parameters with IDE autocomplete
|
|
66
70
|
- Sync, async, and batch scraping methods
|
|
67
|
-
- Built on `httpx`, Python 3.
|
|
71
|
+
- Built on `httpx`, Python 3.10+
|
|
68
72
|
- Typed error hierarchy for safer integrations
|
|
69
73
|
- Built for Python and modern tooling
|
|
70
74
|
|
|
71
75
|
# What is Decodo Python SDK?
|
|
72
76
|
|
|
73
|
-
Decodo Python SDK is the official Python SDK for the Decodo Web Scraping API. It provides a typed interface for interacting with Decodo targets like Google, Amazon, TikTok,
|
|
77
|
+
Decodo Python SDK is the official Python SDK for the Decodo Web Scraping API. It provides a typed interface for interacting with Decodo targets like Google, Amazon, TikTok, YouTube, ChatGPT, Perplexity, and more.
|
|
74
78
|
|
|
75
79
|
Instead of manually constructing HTTP requests and validating payloads, you can work with fully typed methods and target-specific parameters directly in your editor.
|
|
76
80
|
|
|
@@ -84,7 +88,7 @@ Instead of manually constructing HTTP requests and validating payloads, you can
|
|
|
84
88
|
|
|
85
89
|
## Requirements
|
|
86
90
|
|
|
87
|
-
- Python 3.
|
|
91
|
+
- Python 3.10+
|
|
88
92
|
|
|
89
93
|
## Installation
|
|
90
94
|
|
|
@@ -621,9 +625,6 @@ Each target accepts one primary input parameter (`url`, `query`, `product_id`, o
|
|
|
621
625
|
|
|
622
626
|
| Target | Parameter class | Description | Example input |
|
|
623
627
|
| -------------------------------- | ------------------------------- | -------------------------------------- | --------------------------------------------- |
|
|
624
|
-
| `Target.RedditPost` | `RedditPostParams` | Reddit post by URL | `url="https://reddit.com/r/nba/comments/..."` |
|
|
625
|
-
| `Target.RedditSubreddit` | `RedditSubredditParams` | Reddit subreddit by URL | `url="https://reddit.com/r/nba/"` |
|
|
626
|
-
| `Target.RedditUser` | `RedditUserParams` | Reddit user profile by URL | `url="https://reddit.com/user/example/"` |
|
|
627
628
|
| `Target.YoutubeSearch` | `YoutubeSearchParams` | YouTube search results | `query="ambient music"` |
|
|
628
629
|
| `Target.YoutubeMetadata` | `YoutubeMetadataParams` | YouTube video metadata by ID | `query="dFu9aKJoqGg"` |
|
|
629
630
|
| `Target.YoutubeSubtitles` | `YoutubeSubtitlesParams` | YouTube video subtitles by ID | `query="dFu9aKJoqGg"` |
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{decodo_sdk-2.4.1 → decodo_sdk-3.0.0}/src/decodo/codegen/web_scraping_api/generate_parameters.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|