scrapely-client-python 1.0.10__tar.gz → 1.0.11__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.
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/CHANGELOG.md +4 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/PKG-INFO +1 -1
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/pyproject.toml +1 -1
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/pyproject.toml.orig +1 -1
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/http_clients/_impit.py +18 -2
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/CONTRIBUTING.md +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/LICENSE +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/NOTICE +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/README.md +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/__init__.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_charging.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_client_registry.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_consts.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_docs.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_literals.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_logging.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_models.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_pagination.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/__init__.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/_resource_client.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/actor.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/actor_collection.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/actor_env_var.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/actor_env_var_collection.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/actor_version.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/actor_version_collection.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/automation.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/automation_collection.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/build.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/build_collection.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/dataset.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/dataset_collection.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/key_value_store.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/key_value_store_collection.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/log.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/request_queue.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/request_queue_collection.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/run.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/run_collection.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/schedule.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/schedule_collection.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/store_collection.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/task.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/task_collection.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/user.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/webhook.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/webhook_collection.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/webhook_dispatch.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_resource_clients/webhook_dispatch_collection.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_scrapely_client.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_statistics.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_status_message_watcher.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_streamed_log.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_typeddicts.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_utils/__init__.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_utils/crypto.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_utils/encoding.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_utils/errors.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_utils/http.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_utils/time.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_utils/try_import.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/errors.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/http_clients/__init__.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/http_clients/_base.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/http_compressors/__init__.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/http_compressors/_base.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/http_compressors/_brotli.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/http_compressors/_gzip.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/http_compressors/_resolve.py +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/py.typed +0 -0
- {scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/types.py +0 -0
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.0.11] - 2026-11-04
|
|
6
|
+
|
|
7
|
+
- The API now sends its own 502 and 504 answers as 503 with the original status in the `X-Scrapely-Status` header (so the error body reaches you through Cloudflare). A 503 with `X-Scrapely-Status: 504` is treated like a 504: a POST or PATCH without an `Idempotency-Key` is not resent after it, since it may already have been applied. A 503 with `X-Scrapely-Status: 502` is retried like a 502.
|
|
8
|
+
|
|
5
9
|
## [1.0.10] - 2026-11-02
|
|
6
10
|
|
|
7
11
|
- Run starts (`ActorClient.start` / `call`, `TaskClient.start` / `call`), `ActorClient.build` and `DatasetClient.push_items` send an `Idempotency-Key` header, so a request resent after a 5xx or a dropped connection starts one run or build and stores the items once.
|
|
@@ -86,6 +86,22 @@ _STORAGE_COLLECTION_PATH_RE = re.compile(r'/(?:datasets|key-value-stores|request
|
|
|
86
86
|
# so resending can't apply it twice.
|
|
87
87
|
_NOT_APPLIED_STATUS_CODES = frozenset({HTTPStatus.BAD_GATEWAY, HTTPStatus.SERVICE_UNAVAILABLE})
|
|
88
88
|
|
|
89
|
+
# The API answers its own 502/504 as 503 with the original in this header, so the edge (Cloudflare) keeps the
|
|
90
|
+
# error body. Retry decisions use the original: a 504 (e.g. a Standby container timeout) may have been applied.
|
|
91
|
+
_ORIGINAL_STATUS_HEADER = 'x-scrapely-status'
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def _effective_status(response: Any) -> int:
|
|
95
|
+
"""The status to act on: the original 502/504 of a 503 that carries X-Scrapely-Status, else the HTTP status."""
|
|
96
|
+
status = response.status_code
|
|
97
|
+
if status != HTTPStatus.SERVICE_UNAVAILABLE:
|
|
98
|
+
return status
|
|
99
|
+
try:
|
|
100
|
+
original = int((response.headers or {}).get(_ORIGINAL_STATUS_HEADER) or 0)
|
|
101
|
+
except (TypeError, ValueError):
|
|
102
|
+
return status
|
|
103
|
+
return original if original in (HTTPStatus.BAD_GATEWAY, HTTPStatus.GATEWAY_TIMEOUT) else status
|
|
104
|
+
|
|
89
105
|
# Keyed requests: the first request with the key is still being applied, so a resend gets its answer shortly.
|
|
90
106
|
_KEY_IN_PROGRESS_ERROR_TYPE = 'idempotency-key-in-progress'
|
|
91
107
|
# Keyed requests: the server can't tell whether the first request was applied, and no resend changes that.
|
|
@@ -312,7 +328,7 @@ class ImpitHttpClient(HttpClient):
|
|
|
312
328
|
stop_retrying()
|
|
313
329
|
elif (
|
|
314
330
|
response.status_code != HTTPStatus.TOO_MANY_REQUESTS
|
|
315
|
-
and response
|
|
331
|
+
and _effective_status(response) not in _NOT_APPLIED_STATUS_CODES
|
|
316
332
|
and _is_unsafe_to_resend(method, url, headers, params)
|
|
317
333
|
):
|
|
318
334
|
logger.debug(
|
|
@@ -605,7 +621,7 @@ class ImpitHttpClientAsync(HttpClientAsync):
|
|
|
605
621
|
stop_retrying()
|
|
606
622
|
elif (
|
|
607
623
|
response.status_code != HTTPStatus.TOO_MANY_REQUESTS
|
|
608
|
-
and response
|
|
624
|
+
and _effective_status(response) not in _NOT_APPLIED_STATUS_CODES
|
|
609
625
|
and _is_unsafe_to_resend(method, url, headers, params)
|
|
610
626
|
):
|
|
611
627
|
logger.debug(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/__init__.py
RENAMED
|
File without changes
|
{scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_charging.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_consts.py
RENAMED
|
File without changes
|
{scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_docs.py
RENAMED
|
File without changes
|
{scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_literals.py
RENAMED
|
File without changes
|
{scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_logging.py
RENAMED
|
File without changes
|
{scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_models.py
RENAMED
|
File without changes
|
{scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_pagination.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_statistics.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_streamed_log.py
RENAMED
|
File without changes
|
{scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_typeddicts.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_utils/crypto.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_utils/errors.py
RENAMED
|
File without changes
|
{scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_utils/http.py
RENAMED
|
File without changes
|
{scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/_utils/time.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/errors.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
|
{scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/py.typed
RENAMED
|
File without changes
|
{scrapely_client_python-1.0.10 → scrapely_client_python-1.0.11}/src/scrapely_client/types.py
RENAMED
|
File without changes
|