apify 1.7.3b4__py3-none-any.whl → 2.0.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.

Potentially problematic release.


This version of apify might be problematic. Click here for more details.

Files changed (61) hide show
  1. apify/__init__.py +19 -4
  2. apify/_actor.py +979 -0
  3. apify/_configuration.py +310 -0
  4. apify/_consts.py +10 -0
  5. apify/_crypto.py +29 -27
  6. apify/_models.py +110 -0
  7. apify/_platform_event_manager.py +222 -0
  8. apify/_proxy_configuration.py +316 -0
  9. apify/_utils.py +0 -497
  10. apify/apify_storage_client/__init__.py +3 -0
  11. apify/apify_storage_client/_apify_storage_client.py +56 -0
  12. apify/apify_storage_client/_dataset_client.py +188 -0
  13. apify/apify_storage_client/_dataset_collection_client.py +50 -0
  14. apify/apify_storage_client/_key_value_store_client.py +98 -0
  15. apify/apify_storage_client/_key_value_store_collection_client.py +50 -0
  16. apify/apify_storage_client/_request_queue_client.py +208 -0
  17. apify/apify_storage_client/_request_queue_collection_client.py +50 -0
  18. apify/apify_storage_client/py.typed +0 -0
  19. apify/log.py +24 -105
  20. apify/scrapy/__init__.py +11 -3
  21. apify/scrapy/middlewares/__init__.py +3 -1
  22. apify/scrapy/middlewares/apify_proxy.py +21 -21
  23. apify/scrapy/middlewares/py.typed +0 -0
  24. apify/scrapy/pipelines/__init__.py +3 -1
  25. apify/scrapy/pipelines/actor_dataset_push.py +1 -1
  26. apify/scrapy/pipelines/py.typed +0 -0
  27. apify/scrapy/py.typed +0 -0
  28. apify/scrapy/requests.py +55 -54
  29. apify/scrapy/scheduler.py +19 -13
  30. apify/scrapy/utils.py +2 -31
  31. apify/storages/__init__.py +2 -10
  32. apify/storages/py.typed +0 -0
  33. apify-2.0.0.dist-info/METADATA +209 -0
  34. apify-2.0.0.dist-info/RECORD +37 -0
  35. {apify-1.7.3b4.dist-info → apify-2.0.0.dist-info}/WHEEL +1 -2
  36. apify/_memory_storage/__init__.py +0 -3
  37. apify/_memory_storage/file_storage_utils.py +0 -71
  38. apify/_memory_storage/memory_storage_client.py +0 -219
  39. apify/_memory_storage/resource_clients/__init__.py +0 -19
  40. apify/_memory_storage/resource_clients/base_resource_client.py +0 -141
  41. apify/_memory_storage/resource_clients/base_resource_collection_client.py +0 -114
  42. apify/_memory_storage/resource_clients/dataset.py +0 -452
  43. apify/_memory_storage/resource_clients/dataset_collection.py +0 -48
  44. apify/_memory_storage/resource_clients/key_value_store.py +0 -533
  45. apify/_memory_storage/resource_clients/key_value_store_collection.py +0 -48
  46. apify/_memory_storage/resource_clients/request_queue.py +0 -466
  47. apify/_memory_storage/resource_clients/request_queue_collection.py +0 -48
  48. apify/actor.py +0 -1357
  49. apify/config.py +0 -130
  50. apify/consts.py +0 -67
  51. apify/event_manager.py +0 -236
  52. apify/proxy_configuration.py +0 -365
  53. apify/storages/base_storage.py +0 -181
  54. apify/storages/dataset.py +0 -494
  55. apify/storages/key_value_store.py +0 -257
  56. apify/storages/request_queue.py +0 -602
  57. apify/storages/storage_client_manager.py +0 -72
  58. apify-1.7.3b4.dist-info/METADATA +0 -150
  59. apify-1.7.3b4.dist-info/RECORD +0 -41
  60. apify-1.7.3b4.dist-info/top_level.txt +0 -1
  61. {apify-1.7.3b4.dist-info → apify-2.0.0.dist-info}/LICENSE +0 -0
@@ -1,150 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: apify
3
- Version: 1.7.3b4
4
- Summary: Apify SDK for Python
5
- Author-email: "Apify Technologies s.r.o." <support@apify.com>
6
- License: Apache Software License
7
- Project-URL: Homepage, https://docs.apify.com/sdk/python/
8
- Project-URL: Documentation, https://docs.apify.com/sdk/python/
9
- Project-URL: Source, https://github.com/apify/apify-sdk-python
10
- Project-URL: Issue tracker, https://github.com/apify/apify-sdk-python/issues
11
- Project-URL: Changelog, https://github.com/apify/apify-sdk-python/blob/master/CHANGELOG.md
12
- Project-URL: Apify Homepage, https://apify.com
13
- Keywords: apify,sdk,actor,scraping,automation
14
- Classifier: Development Status :: 5 - Production/Stable
15
- Classifier: Intended Audience :: Developers
16
- Classifier: License :: OSI Approved :: Apache Software License
17
- Classifier: Operating System :: OS Independent
18
- Classifier: Programming Language :: Python :: 3.8
19
- Classifier: Programming Language :: Python :: 3.9
20
- Classifier: Programming Language :: Python :: 3.10
21
- Classifier: Programming Language :: Python :: 3.11
22
- Classifier: Programming Language :: Python :: 3.12
23
- Classifier: Topic :: Software Development :: Libraries
24
- Requires-Python: >=3.8
25
- Description-Content-Type: text/markdown
26
- License-File: LICENSE
27
- Requires-Dist: apify-client ~=1.7.1
28
- Requires-Dist: apify-shared ~=1.1.2
29
- Requires-Dist: aiofiles >=22.1.0
30
- Requires-Dist: aioshutil >=1.0
31
- Requires-Dist: colorama >=0.4.6
32
- Requires-Dist: cryptography >=39.0.0
33
- Requires-Dist: httpx >=0.24.0
34
- Requires-Dist: psutil >=5.9.0
35
- Requires-Dist: pyee >=11.0.0
36
- Requires-Dist: sortedcollections >=2.0.0
37
- Requires-Dist: typing-extensions >=4.1.0
38
- Requires-Dist: websockets >=10.1
39
- Provides-Extra: dev
40
- Requires-Dist: build ~=1.2.0 ; extra == 'dev'
41
- Requires-Dist: filelock ~=3.15.0 ; extra == 'dev'
42
- Requires-Dist: mypy ~=1.10.0 ; extra == 'dev'
43
- Requires-Dist: pre-commit ~=3.5.0 ; extra == 'dev'
44
- Requires-Dist: pydoc-markdown ~=4.8.0 ; extra == 'dev'
45
- Requires-Dist: pytest ~=8.2.0 ; extra == 'dev'
46
- Requires-Dist: pytest-asyncio ~=0.23.0 ; extra == 'dev'
47
- Requires-Dist: pytest-cov ~=5.0.0 ; extra == 'dev'
48
- Requires-Dist: pytest-only ~=2.1.0 ; extra == 'dev'
49
- Requires-Dist: pytest-timeout ~=2.3.0 ; extra == 'dev'
50
- Requires-Dist: pytest-xdist ~=3.6.0 ; extra == 'dev'
51
- Requires-Dist: respx ~=0.21.0 ; extra == 'dev'
52
- Requires-Dist: ruff ~=0.5.0 ; extra == 'dev'
53
- Requires-Dist: setuptools ~=70.3.0 ; extra == 'dev'
54
- Requires-Dist: twine ~=5.1.0 ; extra == 'dev'
55
- Requires-Dist: types-aiofiles ~=24.1.0.20240626 ; extra == 'dev'
56
- Requires-Dist: types-colorama ~=0.4.15.20240311 ; extra == 'dev'
57
- Requires-Dist: types-psutil ~=6.0.0.20240621 ; extra == 'dev'
58
- Provides-Extra: scrapy
59
- Requires-Dist: scrapy >=2.11.0 ; extra == 'scrapy'
60
-
61
- # Apify SDK for Python
62
-
63
- The Apify SDK for Python is the official library to create [Apify Actors](https://docs.apify.com/platform/actors)
64
- in Python. It provides useful features like Actor lifecycle management, local storage emulation, and Actor
65
- event handling.
66
-
67
- If you just need to access the [Apify API](https://docs.apify.com/api/v2) from your Python applications,
68
- check out the [Apify Client for Python](https://docs.apify.com/api/client/python) instead.
69
-
70
- ## Installation
71
-
72
- The Apify SDK for Python is available on PyPI as the `apify` package.
73
- For default installation, using Pip, run the following:
74
-
75
- ```bash
76
- pip install apify
77
- ```
78
-
79
- For users interested in integrating Apify with Scrapy, we provide a package extra called `scrapy`.
80
- To install Apify with the `scrapy` extra, use the following command:
81
-
82
- ```bash
83
- pip install apify[scrapy]
84
- ```
85
-
86
- ## Documentation
87
-
88
- For usage instructions, check the documentation on [Apify Docs](https://docs.apify.com/sdk/python/).
89
-
90
- ## Example
91
-
92
- ```python
93
- from apify import Actor
94
- from bs4 import BeautifulSoup
95
- from httpx import AsyncClient
96
-
97
- async def main() -> None:
98
- async with Actor:
99
- # Read the input parameters from the Actor input
100
- actor_input = await Actor.get_input()
101
- # Fetch the HTTP response from the specified URL
102
- async with AsyncClient() as client:
103
- response = await client.get(actor_input['url'])
104
- # Process the HTML content
105
- soup = BeautifulSoup(response.content, 'html.parser')
106
- # Push the extracted data
107
- await Actor.push_data({
108
- 'url': actor_input['url'],
109
- 'title': soup.title.string,
110
- })
111
- ```
112
-
113
- ## What are Actors?
114
-
115
- Actors are serverless cloud programs that can do almost anything a human can do in a web browser.
116
- They can do anything from small tasks such as filling in forms or unsubscribing from online services,
117
- all the way up to scraping and processing vast numbers of web pages.
118
-
119
- They can be run either locally, or on the [Apify platform](https://docs.apify.com/platform/),
120
- where you can run them at scale, monitor them, schedule them, or publish and monetize them.
121
-
122
- If you're new to Apify, learn [what is Apify](https://docs.apify.com/platform/about)
123
- in the Apify platform documentation.
124
-
125
- ## Creating Actors
126
-
127
- To create and run Actors through Apify Console,
128
- see the [Console documentation](https://docs.apify.com/academy/getting-started/creating-actors#choose-your-template).
129
-
130
- To create and run Python Actors locally, check the documentation for
131
- [how to create and run Python Actors locally](https://docs.apify.com/sdk/python/docs/overview/running-locally).
132
-
133
- ## Guides
134
-
135
- To see how you can use the Apify SDK with other popular libraries used for web scraping,
136
- check out our guides for using
137
- [Requests and HTTPX](https://docs.apify.com/sdk/python/docs/guides/requests-and-httpx),
138
- [Beautiful Soup](https://docs.apify.com/sdk/python/docs/guides/beautiful-soup),
139
- [Playwright](https://docs.apify.com/sdk/python/docs/guides/playwright),
140
- [Selenium](https://docs.apify.com/sdk/python/docs/guides/selenium),
141
- or [Scrapy](https://docs.apify.com/sdk/python/docs/guides/scrapy).
142
-
143
- ## Usage concepts
144
-
145
- To learn more about the features of the Apify SDK and how to use them,
146
- check out the Usage Concepts section in the sidebar,
147
- particularly the guides for the [Actor lifecycle](https://docs.apify.com/sdk/python/docs/concepts/actor-lifecycle),
148
- [working with storages](https://docs.apify.com/sdk/python/docs/concepts/storages),
149
- [handling Actor events](https://docs.apify.com/sdk/python/docs/concepts/actor-events)
150
- or [how to use proxies](https://docs.apify.com/sdk/python/docs/concepts/proxy-management).
@@ -1,41 +0,0 @@
1
- apify/__init__.py,sha256=aAjho-r0-XAqUjD9j55ueCo4lZJzyytOWjk0VCmkeeY,283
2
- apify/_crypto.py,sha256=mbqwfgVz7efAw6ko1PTtpaaRqlBvTi-oskiZmWufTrk,5822
3
- apify/_utils.py,sha256=vh4VKoaBe_aWz-eEPOFj6bkUvgDmaUkdw3CLpP9RyT4,16929
4
- apify/actor.py,sha256=lwgE9huMDVgw8ehTFNrZAk5hwSlQNGuYeBx6aKcHiBM,60423
5
- apify/config.py,sha256=1orNGYPiqcT_3Q8_DPRIpX1LjicqzK6e_nvMaGcU1ng,9045
6
- apify/consts.py,sha256=eSD23HmwLKwWG8bRp5O1c7bmtlhvYE17Yw46BKs4vQQ,2263
7
- apify/event_manager.py,sha256=k4_f977esIOvgGshec4yUSulU10-UsEkoVEV4sZEjwg,10612
8
- apify/log.py,sha256=iNAUOk5BscZzkppBjFJm2XpydwkXKm45UsUkxHWu43E,5022
9
- apify/proxy_configuration.py,sha256=SuHKY8ORdQThbBtgyW2t_nHDE6GUHm1bPlohHd8JyNg,15747
10
- apify/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- apify/_memory_storage/__init__.py,sha256=frNb9kh6bfKtZNEMe2PA_QlT6DTUbhffcNfWhELiZNQ,90
12
- apify/_memory_storage/file_storage_utils.py,sha256=83gd8ruzY_vkrpHT1ZeG3r8qJJKCKLeuGrxsBQgXeAE,2266
13
- apify/_memory_storage/memory_storage_client.py,sha256=5v6tUjzFIW7Mpr4iK0tERysRwgTt5TeEDoyjqTXjf-o,10598
14
- apify/_memory_storage/resource_clients/__init__.py,sha256=afkbzv59lgBe_JCgJcTbAt-ayX0VjtO6u0ExI7JVkEk,705
15
- apify/_memory_storage/resource_clients/base_resource_client.py,sha256=EXLXVppYdjDG5-2xd7Kpr2ziLDm5j01E9MBUQnXD8Xc,4929
16
- apify/_memory_storage/resource_clients/base_resource_collection_client.py,sha256=et-ChUnuLPnk_dYXG9kyPsvY9seM-5WIjYfGC5cMDeo,3986
17
- apify/_memory_storage/resource_clients/dataset.py,sha256=ySPzEQXeopwKLNhlEGvYl9KvuGz5u86piHWT2xDns6w,20062
18
- apify/_memory_storage/resource_clients/dataset_collection.py,sha256=tk5GUb1azeHQwFuX106AhGt7I_1sHWSV2n952-p4rug,1614
19
- apify/_memory_storage/resource_clients/key_value_store.py,sha256=5LVTuSzsSS6uDmUXAKa1ShyFRsES3eDDpguVGDb-OkE,20581
20
- apify/_memory_storage/resource_clients/key_value_store_collection.py,sha256=CBTcgffPmxLdEWz3KfjNsrQO49NHwW3QOD-AYA_C5hU,1740
21
- apify/_memory_storage/resource_clients/request_queue.py,sha256=6skV2fGpDxrDtn43oQIiBxd4kA5wJ8ygw7_Yy1q7M_M,19700
22
- apify/_memory_storage/resource_clients/request_queue_collection.py,sha256=qW7kPLKRl5mukIGCT8iNCsXT82BUYSwCV_KH7MLj528,1713
23
- apify/scrapy/__init__.py,sha256=xrhyVgPvdB_kB6ugkhUM4YM3WkvBUu5ZiV_4bW11LwM,195
24
- apify/scrapy/requests.py,sha256=BBjXUametZNVgV-BzTLnrv3rOIxBnAtCkakkCf7ZFvs,7935
25
- apify/scrapy/scheduler.py,sha256=51GME-shm0-Yks2ERmIJRrCCJ6oCId5757obQmbCNTY,5789
26
- apify/scrapy/utils.py,sha256=A_BhU_yxPQ__SYsoz9dMiwJ2pbh-oZCuEwVMKaSXtwo,3899
27
- apify/scrapy/middlewares/__init__.py,sha256=gb3bCu__5wKO_ePhfFgGm-Chw384r8IbC3eoIsz0uG0,50
28
- apify/scrapy/middlewares/apify_proxy.py,sha256=pDNx31y7llSv3ZM1SSujEYZSWQTfNfAqKvsNph5zbbU,5919
29
- apify/scrapy/pipelines/__init__.py,sha256=KBUE3maOWrLfJRmWSsyW6YxxZY4lCGP2GZyMm9Z56VY,57
30
- apify/scrapy/pipelines/actor_dataset_push.py,sha256=SlddL0Cwu32lQ6jYPsXybsrjHlrh7N-ADaH4a8ni4Do,959
31
- apify/storages/__init__.py,sha256=rBdwhyZxUMG6m_7uAb4sl5eg_dxiLvYVas5aRcZ6PIE,268
32
- apify/storages/base_storage.py,sha256=exPzjyMkkUccvg2qPcjZtLJQLWhfrlQxQHV-8p_K8w0,7434
33
- apify/storages/dataset.py,sha256=gfMlJ6dSXDdjCykkStZCyp4u8xKCIZqflGS9-jLzK74,23339
34
- apify/storages/key_value_store.py,sha256=BUGYPI4MuRlOJ_aPzZr8bq7ay_K04qAZ7yKW7C8ItV4,10760
35
- apify/storages/request_queue.py,sha256=68pM2nJUYjkdpBTM315NnjRYE_yzeoslVtBQRB7bm74,28829
36
- apify/storages/storage_client_manager.py,sha256=fvXg3PRojATNamEN29BBZyZZ5GWN_s0r29A59aiL-wQ,2465
37
- apify-1.7.3b4.dist-info/LICENSE,sha256=AsFjHssKjj4LGd2ZCqXn6FBzMqcWdjQre1byPPSypVw,11355
38
- apify-1.7.3b4.dist-info/METADATA,sha256=vFrOFeIofDIblK4qbGkAqXPz4tw7XHw9h4AyCzJgGWw,6307
39
- apify-1.7.3b4.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
40
- apify-1.7.3b4.dist-info/top_level.txt,sha256=2oFNsHggn5m_rCaaP7xijQg_-Va2ByOSYuvKgACsS5w,6
41
- apify-1.7.3b4.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- apify