scrapely-python 0.1.7__tar.gz → 0.1.10__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.10/LICENSE +21 -0
- scrapely_python-0.1.10/LICENSE-APACHE +201 -0
- scrapely_python-0.1.10/NOTICE +27 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/PKG-INFO +12 -2
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/README.md +6 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/pyproject.toml +3 -2
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/__init__.py +1 -1
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/actor.py +9 -3
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/charging.py +3 -1
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/events/_types.py +4 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/events/event_manager.py +4 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/request_loaders/_scrapely_request_list.py +4 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/scrapely_rq_client.py +8 -4
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely_python.egg-info/PKG-INFO +12 -2
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely_python.egg-info/SOURCES.txt +3 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/tests/test_charging_parity.py +38 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/tests/test_charging_pending.py +2 -1
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/tests/test_parity.py +21 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/tests/test_storage.py +17 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/setup.cfg +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/_browser_locations.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/browser_configuration.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/cdp_retry.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/charging_client.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/configuration.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/crypto/__init__.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/crypto/_secrets.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/errors.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/events/__init__.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/log.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/patch_browser_pool.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/pricing_types.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/proxy_configuration.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/py.typed +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/request_loaders/__init__.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/__init__.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/_file_system/__init__.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/_file_system/_key_value_store_client.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/_file_system/_storage_client.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/_metadata.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/api_client.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/client.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/patch_storage.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/scrapely_dataset_client.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/scrapely_kvs_client.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/scrapely_storage_client.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/smart_scrapely_storage_client.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/types.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/utils.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage_clients/__init__.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storages/__init__.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/types.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/webhook.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely_python.egg-info/dependency_links.txt +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely_python.egg-info/requires.txt +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely_python.egg-info/top_level.txt +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/tests/test_api_client_retries.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/tests/test_apify_parity.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/tests/test_browser_configuration.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/tests/test_cdp_retry.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/tests/test_charge_retries.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/tests/test_input_proxy_aliases.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/tests/test_patch_browser_pool.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/tests/test_proxy_configuration.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/tests/test_run_control.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/tests/test_secrets.py +0 -0
- {scrapely_python-0.1.7 → scrapely_python-0.1.10}/tests/test_terminal_status_message.py +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 TeraShift GmbH (Scrape.ly)
|
|
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,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2018 Apify Technologies s.r.o.
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Scrapely Python SDK
|
|
2
|
+
===================
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2025-2026 TeraShift GmbH (Scrape.ly).
|
|
5
|
+
|
|
6
|
+
This package is licensed under the MIT License (see LICENSE), except for
|
|
7
|
+
the files listed below, which are derived from apify-sdk-python
|
|
8
|
+
(https://github.com/apify/apify-sdk-python),
|
|
9
|
+
Copyright Apify Technologies s.r.o., licensed under the Apache License,
|
|
10
|
+
Version 2.0 (see LICENSE-APACHE). Those files have been modified by
|
|
11
|
+
TeraShift GmbH and remain under the Apache License, Version 2.0:
|
|
12
|
+
|
|
13
|
+
- src/scrapely/events/_types.py (from src/apify/events/_types.py)
|
|
14
|
+
- src/scrapely/events/event_manager.py (from src/apify/events/_apify_event_manager.py)
|
|
15
|
+
- src/scrapely/request_loaders/_scrapely_request_list.py
|
|
16
|
+
(from src/apify/request_loaders/_apify_request_list.py)
|
|
17
|
+
|
|
18
|
+
You may obtain a copy of the Apache License at
|
|
19
|
+
|
|
20
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
21
|
+
|
|
22
|
+
This product includes software developed by Apify Technologies s.r.o.
|
|
23
|
+
(https://apify.com/). The original source code is available at
|
|
24
|
+
https://github.com/apify/apify-sdk-python.
|
|
25
|
+
|
|
26
|
+
Scrape.ly is not affiliated with Apify. Apify is a trademark of
|
|
27
|
+
Apify Technologies s.r.o.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scrapely-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.10
|
|
4
4
|
Summary: Scrapely Python SDK - A toolkit for building Actors on the Scrapely platform
|
|
5
5
|
Author-email: Scrapely <support@scrape.ly>
|
|
6
|
-
License-Expression: MIT
|
|
6
|
+
License-Expression: MIT AND Apache-2.0
|
|
7
7
|
Project-URL: Homepage, https://scrape.ly
|
|
8
8
|
Project-URL: Documentation, https://docs.scrape.ly
|
|
9
9
|
Project-URL: Repository, https://github.com/SandeepDev1/scrapely
|
|
@@ -18,6 +18,9 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
18
18
|
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
19
19
|
Requires-Python: >=3.11
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
License-File: LICENSE-APACHE
|
|
23
|
+
License-File: NOTICE
|
|
21
24
|
Requires-Dist: httpx>=0.25.0
|
|
22
25
|
Requires-Dist: crawlee<2.0.0,>=1.8.0
|
|
23
26
|
Requires-Dist: websockets>=12.0
|
|
@@ -32,6 +35,7 @@ Requires-Dist: isort>=5.12.0; extra == "dev"
|
|
|
32
35
|
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
33
36
|
Requires-Dist: playwright>=1.40.0; extra == "dev"
|
|
34
37
|
Requires-Dist: browserforge>=1.2.0; extra == "dev"
|
|
38
|
+
Dynamic: license-file
|
|
35
39
|
|
|
36
40
|
# Scrapely Python SDK
|
|
37
41
|
|
|
@@ -80,3 +84,9 @@ if __name__ == "__main__":
|
|
|
80
84
|
- Apify-compatible environment aliases and asynchronous client access
|
|
81
85
|
|
|
82
86
|
See the [complete Python SDK guide](../docs/sdk-python.md) for lifecycle details, option objects, storage selection, events, CDP behavior, run control, environment variables, errors, and the full public export list.
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
MIT (see [LICENSE](./LICENSE)), except for three files derived from the Apache-2.0 licensed
|
|
91
|
+
[apify-sdk-python](https://github.com/apify/apify-sdk-python), which stay under the Apache License 2.0
|
|
92
|
+
(see [LICENSE-APACHE](./LICENSE-APACHE) and [NOTICE](./NOTICE)).
|
|
@@ -45,3 +45,9 @@ if __name__ == "__main__":
|
|
|
45
45
|
- Apify-compatible environment aliases and asynchronous client access
|
|
46
46
|
|
|
47
47
|
See the [complete Python SDK guide](../docs/sdk-python.md) for lifecycle details, option objects, storage selection, events, CDP behavior, run control, environment variables, errors, and the full public export list.
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
MIT (see [LICENSE](./LICENSE)), except for three files derived from the Apache-2.0 licensed
|
|
52
|
+
[apify-sdk-python](https://github.com/apify/apify-sdk-python), which stay under the Apache License 2.0
|
|
53
|
+
(see [LICENSE-APACHE](./LICENSE-APACHE) and [NOTICE](./NOTICE)).
|
|
@@ -4,10 +4,11 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "scrapely-python"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.10"
|
|
8
8
|
description = "Scrapely Python SDK - A toolkit for building Actors on the Scrapely platform"
|
|
9
9
|
readme = "README.md"
|
|
10
|
-
license = "MIT"
|
|
10
|
+
license = "MIT AND Apache-2.0"
|
|
11
|
+
license-files = ["LICENSE", "LICENSE-APACHE", "NOTICE"]
|
|
11
12
|
authors = [
|
|
12
13
|
{name = "Scrapely", email = "support@scrape.ly"}
|
|
13
14
|
]
|
|
@@ -607,11 +607,14 @@ class Actor(metaclass=_ActorMeta):
|
|
|
607
607
|
*,
|
|
608
608
|
status_message: Optional[str] = None,
|
|
609
609
|
exit_code: Optional[int] = None,
|
|
610
|
+
exception: Optional[BaseException] = None,
|
|
610
611
|
) -> None:
|
|
611
612
|
"""Fail the Actor run (exit code defaults to ``1``).
|
|
612
613
|
|
|
613
|
-
Apify-Python parity: supports keyword-only ``status_message
|
|
614
|
-
``exit_code``
|
|
614
|
+
Apify-Python parity: supports keyword-only ``status_message``,
|
|
615
|
+
``exit_code`` and ``exception`` arguments
|
|
616
|
+
(``await Actor.fail(status_message="Boom", exception=e)``). When
|
|
617
|
+
``exception`` is given its traceback is logged.
|
|
615
618
|
The pre-existing positional forms (``Actor.fail("message")`` /
|
|
616
619
|
``Actor.fail(ExitOptions(...))``) remain supported; explicit keyword
|
|
617
620
|
arguments take precedence over the positional values when provided.
|
|
@@ -635,7 +638,10 @@ class Actor(metaclass=_ActorMeta):
|
|
|
635
638
|
if exit_code is not None:
|
|
636
639
|
opts.exit_code = exit_code
|
|
637
640
|
|
|
638
|
-
logger.error(
|
|
641
|
+
logger.error(
|
|
642
|
+
f'[Scrapely] Actor failed: {opts.status_message or "Unknown error"}',
|
|
643
|
+
exc_info=exception,
|
|
644
|
+
)
|
|
639
645
|
await cls.exit(opts)
|
|
640
646
|
|
|
641
647
|
@classmethod
|
|
@@ -1333,7 +1333,9 @@ async def push_data_and_charge(
|
|
|
1333
1333
|
raise
|
|
1334
1334
|
return ChargeResult(
|
|
1335
1335
|
chargeable_within_limit=charging_manager.compute_chargeable(),
|
|
1336
|
-
|
|
1336
|
+
# Rows charged, as Apify reports it for the pushed event; the
|
|
1337
|
+
# implicit default-dataset event is not counted on top.
|
|
1338
|
+
charged_count=accepted_for_items,
|
|
1337
1339
|
event_charge_limit_reached=any(
|
|
1338
1340
|
result.event_charge_limit_reached for result in results
|
|
1339
1341
|
)
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# Derived from apify-sdk-python (src/apify/events/_types.py),
|
|
3
|
+
# Copyright Apify Technologies s.r.o., licensed under the Apache License 2.0.
|
|
4
|
+
# Modified by TeraShift GmbH. See LICENSE-APACHE and NOTICE.
|
|
1
5
|
"""Scrapely event types - extends Crawlee's event types with Scrapely-specific data models."""
|
|
2
6
|
|
|
3
7
|
from __future__ import annotations
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# Derived from apify-sdk-python (src/apify/events/_apify_event_manager.py),
|
|
3
|
+
# Copyright Apify Technologies s.r.o., licensed under the Apache License 2.0.
|
|
4
|
+
# Modified by TeraShift GmbH. See LICENSE-APACHE and NOTICE.
|
|
1
5
|
"""Event manager for Scrapely Actors.
|
|
2
6
|
|
|
3
7
|
Extends Crawlee's EventManager with WebSocket connectivity to the Scrapely platform
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# Derived from apify-sdk-python (src/apify/request_loaders/_apify_request_list.py),
|
|
3
|
+
# Copyright Apify Technologies s.r.o., licensed under the Apache License 2.0.
|
|
4
|
+
# Modified by TeraShift GmbH. See LICENSE-APACHE and NOTICE.
|
|
1
5
|
"""ScrapelyRequestList - a request list that parses the standard Scrapely/Apify requestListSources input format."""
|
|
2
6
|
|
|
3
7
|
from __future__ import annotations
|
|
@@ -233,7 +233,11 @@ class ScrapelyRequestQueueClient(RequestQueueClient):
|
|
|
233
233
|
)
|
|
234
234
|
if not head.items:
|
|
235
235
|
return None
|
|
236
|
-
|
|
236
|
+
head_req = head.items[0]
|
|
237
|
+
# The head lists only id/uniqueKey/url/method (as on Apify); load the full
|
|
238
|
+
# request so userData and headers survive. Keep the head item if it vanished.
|
|
239
|
+
full_req = await self._api.rq_get_request(self._metadata.id, head_req.id) if head_req.id else None
|
|
240
|
+
api_req = full_req or head_req
|
|
237
241
|
request = _request_from_api({
|
|
238
242
|
'id': api_req.id,
|
|
239
243
|
'uniqueKey': api_req.unique_key,
|
|
@@ -243,10 +247,10 @@ class ScrapelyRequestQueueClient(RequestQueueClient):
|
|
|
243
247
|
'userData': api_req.user_data,
|
|
244
248
|
'retryCount': api_req.retry_count,
|
|
245
249
|
'handledAt': api_req.handled_at,
|
|
246
|
-
'lockExpiresAt':
|
|
250
|
+
'lockExpiresAt': head_req.lock_expires_at,
|
|
247
251
|
})
|
|
248
|
-
if
|
|
249
|
-
self._in_progress[request.unique_key] =
|
|
252
|
+
if head_req.id:
|
|
253
|
+
self._in_progress[request.unique_key] = head_req.id
|
|
250
254
|
return request
|
|
251
255
|
|
|
252
256
|
@override
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scrapely-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.10
|
|
4
4
|
Summary: Scrapely Python SDK - A toolkit for building Actors on the Scrapely platform
|
|
5
5
|
Author-email: Scrapely <support@scrape.ly>
|
|
6
|
-
License-Expression: MIT
|
|
6
|
+
License-Expression: MIT AND Apache-2.0
|
|
7
7
|
Project-URL: Homepage, https://scrape.ly
|
|
8
8
|
Project-URL: Documentation, https://docs.scrape.ly
|
|
9
9
|
Project-URL: Repository, https://github.com/SandeepDev1/scrapely
|
|
@@ -18,6 +18,9 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
18
18
|
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
19
19
|
Requires-Python: >=3.11
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
License-File: LICENSE-APACHE
|
|
23
|
+
License-File: NOTICE
|
|
21
24
|
Requires-Dist: httpx>=0.25.0
|
|
22
25
|
Requires-Dist: crawlee<2.0.0,>=1.8.0
|
|
23
26
|
Requires-Dist: websockets>=12.0
|
|
@@ -32,6 +35,7 @@ Requires-Dist: isort>=5.12.0; extra == "dev"
|
|
|
32
35
|
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
33
36
|
Requires-Dist: playwright>=1.40.0; extra == "dev"
|
|
34
37
|
Requires-Dist: browserforge>=1.2.0; extra == "dev"
|
|
38
|
+
Dynamic: license-file
|
|
35
39
|
|
|
36
40
|
# Scrapely Python SDK
|
|
37
41
|
|
|
@@ -80,3 +84,9 @@ if __name__ == "__main__":
|
|
|
80
84
|
- Apify-compatible environment aliases and asynchronous client access
|
|
81
85
|
|
|
82
86
|
See the [complete Python SDK guide](../docs/sdk-python.md) for lifecycle details, option objects, storage selection, events, CDP behavior, run control, environment variables, errors, and the full public export list.
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
MIT (see [LICENSE](./LICENSE)), except for three files derived from the Apache-2.0 licensed
|
|
91
|
+
[apify-sdk-python](https://github.com/apify/apify-sdk-python), which stay under the Apache License 2.0
|
|
92
|
+
(see [LICENSE-APACHE](./LICENSE-APACHE) and [NOTICE](./NOTICE)).
|
|
@@ -338,3 +338,41 @@ async def test_local_mode_never_posts_charges_despite_client_and_run_id() -> Non
|
|
|
338
338
|
# Flushing must not attempt any remote POST either.
|
|
339
339
|
assert await mgr.flush_pending() == 0
|
|
340
340
|
assert client.post_calls == []
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
@pytest.mark.asyncio
|
|
344
|
+
async def test_push_data_with_explicit_event_reports_rows_not_rows_times_events() -> None:
|
|
345
|
+
"""charged_count is the number of rows charged, not rows x events.
|
|
346
|
+
|
|
347
|
+
With an explicit event on the default dataset the SDK also charges the
|
|
348
|
+
(unpriced) default-dataset-item event. Apify returns the explicit event's
|
|
349
|
+
count; summing both reported twice the rows pushed.
|
|
350
|
+
"""
|
|
351
|
+
from scrapely.charging import push_data_and_charge
|
|
352
|
+
|
|
353
|
+
pricing = '{"pricingModel": "PAY_PER_EVENT", "pricingPerEvent": {"actorChargeEvents": {"profile": {"eventPriceUsd": 0.001, "eventTitle": "Profile"}}}}'
|
|
354
|
+
config = _config_with({
|
|
355
|
+
'is_at_home': False,
|
|
356
|
+
'actor_pricing_info': pricing,
|
|
357
|
+
'charged_event_counts': '{}',
|
|
358
|
+
'max_total_charge_usd': '10',
|
|
359
|
+
})
|
|
360
|
+
mgr = ChargingManager(config, None)
|
|
361
|
+
await mgr.init()
|
|
362
|
+
|
|
363
|
+
pushed: List[Any] = []
|
|
364
|
+
|
|
365
|
+
async def push_fn(items: List[Any]) -> None:
|
|
366
|
+
pushed.extend(items)
|
|
367
|
+
|
|
368
|
+
rows = [{'i': i} for i in range(3)]
|
|
369
|
+
result = await push_data_and_charge(mgr, rows, 'profile', True, push_fn)
|
|
370
|
+
|
|
371
|
+
assert len(pushed) == 3
|
|
372
|
+
assert result.charged_count == 3
|
|
373
|
+
assert result.event_charge_limit_reached is False
|
|
374
|
+
assert mgr.get_charged_event_count('profile') == 3
|
|
375
|
+
|
|
376
|
+
# Without an explicit event the default event alone is counted once.
|
|
377
|
+
result2 = await push_data_and_charge(mgr, rows, None, True, push_fn)
|
|
378
|
+
assert result2.charged_count == 3
|
|
@@ -286,7 +286,8 @@ async def test_explicit_and_default_dataset_events_are_each_reserved_once() -> N
|
|
|
286
286
|
)
|
|
287
287
|
|
|
288
288
|
assert len(pushed) == 2
|
|
289
|
-
|
|
289
|
+
# Rows charged (Apify parity), not rows x events: both events billed 2 each.
|
|
290
|
+
assert result.charged_count == 2
|
|
290
291
|
assert mgr.get_charged_event_count('page-open') == 2
|
|
291
292
|
assert mgr.get_charged_event_count('apify-default-dataset-item') == 2
|
|
292
293
|
assert mgr.get_total_charged_usd() == Decimal('0.04')
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import logging
|
|
5
6
|
from typing import Any, Dict, List, Optional
|
|
6
7
|
from unittest.mock import MagicMock
|
|
7
8
|
|
|
@@ -287,6 +288,26 @@ async def test_fail_accepts_exit_code_kwarg(_no_real_exit: List[int]) -> None:
|
|
|
287
288
|
_restore_lifecycle_state(state)
|
|
288
289
|
|
|
289
290
|
|
|
291
|
+
async def test_fail_accepts_exception_kwarg(
|
|
292
|
+
_no_real_exit: List[int], caplog: pytest.LogCaptureFixture
|
|
293
|
+
) -> None:
|
|
294
|
+
"""Regression: Apify-Python style ``Actor.fail(status_message=..., exception=e)`` must not TypeError."""
|
|
295
|
+
state = _save_lifecycle_state()
|
|
296
|
+
try:
|
|
297
|
+
try:
|
|
298
|
+
raise ValueError('boom')
|
|
299
|
+
except ValueError as e:
|
|
300
|
+
with caplog.at_level(logging.ERROR):
|
|
301
|
+
await Actor.fail(status_message='crashed', exception=e)
|
|
302
|
+
assert Actor._exit_code == 1
|
|
303
|
+
assert Actor._status_message == 'crashed'
|
|
304
|
+
assert _no_real_exit == [1]
|
|
305
|
+
failed = [r for r in caplog.records if 'Actor failed' in r.getMessage()]
|
|
306
|
+
assert failed and failed[0].exc_info and failed[0].exc_info[0] is ValueError
|
|
307
|
+
finally:
|
|
308
|
+
_restore_lifecycle_state(state)
|
|
309
|
+
|
|
310
|
+
|
|
290
311
|
async def test_fail_positional_message_still_works(_no_real_exit: List[int]) -> None:
|
|
291
312
|
"""Back-compat: the pre-existing positional form keeps working unchanged."""
|
|
292
313
|
state = _save_lifecycle_state()
|
|
@@ -138,6 +138,23 @@ async def test_rq_fetch_uses_head_lock(transport, mock_api):
|
|
|
138
138
|
assert second.url == 'https://example.com/1'
|
|
139
139
|
|
|
140
140
|
|
|
141
|
+
@pytest.mark.asyncio
|
|
142
|
+
async def test_rq_fetch_keeps_user_data(transport):
|
|
143
|
+
"""head/lock returns only id/uniqueKey/url/method, so fetch_next_request must
|
|
144
|
+
load the full request or user_data is lost (template KeyError: 'depth')."""
|
|
145
|
+
client = ScrapelyStorageClient(
|
|
146
|
+
api_url='https://api.test.scrape.ly',
|
|
147
|
+
token='t',
|
|
148
|
+
run_id='run-1',
|
|
149
|
+
transport=transport,
|
|
150
|
+
)
|
|
151
|
+
rq = await client.create_rq_client(name='user-data')
|
|
152
|
+
await rq.add_batch_of_requests([Request.from_url('https://example.com/d', user_data={'depth': 0})])
|
|
153
|
+
request = await rq.fetch_next_request()
|
|
154
|
+
assert request is not None
|
|
155
|
+
assert request.user_data['depth'] == 0
|
|
156
|
+
|
|
157
|
+
|
|
141
158
|
@pytest.mark.asyncio
|
|
142
159
|
async def test_rq_fetch_lock_outlasts_handler_timeout(mock_api):
|
|
143
160
|
"""The head lock must outlive Crawlee's 60s handler timeout, or an expired
|
|
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_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/_file_system/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/scrapely_dataset_client.py
RENAMED
|
File without changes
|
{scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/scrapely_kvs_client.py
RENAMED
|
File without changes
|
{scrapely_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely/storage/scrapely_storage_client.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_python-0.1.7 → scrapely_python-0.1.10}/src/scrapely_python.egg-info/dependency_links.txt
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
|