cleanedweb 0.1.0__py3-none-any.whl

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,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,12 @@
1
+ cleanedweb/__init__.py,sha256=SHAidlIZcf1lNR-CoC56qx6ckd2pD0TipcQThf_Rn6U,1792
2
+ cleanedweb/_async.py,sha256=SE0CVaHrbIXvHch5ZywptO6NeN-im8hntZxVewFzZM4,21328
3
+ cleanedweb/_core.py,sha256=a4914eBdwZevdsyt_8aZqj8SlOMstW_hyAbCIeSsBDY,9462
4
+ cleanedweb/_sync.py,sha256=zp384UgNQ-089vdKcpZkAV9JqUHR8MAAORoZQXKJ0DU,20640
5
+ cleanedweb/_version.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
6
+ cleanedweb/exceptions.py,sha256=iGA8HXlgy-in3iFhcMsqHxUyiGu9A2p0m0B0SbP3xFc,9684
7
+ cleanedweb/models.py,sha256=4R1hkv_ysnay5KIw8tNxBmIIxKKDXPxVWeFEEMY_kVE,11763
8
+ cleanedweb/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ cleanedweb-0.1.0.dist-info/METADATA,sha256=soim7Jtl2EVvbcPeTrS_tw2uv9HMChCZogFfseVynyk,6234
10
+ cleanedweb-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
11
+ cleanedweb-0.1.0.dist-info/licenses/LICENSE,sha256=iTrqsDfNwXyaJHQcLf7V7NcNOHhz7MdtOa6qFyUiW-g,1067
12
+ cleanedweb-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -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.