scrapely-python 0.1.42__tar.gz → 0.1.44__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_python-0.1.42 → scrapely_python-0.1.44}/CHANGELOG.md +19 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/PKG-INFO +1 -1
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/pyproject.toml +1 -1
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/__init__.py +182 -84
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/charging.py +186 -63
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/charging_client.py +21 -5
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/patch_browser_pool.py +174 -72
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/pricing_types.py +10 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/solver.py +53 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely_python.egg-info/PKG-INFO +1 -1
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/LICENSE +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/LICENSE-APACHE +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/MANIFEST.in +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/NOTICE +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/README.md +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/setup.cfg +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/_browser_locations.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/actor.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/browser_configuration.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/cdp_retry.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/configuration.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/crypto/__init__.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/crypto/_secrets.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/errors.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/events/__init__.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/events/_types.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/events/event_manager.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/http/__init__.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/http/_capture.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/http/_client.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/http/_compat.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/http/_detect.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/http/_headers.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/http/_options.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/http/_policy.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/http/_profiles.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/http/_response.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/http/_stats.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/http/_transport.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/http/profiles.json +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/log.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/proxy_configuration.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/py.typed +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/request_loaders/__init__.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/request_loaders/_scrapely_request_list.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/scrapy/__init__.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/scrapy/_actor_runner.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/scrapy/_async_thread.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/scrapy/_logging_config.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/scrapy/_serialization.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/scrapy/_warnings.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/scrapy/extensions/__init__.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/scrapy/extensions/_graceful_stop.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/scrapy/extensions/_httpcache.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/scrapy/middlewares/__init__.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/scrapy/middlewares/apify_proxy.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/scrapy/pipelines/__init__.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/scrapy/pipelines/actor_dataset_push.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/scrapy/requests.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/scrapy/scheduler.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/scrapy/utils.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/storage/__init__.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/storage/_file_system/__init__.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/storage/_file_system/_key_value_store_client.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/storage/_file_system/_storage_client.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/storage/_metadata.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/storage/api_client.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/storage/client.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/storage/patch_storage.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/storage/scrapely_dataset_client.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/storage/scrapely_kvs_client.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/storage/scrapely_rq_client.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/storage/scrapely_storage_client.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/storage/smart_scrapely_storage_client.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/storage/types.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/storage/utils.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/storage_clients/__init__.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/storages/__init__.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/types.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely/webhook.py +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely_python.egg-info/SOURCES.txt +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely_python.egg-info/dependency_links.txt +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely_python.egg-info/requires.txt +0 -0
- {scrapely_python-0.1.42 → scrapely_python-0.1.44}/src/scrapely_python.egg-info/top_level.txt +0 -0
|
@@ -4,6 +4,25 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.1.44] - 2026-11-08
|
|
8
|
+
|
|
9
|
+
- An atomic multi-event push (`Actor.push_data(rows, charges={...})`) whose charge the limit covers only in part no longer shows "Charging 5 instances of 'audio-minute' event would exceed the end of the account balance - only 3 events were charged". A row is saved only when all of its events are charged, so the SDK gives those 3 back and nothing is charged: the line was untrue. It now says what happened: "Saving this item needs 5 'audio-minute' event(s), but the account balance covers only 3: it was not saved and nothing was charged for it." When some rows still fit, it names how many were saved and charged in full, and when giving a charge back is not confirmed it says so instead of "nothing was charged". A plain `Actor.charge()` that comes back short keeps its line: those events do stay charged.
|
|
10
|
+
- `ChargeResult.covered_counts` (alias `coveredCounts`, from `push_data(rows, charges={...})`): for each event whose charge came back short, how many events the limit covered (given back, not charged), e.g. `{'audio-minute': 3}`. Actors can cut a row to what the limit covers without reading the log.
|
|
11
|
+
- Compatibility: actors that read N from the old line with a `logging.Filter` on the `scrapely.charging` logger still receive that exact line during the push. It is shown to the logger's filters only and never printed; when such a filter drops it, the SDK leaves the refusal message to the actor, as before. What is charged and saved does not change.
|
|
12
|
+
- A spending limit of $0 (`max_total_charge_usd = 0`) is a real limit, the same as on the platform. It used to be read as "no limit". A missing or non-numeric value still means no limit.
|
|
13
|
+
- `scrapely.solver`: a challenge step's answer is read as a stream and stops at the body size limit (httpx, requests and curl_cffi sessions), so a target site cannot make the step download an unbounded body.
|
|
14
|
+
|
|
15
|
+
## [0.1.43] - 2026-11-05
|
|
16
|
+
|
|
17
|
+
- **Python actor processes start without loading the SDK.** The base images import `scrapely.patch_browser_pool` (from `sitecustomize`) in every Python process. Until now that loaded the whole SDK at each interpreter start: `scrapely.actor`, charging, the `scrapely_client` models and Playwright. On `actor-python:3.11-0.1.42`, `python -c pass` took 0.89-0.95 s of CPU, which is 4.2 s of wall time at a 0.25-core quota. It now takes 0.016 s. Each import below gets the same start-up cut:
|
|
18
|
+
- `import scrapely` is lazy (PEP 562). Every public name and submodule attribute resolves on first use, so every `from scrapely import X` and `scrapely.X` that worked before still works.
|
|
19
|
+
- `scrapely_client` loads only when an API client is created (`Actor.apify_client`, `create_charging_client`). `USES_PUSH_DATA_INTERCEPTION` and `push_data_charging_context` are still the client's own objects.
|
|
20
|
+
- **Browser patches are applied through an import hook.** `scrapely.patch_browser_pool` imports no browser library any more; it imports builtin modules only. Each patch now runs the moment its library finishes loading, before the import that loaded it returns. That covers the Crawlee BrowserPool / PlaywrightBrowserPlugin / PlaywrightCrawler, raw Playwright (`async_playwright` and `sync_playwright`, each when its module loads), Camoufox `AsyncNewBrowser` and pyppeteer `launch`. The patches behave exactly as before. The hook also:
|
|
21
|
+
- survives `importlib.util.find_spec()` availability checks and a failed first import;
|
|
22
|
+
- logs a warning when a patch fails instead of breaking the actor's import.
|
|
23
|
+
- **Start-up measured on staging** (fresh builds of the same commit on the same base, old SDK vs 0.1.43; "boot" = container started to the SDK's "Initializing API storage" line; paired median): web-scraper -0.74 s, capterra-scraper (raw Playwright over the remote browser) -0.89 s, contact-info-scraper (512 MB) -0.51 s. All 88 scenario runs passed on both sides. Locally at 1 CPU, a full `from apify import Actor` + `Actor.init` + `push_data` + exit went from 1.19-1.36 s to 0.92-1.02 s of CPU.
|
|
24
|
+
- Base images (released with this version): `sitecustomize` no longer imports `pathlib` (~70 ms per start), and the `apify` shim resolves names on first use instead of `from scrapely import *`.
|
|
25
|
+
|
|
7
26
|
## [0.1.42] - 2026-11-02
|
|
8
27
|
|
|
9
28
|
- **Sessions that keep their identity: `http.session(keep_identity=True)`.** A pinned `scrapely.http` session used to retire its identity on the first block (a 403, a challenge page, a network error). The session then moved to a new exit, a new profile and an empty cookie jar. That breaks every challenge solve: the challenge page, the solver's script and submission requests and the page fetched again must all share one identity. With `keep_identity=True`:
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "scrapely-python"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.44"
|
|
8
8
|
description = "Scrapely Python SDK - A toolkit for building Actors on the Scrapely platform"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT AND Apache-2.0"
|
|
@@ -10,95 +10,114 @@ Usage:
|
|
|
10
10
|
await Actor.push_data({'url': actor_input['url']})
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
|
-
from
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
# ``typing`` is not imported at run time (see below): this package loads at
|
|
16
|
+
# every interpreter start in actor images.
|
|
17
|
+
TYPE_CHECKING = False
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from typing import Any
|
|
14
20
|
|
|
15
21
|
# Side-effect: patch browser launches (Crawlee BrowserPool, PlaywrightCrawler,
|
|
16
22
|
# raw Playwright, Camoufox, pyppeteer) to use the remote CDP browser (CDP_URL).
|
|
17
23
|
# Must run on package import so `from scrapely import Actor` enables the patch
|
|
18
|
-
# before any browser is launched (Node SDK parity). It
|
|
19
|
-
#
|
|
24
|
+
# before any browser is launched (Node SDK parity). It imports none of those
|
|
25
|
+
# libraries: each patch is applied the moment its library finishes loading.
|
|
20
26
|
from .patch_browser_pool import set_cdp_url # noqa: F401
|
|
21
27
|
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
from
|
|
28
|
-
from .configuration import Configuration
|
|
29
|
-
from .charging_client import (
|
|
30
|
-
USES_PUSH_DATA_INTERCEPTION,
|
|
31
|
-
create_charging_client,
|
|
32
|
-
push_data_charging_context,
|
|
33
|
-
)
|
|
34
|
-
from .proxy_configuration import ProxyConfiguration
|
|
35
|
-
from .browser_configuration import BrowserConfiguration
|
|
36
|
-
from .charging import (
|
|
37
|
-
ChargingManager,
|
|
38
|
-
ChargeUncertainError,
|
|
39
|
-
ChargeRejectedError,
|
|
40
|
-
has_default_dataset_item_event_in_pricing,
|
|
41
|
-
is_default_dataset_item_event,
|
|
42
|
-
merge_charge_results,
|
|
43
|
-
push_data_and_charge,
|
|
44
|
-
resolve_default_dataset_item_event_name,
|
|
45
|
-
APIFY_DEFAULT_DATASET_ITEM_EVENT,
|
|
46
|
-
SCRAPELY_DEFAULT_DATASET_ITEM_EVENT,
|
|
47
|
-
DEFAULT_DATASET_ITEM_EVENT,
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
from .types import (
|
|
51
|
-
ActorInput,
|
|
52
|
-
ActorPermissionLevel,
|
|
53
|
-
ActorRun,
|
|
54
|
-
ApifyEnv,
|
|
55
|
-
AbortOptions,
|
|
56
|
-
CallOptions,
|
|
57
|
-
ExitOptions,
|
|
58
|
-
InitOptions,
|
|
59
|
-
MetamorphOptions,
|
|
60
|
-
OpenStorageOptions,
|
|
61
|
-
ProxyInfo,
|
|
62
|
-
RebootOptions,
|
|
63
|
-
RecordOptions,
|
|
64
|
-
SetStatusMessageOptions,
|
|
65
|
-
StartOptions,
|
|
66
|
-
WebhookOptions,
|
|
67
|
-
)
|
|
28
|
+
# Nothing else is imported here. The base images' sitecustomize imports
|
|
29
|
+
# ``scrapely.patch_browser_pool`` (and so this package) in EVERY Python process
|
|
30
|
+
# of an actor image; loading the whole SDK there cost ~0.75 s per interpreter
|
|
31
|
+
# start at 1 CPU (5.7 s at 0.25 CPU). Every public name is resolved on first
|
|
32
|
+
# attribute access by ``__getattr__`` below and cached in the module namespace,
|
|
33
|
+
# so every ``from scrapely import X`` that worked before still works.
|
|
68
34
|
|
|
69
|
-
|
|
70
|
-
Webhook,
|
|
71
|
-
WebhookEventType,
|
|
72
|
-
)
|
|
73
|
-
from .pricing_types import (
|
|
74
|
-
PricingModel,
|
|
75
|
-
FreeActorPricingInfo,
|
|
76
|
-
FlatPricePerMonthActorPricingInfo,
|
|
77
|
-
PricePerDatasetItemActorPricingInfo,
|
|
78
|
-
PayPerEventActorPricingInfo,
|
|
79
|
-
PricingPerEvent,
|
|
80
|
-
ActorPricingInfo,
|
|
81
|
-
ActorChargeEvent,
|
|
82
|
-
ChargeResult,
|
|
83
|
-
ActorPricingInfoResult,
|
|
84
|
-
)
|
|
85
|
-
from .errors import (
|
|
86
|
-
ScrapelyClientError,
|
|
87
|
-
ScrapelyApiError,
|
|
88
|
-
InvalidResponseBodyError,
|
|
89
|
-
InvalidRequestError,
|
|
90
|
-
UnauthorizedError,
|
|
91
|
-
ForbiddenError,
|
|
92
|
-
NotFoundError,
|
|
93
|
-
ConflictError,
|
|
94
|
-
RateLimitError,
|
|
95
|
-
ServerError,
|
|
96
|
-
raise_for_status,
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
# Public name -> (module, attribute) for names that need Crawlee. Loaded on
|
|
100
|
-
# first access and cached in the module namespace.
|
|
35
|
+
# Public name -> (module, attribute). Loaded on first access.
|
|
101
36
|
_LAZY_ATTRS = {
|
|
37
|
+
'Actor': ('scrapely.actor', 'Actor'),
|
|
38
|
+
'Configuration': ('scrapely.configuration', 'Configuration'),
|
|
39
|
+
'ProxyConfiguration': ('scrapely.proxy_configuration', 'ProxyConfiguration'),
|
|
40
|
+
'BrowserConfiguration': ('scrapely.browser_configuration', 'BrowserConfiguration'),
|
|
41
|
+
# Charging client
|
|
42
|
+
**{
|
|
43
|
+
name: ('scrapely.charging_client', name)
|
|
44
|
+
for name in ('USES_PUSH_DATA_INTERCEPTION', 'create_charging_client', 'push_data_charging_context')
|
|
45
|
+
},
|
|
46
|
+
# Charging
|
|
47
|
+
**{
|
|
48
|
+
name: ('scrapely.charging', name)
|
|
49
|
+
for name in (
|
|
50
|
+
'ChargingManager',
|
|
51
|
+
'ChargeUncertainError',
|
|
52
|
+
'ChargeRejectedError',
|
|
53
|
+
'has_default_dataset_item_event_in_pricing',
|
|
54
|
+
'is_default_dataset_item_event',
|
|
55
|
+
'merge_charge_results',
|
|
56
|
+
'push_data_and_charge',
|
|
57
|
+
'resolve_default_dataset_item_event_name',
|
|
58
|
+
'APIFY_DEFAULT_DATASET_ITEM_EVENT',
|
|
59
|
+
'SCRAPELY_DEFAULT_DATASET_ITEM_EVENT',
|
|
60
|
+
'DEFAULT_DATASET_ITEM_EVENT',
|
|
61
|
+
)
|
|
62
|
+
},
|
|
63
|
+
# Types
|
|
64
|
+
**{
|
|
65
|
+
name: ('scrapely.types', name)
|
|
66
|
+
for name in (
|
|
67
|
+
'ActorInput',
|
|
68
|
+
'ActorPermissionLevel',
|
|
69
|
+
'ActorRun',
|
|
70
|
+
'ApifyEnv',
|
|
71
|
+
'AbortOptions',
|
|
72
|
+
'CallOptions',
|
|
73
|
+
'ExitOptions',
|
|
74
|
+
'InitOptions',
|
|
75
|
+
'MetamorphOptions',
|
|
76
|
+
'OpenStorageOptions',
|
|
77
|
+
'ProxyInfo',
|
|
78
|
+
'RebootOptions',
|
|
79
|
+
'RecordOptions',
|
|
80
|
+
'SetStatusMessageOptions',
|
|
81
|
+
'StartOptions',
|
|
82
|
+
'WebhookOptions',
|
|
83
|
+
)
|
|
84
|
+
},
|
|
85
|
+
# Webhook
|
|
86
|
+
'Webhook': ('scrapely.webhook', 'Webhook'),
|
|
87
|
+
'WebhookEventType': ('scrapely.webhook', 'WebhookEventType'),
|
|
88
|
+
# Pricing
|
|
89
|
+
**{
|
|
90
|
+
name: ('scrapely.pricing_types', name)
|
|
91
|
+
for name in (
|
|
92
|
+
'PricingModel',
|
|
93
|
+
'FreeActorPricingInfo',
|
|
94
|
+
'FlatPricePerMonthActorPricingInfo',
|
|
95
|
+
'PricePerDatasetItemActorPricingInfo',
|
|
96
|
+
'PayPerEventActorPricingInfo',
|
|
97
|
+
'PricingPerEvent',
|
|
98
|
+
'ActorPricingInfo',
|
|
99
|
+
'ActorChargeEvent',
|
|
100
|
+
'ChargeResult',
|
|
101
|
+
'ActorPricingInfoResult',
|
|
102
|
+
)
|
|
103
|
+
},
|
|
104
|
+
# Errors
|
|
105
|
+
**{
|
|
106
|
+
name: ('scrapely.errors', name)
|
|
107
|
+
for name in (
|
|
108
|
+
'ScrapelyClientError',
|
|
109
|
+
'ScrapelyApiError',
|
|
110
|
+
'InvalidResponseBodyError',
|
|
111
|
+
'InvalidRequestError',
|
|
112
|
+
'UnauthorizedError',
|
|
113
|
+
'ForbiddenError',
|
|
114
|
+
'NotFoundError',
|
|
115
|
+
'ConflictError',
|
|
116
|
+
'RateLimitError',
|
|
117
|
+
'ServerError',
|
|
118
|
+
'raise_for_status',
|
|
119
|
+
)
|
|
120
|
+
},
|
|
102
121
|
# Crawlee re-exports
|
|
103
122
|
'Request': ('crawlee', 'Request'),
|
|
104
123
|
'RequestLoader': ('crawlee.request_loaders', 'RequestLoader'),
|
|
@@ -150,15 +169,28 @@ _LAZY_ATTRS = {
|
|
|
150
169
|
}
|
|
151
170
|
|
|
152
171
|
# Submodules that used to be loaded (and so bound as attributes) by this
|
|
153
|
-
# package's eager imports; ``scrapely.events`` etc. keep
|
|
154
|
-
# explicit ``import scrapely
|
|
172
|
+
# package's eager imports; ``scrapely.actor``, ``scrapely.events`` etc. keep
|
|
173
|
+
# working without an explicit ``import scrapely.<name>``.
|
|
155
174
|
_LAZY_SUBMODULES = frozenset({
|
|
175
|
+
'_browser_locations',
|
|
176
|
+
'actor',
|
|
177
|
+
'browser_configuration',
|
|
178
|
+
'cdp_retry',
|
|
179
|
+
'charging',
|
|
180
|
+
'charging_client',
|
|
181
|
+
'configuration',
|
|
182
|
+
'crypto',
|
|
183
|
+
'errors',
|
|
156
184
|
'events',
|
|
157
185
|
'log',
|
|
186
|
+
'pricing_types',
|
|
187
|
+
'proxy_configuration',
|
|
158
188
|
'request_loaders',
|
|
159
189
|
'storage',
|
|
160
190
|
'storage_clients',
|
|
161
191
|
'storages',
|
|
192
|
+
'types',
|
|
193
|
+
'webhook',
|
|
162
194
|
})
|
|
163
195
|
|
|
164
196
|
|
|
@@ -193,6 +225,40 @@ if TYPE_CHECKING: # Static analysers and IDEs see the lazy names as plain impor
|
|
|
193
225
|
from crawlee.storage_clients.models import DatasetItemsListPage
|
|
194
226
|
from crawlee.storages import Dataset, KeyValueStore, RequestQueue
|
|
195
227
|
|
|
228
|
+
from .actor import Actor
|
|
229
|
+
from .browser_configuration import BrowserConfiguration
|
|
230
|
+
from .charging import (
|
|
231
|
+
APIFY_DEFAULT_DATASET_ITEM_EVENT,
|
|
232
|
+
DEFAULT_DATASET_ITEM_EVENT,
|
|
233
|
+
SCRAPELY_DEFAULT_DATASET_ITEM_EVENT,
|
|
234
|
+
ChargeRejectedError,
|
|
235
|
+
ChargeUncertainError,
|
|
236
|
+
ChargingManager,
|
|
237
|
+
has_default_dataset_item_event_in_pricing,
|
|
238
|
+
is_default_dataset_item_event,
|
|
239
|
+
merge_charge_results,
|
|
240
|
+
push_data_and_charge,
|
|
241
|
+
resolve_default_dataset_item_event_name,
|
|
242
|
+
)
|
|
243
|
+
from .charging_client import (
|
|
244
|
+
USES_PUSH_DATA_INTERCEPTION,
|
|
245
|
+
create_charging_client,
|
|
246
|
+
push_data_charging_context,
|
|
247
|
+
)
|
|
248
|
+
from .configuration import Configuration
|
|
249
|
+
from .errors import (
|
|
250
|
+
ConflictError,
|
|
251
|
+
ForbiddenError,
|
|
252
|
+
InvalidRequestError,
|
|
253
|
+
InvalidResponseBodyError,
|
|
254
|
+
NotFoundError,
|
|
255
|
+
RateLimitError,
|
|
256
|
+
ScrapelyApiError,
|
|
257
|
+
ScrapelyClientError,
|
|
258
|
+
ServerError,
|
|
259
|
+
UnauthorizedError,
|
|
260
|
+
raise_for_status,
|
|
261
|
+
)
|
|
196
262
|
from .events import (
|
|
197
263
|
AbortingEvent,
|
|
198
264
|
ActorEventTypes,
|
|
@@ -216,6 +282,19 @@ if TYPE_CHECKING: # Static analysers and IDEs see the lazy names as plain impor
|
|
|
216
282
|
SystemInfoEventData,
|
|
217
283
|
UnknownEvent,
|
|
218
284
|
)
|
|
285
|
+
from .pricing_types import (
|
|
286
|
+
ActorChargeEvent,
|
|
287
|
+
ActorPricingInfo,
|
|
288
|
+
ActorPricingInfoResult,
|
|
289
|
+
ChargeResult,
|
|
290
|
+
FlatPricePerMonthActorPricingInfo,
|
|
291
|
+
FreeActorPricingInfo,
|
|
292
|
+
PayPerEventActorPricingInfo,
|
|
293
|
+
PricePerDatasetItemActorPricingInfo,
|
|
294
|
+
PricingModel,
|
|
295
|
+
PricingPerEvent,
|
|
296
|
+
)
|
|
297
|
+
from .proxy_configuration import ProxyConfiguration
|
|
219
298
|
from .request_loaders import ScrapelyRequestList
|
|
220
299
|
from .storage import (
|
|
221
300
|
ApiStorageClient,
|
|
@@ -226,8 +305,27 @@ if TYPE_CHECKING: # Static analysers and IDEs see the lazy names as plain impor
|
|
|
226
305
|
StorageClient,
|
|
227
306
|
set_api_storage,
|
|
228
307
|
)
|
|
308
|
+
from .types import (
|
|
309
|
+
AbortOptions,
|
|
310
|
+
ActorInput,
|
|
311
|
+
ActorPermissionLevel,
|
|
312
|
+
ActorRun,
|
|
313
|
+
ApifyEnv,
|
|
314
|
+
CallOptions,
|
|
315
|
+
ExitOptions,
|
|
316
|
+
InitOptions,
|
|
317
|
+
MetamorphOptions,
|
|
318
|
+
OpenStorageOptions,
|
|
319
|
+
ProxyInfo,
|
|
320
|
+
RebootOptions,
|
|
321
|
+
RecordOptions,
|
|
322
|
+
SetStatusMessageOptions,
|
|
323
|
+
StartOptions,
|
|
324
|
+
WebhookOptions,
|
|
325
|
+
)
|
|
326
|
+
from .webhook import Webhook, WebhookEventType
|
|
229
327
|
|
|
230
|
-
__version__ = '0.1.
|
|
328
|
+
__version__ = '0.1.44'
|
|
231
329
|
__all__ = [
|
|
232
330
|
# Core
|
|
233
331
|
'Actor',
|