cleanedweb 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.
- cleanedweb-0.1.0/.gitignore +12 -0
- cleanedweb-0.1.0/CHANGELOG.md +10 -0
- cleanedweb-0.1.0/LICENSE +21 -0
- cleanedweb-0.1.0/PKG-INFO +123 -0
- cleanedweb-0.1.0/README.md +91 -0
- cleanedweb-0.1.0/pyproject.toml +65 -0
- cleanedweb-0.1.0/src/cleanedweb/__init__.py +76 -0
- cleanedweb-0.1.0/src/cleanedweb/_async.py +537 -0
- cleanedweb-0.1.0/src/cleanedweb/_core.py +246 -0
- cleanedweb-0.1.0/src/cleanedweb/_sync.py +527 -0
- cleanedweb-0.1.0/src/cleanedweb/_version.py +1 -0
- cleanedweb-0.1.0/src/cleanedweb/exceptions.py +275 -0
- cleanedweb-0.1.0/src/cleanedweb/models.py +338 -0
- cleanedweb-0.1.0/src/cleanedweb/py.typed +0 -0
- cleanedweb-0.1.0/tests/__init__.py +0 -0
- cleanedweb-0.1.0/tests/conftest.py +120 -0
- cleanedweb-0.1.0/tests/test_async.py +183 -0
- cleanedweb-0.1.0/tests/test_live.py +29 -0
- cleanedweb-0.1.0/tests/test_sync.py +643 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 - unreleased
|
|
4
|
+
|
|
5
|
+
- First version: sync `CleanedWeb` and async `AsyncCleanedWeb` clients for the public catalog
|
|
6
|
+
(`list`, `get`, `find`, `run`, `result`), runs (`get`, `items`, `result`, `abort`, `list`) and
|
|
7
|
+
private sources (`run`).
|
|
8
|
+
- `catalog.run` generates and returns an idempotency key, follows `202` + `Retry-After` by
|
|
9
|
+
reading `/result` with the same key, and never resends the POST while it waits.
|
|
10
|
+
- Typed exceptions for the documented error codes.
|
cleanedweb-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CleanedWeb
|
|
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,123 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: cleanedweb
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python client for CleanedWeb: maintained REST APIs that return structured records from public websites.
|
|
5
|
+
Project-URL: Homepage, https://cleanedweb.com/?utm_source=github&utm_medium=cleanedweb-python
|
|
6
|
+
Project-URL: Documentation, https://cleanedweb.com/docs/python/?utm_source=github&utm_medium=cleanedweb-python
|
|
7
|
+
Project-URL: Repository, https://github.com/cleanedweb/cleanedweb-python
|
|
8
|
+
Project-URL: Changelog, https://github.com/cleanedweb/cleanedweb-python/blob/main/CHANGELOG.md
|
|
9
|
+
Author: CleanedWeb
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: agents,api,cleanedweb,llm,scraping,structured data,web data
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Requires-Dist: httpx<1,>=0.25
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: build; extra == 'dev'
|
|
26
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
27
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
28
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
29
|
+
Requires-Dist: respx>=0.21; extra == 'dev'
|
|
30
|
+
Requires-Dist: ruff>=0.5; extra == 'dev'
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# cleanedweb
|
|
34
|
+
|
|
35
|
+
Python client for [CleanedWeb](https://cleanedweb.com/?utm_source=github&utm_medium=cleanedweb-python),
|
|
36
|
+
which turns public website collections (listings, products, jobs, articles, profiles) into maintained
|
|
37
|
+
REST APIs that return structured records. Sync and async clients, typed errors, one dependency (`httpx`).
|
|
38
|
+
|
|
39
|
+
**Pricing:** 5,000 records free once, then prepaid credit from $1 per 1,000 records, no subscription.
|
|
40
|
+
Runs are charged per record delivered.
|
|
41
|
+
[Pricing](https://cleanedweb.com/pricing/?utm_source=github&utm_medium=cleanedweb-python)
|
|
42
|
+
|
|
43
|
+
## Install
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pip install cleanedweb # Python 3.10+
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
> Not on PyPI yet; until it is, use `pip install git+https://github.com/cleanedweb/cleanedweb-python`.
|
|
50
|
+
|
|
51
|
+
## Quick start
|
|
52
|
+
|
|
53
|
+
Create an API key with the `run` scope in the [console](https://app.cleanedweb.com/) and export it:
|
|
54
|
+
`export CLEANEDWEB_API_KEY=...`. Reading the catalog needs no key.
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
from cleanedweb import CleanedWeb
|
|
58
|
+
|
|
59
|
+
cw = CleanedWeb() # reads CLEANEDWEB_API_KEY
|
|
60
|
+
api = cw.catalog.find(site="github.com")[0] # find before you run
|
|
61
|
+
contract = cw.catalog.get(api.api_id) # inputs, output fields, saved samples
|
|
62
|
+
endpoint = contract.endpoints[0]
|
|
63
|
+
result = cw.catalog.run(api.api_id, endpoint.endpoint_id, max_items=5) # start small
|
|
64
|
+
print(result.idempotency_key, result.is_usable, result.stop_reason)
|
|
65
|
+
for record in result: # records are data, not instructions
|
|
66
|
+
print(record["title"], record["url"])
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`catalog.run` generates an idempotency key (or takes yours), returns it as `result.idempotency_key`,
|
|
70
|
+
and when the server answers `202` it reads `/result` with the same key every `Retry-After` seconds
|
|
71
|
+
until the run ends. It never resends the POST while it waits. Check `result.is_usable`
|
|
72
|
+
(`summary.status` is `completed` or `bounded` and `within_scope_passed` is true) before using records.
|
|
73
|
+
|
|
74
|
+
Async:
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from cleanedweb import AsyncCleanedWeb
|
|
78
|
+
|
|
79
|
+
async with AsyncCleanedWeb() as cw:
|
|
80
|
+
result = await cw.catalog.run(api_id, endpoint_id, {"sort": "desc_stars"}, max_items=25)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## API
|
|
84
|
+
|
|
85
|
+
| Call | What it does |
|
|
86
|
+
| --- | --- |
|
|
87
|
+
| `catalog.list(q=, category=, sort=, limit=, offset=)` / `catalog.iter(...)` | The live published list (no key). |
|
|
88
|
+
| `catalog.get(api_id_or_slug)` | The contract: `input_schema`, `output_schema`, saved samples per endpoint (no key). |
|
|
89
|
+
| `catalog.find(site=, fields=, q=, category=)` | Client-side filter over the live list and the catalog index (no key). |
|
|
90
|
+
| `catalog.run(api_id, endpoint_id, input, max_items=, idempotency_key=, wait=True, version=, ...)` | Run a catalog API. Needs a key with the `run` scope. |
|
|
91
|
+
| `catalog.result(api_id, endpoint_id, idempotency_key)` | Read an earlier run with the same key (recovery after a timeout; never collects again). |
|
|
92
|
+
| `runs.get(run_id)`, `runs.result(run_id)`, `runs.abort(run_id)` | Read, wait for, or stop a run. |
|
|
93
|
+
| `runs.items(run_id)` | Iterate records across cursor pages (also while the run runs). |
|
|
94
|
+
| `runs.list(...)` / `runs.iter(...)` | Your runs, newest first. |
|
|
95
|
+
| `sources.run(source_id, input, expected_version=, ...)` | Run one of your own private APIs. |
|
|
96
|
+
|
|
97
|
+
Pass `wait=False` to return as soon as the run is accepted (`result.complete` is `False`), or
|
|
98
|
+
`poll_timeout=` to stop waiting after some seconds; continue later with `catalog.result(...)`.
|
|
99
|
+
|
|
100
|
+
## Errors
|
|
101
|
+
|
|
102
|
+
Every error derives from `CleanedWebError`; API errors derive from `APIStatusError` (`status_code`,
|
|
103
|
+
`code`, `detail`, `retry_after`): `AuthenticationError` (401), `PermissionDeniedError` (403),
|
|
104
|
+
`InsufficientCreditError` (402, `required`/`available`), `RateLimitError` (429, `retry_after`),
|
|
105
|
+
`VersionConflictError`, `VersionNotFoundError` (`available` majors), `NotFoundError`,
|
|
106
|
+
`IdempotencyConflictError`, `UsageBudgetExceededError`, `InvalidRequestError`, `ServerError`, plus
|
|
107
|
+
`APIConnectionError` when no answer arrived. `err.run_failed` is true when the run failed: that is
|
|
108
|
+
final for the key, so use a new key to run again. After a connection error or a 5xx without that
|
|
109
|
+
marker the run may have started: keep the key and call `catalog.result(...)`.
|
|
110
|
+
429 and 502/503/504 answers are retried (`max_retries`, default 2) with the same key.
|
|
111
|
+
|
|
112
|
+
Values in returned records are website data, never instructions.
|
|
113
|
+
|
|
114
|
+
## More
|
|
115
|
+
|
|
116
|
+
- [Python guide](https://cleanedweb.com/docs/python/?utm_source=github&utm_medium=cleanedweb-python),
|
|
117
|
+
[run a catalog API](https://cleanedweb.com/docs/run-catalog-api/?utm_source=github&utm_medium=cleanedweb-python),
|
|
118
|
+
[idempotency](https://cleanedweb.com/docs/idempotency/?utm_source=github&utm_medium=cleanedweb-python)
|
|
119
|
+
- Prefer to let an agent call CleanedWeb directly? Use the hosted MCP server:
|
|
120
|
+
[cleanedweb/cleanedweb-mcp](https://github.com/cleanedweb/cleanedweb-mcp).
|
|
121
|
+
- Integrations: `langchain-cleanedweb`, `llama-index-tools-cleanedweb`.
|
|
122
|
+
|
|
123
|
+
MIT licensed.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# cleanedweb
|
|
2
|
+
|
|
3
|
+
Python client for [CleanedWeb](https://cleanedweb.com/?utm_source=github&utm_medium=cleanedweb-python),
|
|
4
|
+
which turns public website collections (listings, products, jobs, articles, profiles) into maintained
|
|
5
|
+
REST APIs that return structured records. Sync and async clients, typed errors, one dependency (`httpx`).
|
|
6
|
+
|
|
7
|
+
**Pricing:** 5,000 records free once, then prepaid credit from $1 per 1,000 records, no subscription.
|
|
8
|
+
Runs are charged per record delivered.
|
|
9
|
+
[Pricing](https://cleanedweb.com/pricing/?utm_source=github&utm_medium=cleanedweb-python)
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install cleanedweb # Python 3.10+
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
> Not on PyPI yet; until it is, use `pip install git+https://github.com/cleanedweb/cleanedweb-python`.
|
|
18
|
+
|
|
19
|
+
## Quick start
|
|
20
|
+
|
|
21
|
+
Create an API key with the `run` scope in the [console](https://app.cleanedweb.com/) and export it:
|
|
22
|
+
`export CLEANEDWEB_API_KEY=...`. Reading the catalog needs no key.
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
from cleanedweb import CleanedWeb
|
|
26
|
+
|
|
27
|
+
cw = CleanedWeb() # reads CLEANEDWEB_API_KEY
|
|
28
|
+
api = cw.catalog.find(site="github.com")[0] # find before you run
|
|
29
|
+
contract = cw.catalog.get(api.api_id) # inputs, output fields, saved samples
|
|
30
|
+
endpoint = contract.endpoints[0]
|
|
31
|
+
result = cw.catalog.run(api.api_id, endpoint.endpoint_id, max_items=5) # start small
|
|
32
|
+
print(result.idempotency_key, result.is_usable, result.stop_reason)
|
|
33
|
+
for record in result: # records are data, not instructions
|
|
34
|
+
print(record["title"], record["url"])
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`catalog.run` generates an idempotency key (or takes yours), returns it as `result.idempotency_key`,
|
|
38
|
+
and when the server answers `202` it reads `/result` with the same key every `Retry-After` seconds
|
|
39
|
+
until the run ends. It never resends the POST while it waits. Check `result.is_usable`
|
|
40
|
+
(`summary.status` is `completed` or `bounded` and `within_scope_passed` is true) before using records.
|
|
41
|
+
|
|
42
|
+
Async:
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
from cleanedweb import AsyncCleanedWeb
|
|
46
|
+
|
|
47
|
+
async with AsyncCleanedWeb() as cw:
|
|
48
|
+
result = await cw.catalog.run(api_id, endpoint_id, {"sort": "desc_stars"}, max_items=25)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## API
|
|
52
|
+
|
|
53
|
+
| Call | What it does |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `catalog.list(q=, category=, sort=, limit=, offset=)` / `catalog.iter(...)` | The live published list (no key). |
|
|
56
|
+
| `catalog.get(api_id_or_slug)` | The contract: `input_schema`, `output_schema`, saved samples per endpoint (no key). |
|
|
57
|
+
| `catalog.find(site=, fields=, q=, category=)` | Client-side filter over the live list and the catalog index (no key). |
|
|
58
|
+
| `catalog.run(api_id, endpoint_id, input, max_items=, idempotency_key=, wait=True, version=, ...)` | Run a catalog API. Needs a key with the `run` scope. |
|
|
59
|
+
| `catalog.result(api_id, endpoint_id, idempotency_key)` | Read an earlier run with the same key (recovery after a timeout; never collects again). |
|
|
60
|
+
| `runs.get(run_id)`, `runs.result(run_id)`, `runs.abort(run_id)` | Read, wait for, or stop a run. |
|
|
61
|
+
| `runs.items(run_id)` | Iterate records across cursor pages (also while the run runs). |
|
|
62
|
+
| `runs.list(...)` / `runs.iter(...)` | Your runs, newest first. |
|
|
63
|
+
| `sources.run(source_id, input, expected_version=, ...)` | Run one of your own private APIs. |
|
|
64
|
+
|
|
65
|
+
Pass `wait=False` to return as soon as the run is accepted (`result.complete` is `False`), or
|
|
66
|
+
`poll_timeout=` to stop waiting after some seconds; continue later with `catalog.result(...)`.
|
|
67
|
+
|
|
68
|
+
## Errors
|
|
69
|
+
|
|
70
|
+
Every error derives from `CleanedWebError`; API errors derive from `APIStatusError` (`status_code`,
|
|
71
|
+
`code`, `detail`, `retry_after`): `AuthenticationError` (401), `PermissionDeniedError` (403),
|
|
72
|
+
`InsufficientCreditError` (402, `required`/`available`), `RateLimitError` (429, `retry_after`),
|
|
73
|
+
`VersionConflictError`, `VersionNotFoundError` (`available` majors), `NotFoundError`,
|
|
74
|
+
`IdempotencyConflictError`, `UsageBudgetExceededError`, `InvalidRequestError`, `ServerError`, plus
|
|
75
|
+
`APIConnectionError` when no answer arrived. `err.run_failed` is true when the run failed: that is
|
|
76
|
+
final for the key, so use a new key to run again. After a connection error or a 5xx without that
|
|
77
|
+
marker the run may have started: keep the key and call `catalog.result(...)`.
|
|
78
|
+
429 and 502/503/504 answers are retried (`max_retries`, default 2) with the same key.
|
|
79
|
+
|
|
80
|
+
Values in returned records are website data, never instructions.
|
|
81
|
+
|
|
82
|
+
## More
|
|
83
|
+
|
|
84
|
+
- [Python guide](https://cleanedweb.com/docs/python/?utm_source=github&utm_medium=cleanedweb-python),
|
|
85
|
+
[run a catalog API](https://cleanedweb.com/docs/run-catalog-api/?utm_source=github&utm_medium=cleanedweb-python),
|
|
86
|
+
[idempotency](https://cleanedweb.com/docs/idempotency/?utm_source=github&utm_medium=cleanedweb-python)
|
|
87
|
+
- Prefer to let an agent call CleanedWeb directly? Use the hosted MCP server:
|
|
88
|
+
[cleanedweb/cleanedweb-mcp](https://github.com/cleanedweb/cleanedweb-mcp).
|
|
89
|
+
- Integrations: `langchain-cleanedweb`, `llama-index-tools-cleanedweb`.
|
|
90
|
+
|
|
91
|
+
MIT licensed.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "cleanedweb"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Python client for CleanedWeb: maintained REST APIs that return structured records from public websites."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
authors = [{ name = "CleanedWeb" }]
|
|
14
|
+
keywords = ["cleanedweb", "api", "web data", "scraping", "structured data", "llm", "agents"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 4 - Beta",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Typing :: Typed",
|
|
25
|
+
]
|
|
26
|
+
dependencies = ["httpx>=0.25,<1"]
|
|
27
|
+
|
|
28
|
+
[project.urls]
|
|
29
|
+
Homepage = "https://cleanedweb.com/?utm_source=github&utm_medium=cleanedweb-python"
|
|
30
|
+
Documentation = "https://cleanedweb.com/docs/python/?utm_source=github&utm_medium=cleanedweb-python"
|
|
31
|
+
Repository = "https://github.com/cleanedweb/cleanedweb-python"
|
|
32
|
+
Changelog = "https://github.com/cleanedweb/cleanedweb-python/blob/main/CHANGELOG.md"
|
|
33
|
+
|
|
34
|
+
[project.optional-dependencies]
|
|
35
|
+
dev = ["pytest>=8", "pytest-asyncio>=0.23", "respx>=0.21", "ruff>=0.5", "mypy>=1.10", "build"]
|
|
36
|
+
|
|
37
|
+
[tool.hatch.version]
|
|
38
|
+
path = "src/cleanedweb/_version.py"
|
|
39
|
+
|
|
40
|
+
[tool.hatch.build.targets.wheel]
|
|
41
|
+
packages = ["src/cleanedweb"]
|
|
42
|
+
|
|
43
|
+
[tool.hatch.build.targets.sdist]
|
|
44
|
+
include = ["src/cleanedweb", "tests", "README.md", "LICENSE", "CHANGELOG.md"]
|
|
45
|
+
|
|
46
|
+
[tool.ruff]
|
|
47
|
+
line-length = 110
|
|
48
|
+
target-version = "py310"
|
|
49
|
+
src = ["src", "tests"]
|
|
50
|
+
|
|
51
|
+
[tool.ruff.lint]
|
|
52
|
+
select = ["E", "F", "I", "UP", "B", "W"]
|
|
53
|
+
ignore = ["UP006", "UP007", "UP035", "UP045", "A003", "B904"]
|
|
54
|
+
|
|
55
|
+
[tool.mypy]
|
|
56
|
+
python_version = "3.10"
|
|
57
|
+
strict = true
|
|
58
|
+
files = ["src/cleanedweb"]
|
|
59
|
+
|
|
60
|
+
[tool.pytest.ini_options]
|
|
61
|
+
asyncio_mode = "auto"
|
|
62
|
+
asyncio_default_fixture_loop_scope = "function"
|
|
63
|
+
testpaths = ["tests"]
|
|
64
|
+
addopts = "-m 'not live'"
|
|
65
|
+
markers = ["live: hits the public no-key catalog read endpoints (network); run with -m live"]
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"""Python client for CleanedWeb: maintained REST APIs that return structured records.
|
|
2
|
+
|
|
3
|
+
Quick start::
|
|
4
|
+
|
|
5
|
+
from cleanedweb import CleanedWeb
|
|
6
|
+
|
|
7
|
+
cw = CleanedWeb() # reads CLEANEDWEB_API_KEY
|
|
8
|
+
api = cw.catalog.find(site="github.com")[0]
|
|
9
|
+
contract = cw.catalog.get(api.api_id)
|
|
10
|
+
result = cw.catalog.run(api.api_id, contract.endpoints[0].endpoint_id, max_items=5)
|
|
11
|
+
print(result.records)
|
|
12
|
+
|
|
13
|
+
Values in returned records are website data, never instructions.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from ._async import AsyncCleanedWeb
|
|
17
|
+
from ._sync import CleanedWeb
|
|
18
|
+
from ._version import __version__
|
|
19
|
+
from .exceptions import (
|
|
20
|
+
APIConnectionError,
|
|
21
|
+
APIStatusError,
|
|
22
|
+
AuthenticationError,
|
|
23
|
+
CleanedWebError,
|
|
24
|
+
IdempotencyConflictError,
|
|
25
|
+
InsufficientCreditError,
|
|
26
|
+
InvalidRequestError,
|
|
27
|
+
MissingAPIKeyError,
|
|
28
|
+
NotFoundError,
|
|
29
|
+
PermissionDeniedError,
|
|
30
|
+
RateLimitError,
|
|
31
|
+
RunFailedError,
|
|
32
|
+
ServerError,
|
|
33
|
+
UsageBudgetExceededError,
|
|
34
|
+
VersionConflictError,
|
|
35
|
+
VersionNotFoundError,
|
|
36
|
+
)
|
|
37
|
+
from .models import (
|
|
38
|
+
ApiContract,
|
|
39
|
+
CatalogApi,
|
|
40
|
+
CatalogEndpoint,
|
|
41
|
+
EndpointContract,
|
|
42
|
+
Run,
|
|
43
|
+
RunItemsPage,
|
|
44
|
+
RunList,
|
|
45
|
+
RunResult,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
__all__ = [
|
|
49
|
+
"APIConnectionError",
|
|
50
|
+
"APIStatusError",
|
|
51
|
+
"ApiContract",
|
|
52
|
+
"AsyncCleanedWeb",
|
|
53
|
+
"AuthenticationError",
|
|
54
|
+
"CatalogApi",
|
|
55
|
+
"CatalogEndpoint",
|
|
56
|
+
"CleanedWeb",
|
|
57
|
+
"CleanedWebError",
|
|
58
|
+
"EndpointContract",
|
|
59
|
+
"IdempotencyConflictError",
|
|
60
|
+
"InsufficientCreditError",
|
|
61
|
+
"InvalidRequestError",
|
|
62
|
+
"MissingAPIKeyError",
|
|
63
|
+
"NotFoundError",
|
|
64
|
+
"PermissionDeniedError",
|
|
65
|
+
"RateLimitError",
|
|
66
|
+
"Run",
|
|
67
|
+
"RunFailedError",
|
|
68
|
+
"RunItemsPage",
|
|
69
|
+
"RunList",
|
|
70
|
+
"RunResult",
|
|
71
|
+
"ServerError",
|
|
72
|
+
"UsageBudgetExceededError",
|
|
73
|
+
"VersionConflictError",
|
|
74
|
+
"VersionNotFoundError",
|
|
75
|
+
"__version__",
|
|
76
|
+
]
|