apify-sdk-python
apify-sdk-python copied to clipboard
The Apify SDK for Python is the official library for creating Apify Actors in Python. It provides useful features like actor lifecycle management, local storage emulation, and actor event handling.
Do not use `Any` type as suggested in the [ANN401](https://docs.astral.sh/ruff/rules/any-type/). Instead of ```python from typing import Any def get_first(container: list[Any]) -> Any: return container[0] ``` use the following ```python from...
Replace usage of asserts with ValueError checks as violation [S101](https://docs.astral.sh/ruff/rules/assert/) suggests. Motivation in the link.
Utilizing star imports, such as `from apify_client import *`, is generally considered as a bad practice in Python. This is because it can lead to namespace conflicts. While there may...
We have introduced [apify-shared-python](https://github.com/apify/apify-shared-python) to consolidate general constants for both the Client and SDK. To facilitate a seamless transition to the new package, we have implemented re-imports with `DeprecationWarning` in...
I think some logic from [\_\_main\_\_.py](https://github.com/apify/actor-templates/blob/dc5e68805dcf630f35d112a7e113e4f388bbf30a/templates/python-scrapy/src/__main__.py) could be moved to the SDK. I think `new_configure_logging` could be a decorator which is just imported from Apify SDK. I think `configure_logger` and...
I believe we can use just `poetry` instead of `pip`, `virtualenv`, `setuptools` and `twine` (although, it uses some of them under the hood). https://python-poetry.org/
Remove the fallback in https://github.com/apify/apify-sdk-python/blob/v1.4.0/tests/unit/conftest.py#L86:L104 once we get rid of support for Python 3.8 and Python 3.9.
* Implement methods for request queue v2 (locking, batch operations) * Implement request queue v2 into local request queue (locking, batch operations) * On top of that there is a...
Right now, we have some constants duplicated between the `@apify/consts` NPM package and the Python Client and Python SDK. We should look into how to have them defined only in...
- **Update pyproject.toml** - **Use storage code from crawlee, add ApifyStorageClient** - [x] make sure we use `APIFY_IS_AT_HOME` instead of token for all platform vs. local decisions - [ ]...