apify-sdk-python
Index
Async Resource Clients
Classes
Methods
- __delitem__
- __get__
- __getattr__
- __getitem__
- __init__
- __init__
- __init__
- __init__
- __init__
- __init__
- __init__
- __init__
- __init__
- __init__
- __init__
- __iter__
- __len__
- __setitem__
- add_request
- budget_ow
- close
- compute_short_hash
- compute_unique_key
- crypto_random_object_id
- dataset
- datasets
- decrypt_input_secrets
- delete
- delete
- delete
- delete_record
- delete_request
- delete_request
- emit
- fetch_and_parse_env_var
- force_remove
- force_rename
- get
- get
- get
- get
- get_basic_auth_header
- get_cpu_usage_percent
- get_items_as_bytes
- get_memory_usage_bytes
- get_or_create
- get_or_create
- get_or_create
- get_or_create
- get_record
- get_record_as_bytes
- get_request
- get_running_event_loop_id
- get_storage_client
- get_system_info
- guess_file_extension
- init
- is_running_in_ipython
- is_url
- items
- iterate_items
- key_value_store
- key_value_stores
- list
- list
- list
- list
- list_head
- list_items
- list_keys
- load_private_key
- maybe_parse_body
- maybe_parse_bool
- maybe_parse_datetime
- maybe_parse_float
- maybe_parse_int
- normalize_url
- off
- on
- open
- open_queue_with_custom_client
- push_items
- raise_on_duplicate_storage
- raise_on_non_existing_storage
- request_queue
- request_queues
- set_cloud_client
- set_config
- set_record
- stream_items
- stream_record
- to_apify_request
- to_scrapy_request
- unique_key_to_request_id
- update
- update
- update
- update_metadata
- update_request
- update_request_queue_item
- values
- wait_for_all_listeners_to_complete
- wrap_internal
Properties
- __version__
- API_PROCESSED_REQUESTS_DELAY_MILLIS
- APIFY_PROXY_VALUE_REGEX
- BASE64_REGEXP
- BaseResourceClientType
- BaseResourceCollectionClientType
- COUNTRY_CODE_REGEX
- DEFAULT_API_PARAM_LIMIT
- DEPRECATED_NAMES
- DualPropertyOwner
- DualPropertyType
- EFFECTIVE_LIMIT_BYTES
- ENCRYPTED_INPUT_VALUE_PREFIX
- ENCRYPTED_INPUT_VALUE_REGEXP
- ENCRYPTION_AUTH_TAG_LENGTH
- ENCRYPTION_IV_LENGTH
- ENCRYPTION_KEY_LENGTH
- EVENT_LISTENERS_TIMEOUT_SECS
- ImplementationType
- LIST_ITEMS_LIMIT
- ListenerType
- ListOrDictOrAny
- LOCAL_ENTRY_NAME_DIGITS
- logger
- logger
- logger_name
- MainReturnType
- MAX_CACHED_REQUESTS
- MAX_PAYLOAD_SIZE_BYTES
- MAX_QUERIES_FOR_CONSISTENCY
- MetadataType
- nested_event_loop
- PARSE_DATE_FIELDS_KEY_SUFFIX
- PARSE_DATE_FIELDS_MAX_DEPTH
- QUERY_HEAD_BUFFER
- QUERY_HEAD_MIN_LENGTH
- RECENTLY_HANDLED_CACHE_SIZE
- REQUEST_ID_LENGTH
- REQUEST_QUEUE_HEAD_MAX_LIMIT
- ResourceClientType
- SAFETY_BUFFER_PERCENT
- SESSION_ID_MAX_LENGTH
- STORAGE_CONSISTENCY_DELAY_MILLIS
- T
- T
- T
Constants
Scrapy integration
Storages
Storage data
Event managers
Events
Event data
Storage clients
Request loaders
Async Resource Clients
run_func_at_interval_async
Parameters
func: Callable
interval_secs: float
Returns None
Methods
__delitem__
Parameters
key: str
Returns None
__get__
Call the getter with the right object.
Parameters
obj: DualPropertyOwner | None
The instance of class T on which the getter will be called
owner: type[DualPropertyOwner]
The class object of class T on which the getter will be called, if obj is None
Returns DualPropertyType
The result of the getter.
__getattr__
Parameters
name: str
Returns Any
__getitem__
Get an item from the cache. Move it to the end if present.
Parameters
key: str
Returns T
__init__
Create an instance of the EventManager.
Parameters
config: Configuration
The actor configuration to be used in this event manager.
Returns None
__init__
Initialize the dualproperty.
Parameters
getter: Callable[..., DualPropertyType]
The getter of the property. It should accept either an instance or a class as its first argument.
Returns None
__init__
Create a LRUCache with a specific max_length.
Parameters
max_length: int
Returns None
__init__
Initialize the MemoryStorageClient.
Parameters
optionalkeyword-onlylocal_data_directory: str | None = None
A local directory where all data will be persisted
optionalkeyword-onlywrite_metadata: bool | None = None
Whether to persist metadata of the storages as well
optionalkeyword-onlypersist_storage: bool | None = None
Whether to persist the data to the
local_data_directoryor just keep them in memory
Returns None
__init__
Initialize the DatasetCollectionClient with the passed arguments.
Parameters
keyword-onlybase_storage_directory: str
keyword-onlymemory_storage_client: MemoryStorageClient
Returns None
__init__
Initialize the DatasetClient.
Parameters
keyword-onlybase_storage_directory: str
keyword-onlymemory_storage_client: MemoryStorageClient
optionalkeyword-onlyid: str | None = None
optionalkeyword-onlyname: str | None = None
Returns None
__init__
Initialize the KeyValueStoreClient.
Parameters
keyword-onlybase_storage_directory: str
keyword-onlymemory_storage_client: MemoryStorageClient
optionalkeyword-onlyid: str | None = None
optionalkeyword-onlyname: str | None = None
Returns None
__init__
Initialize the RequestQueueClient.
Parameters
keyword-onlybase_storage_directory: str
keyword-onlymemory_storage_client: MemoryStorageClient
optionalkeyword-onlyid: str | None = None
optionalkeyword-onlyname: str | None = None
Returns None
__init__
Initialize the BaseResourceClient.
Parameters
keyword-onlybase_storage_directory: str
keyword-onlymemory_storage_client: MemoryStorageClient
optionalkeyword-onlyid: str | None = None
optionalkeyword-onlyname: str | None = None
Returns None
__init__
Create a
StorageClientManagerinstance.Returns None
__init__
Initialize the storage.
Do not use this method directly, but use
Actor.open_<STORAGE>()instead.Parameters
id: str
The storage id
name: str | None
The storage name
client: ApifyClientAsync | MemoryStorageClient
The storage client
config: Configuration
The configuration
Returns None
__iter__
Iterate over the keys of the cache in order of insertion.
Returns Iterator[str]
__len__
Get the number of items in the cache.
Returns int
__setitem__
Add an item to the cache. Remove least used item if max_length exceeded.
Parameters
key: str
value: T
Returns None
add_request
Add a request to the queue.
Parameters
request: dict
The request to add to the queue
optionalkeyword-onlyforefront: bool | None = None
Whether to add the request to the head or the end of the queue
Returns dict
dict: The added request.
budget_ow
Budget version of ow.
Parameters
value: ((dict | str) | float) | bool
predicate: dict[str, tuple[type, bool]] | tuple[type, bool]
optionalvalue_name: str | None = None
Returns None
close
Initialize the event manager.
This will stop listening for the platform events, and it will wait for all the event listeners to finish.
Parameters
optionalevent_listeners_timeout_secs: float | None = None
Optional timeout after which the pending event listeners are canceled.
Returns None
compute_short_hash
Computes a hexadecimal SHA-256 hash of the provided data and returns a substring (prefix) of it.
Parameters
data: bytes
The binary data to be hashed.
optionalkeyword-onlylength: int = 8
The length of the hash to be returned.
Returns str
A substring (prefix) of the hexadecimal hash of the data.
compute_unique_key
Computes a unique key for caching & deduplication of requests.
This function computes a unique key by normalizing the provided URL and method. If 'use_extended_unique_key' is True and a payload is provided, the payload is hashed and included in the key. Otherwise, the unique key is just the normalized URL.
Parameters
url: str
The request URL.
optionalmethod: str = 'GET'
The HTTP method, defaults to 'GET'.
optionalpayload: bytes | None = None
The request payload, defaults to None.
optionalkeyword-onlykeep_url_fragment: bool = False
A flag indicating whether to keep the URL fragment, defaults to False.
optionalkeyword-onlyuse_extended_unique_key: bool = False
A flag indicating whether to include a hashed payload in the key, defaults to False.
Returns str
A string representing the unique key for the request.
crypto_random_object_id
Python reimplementation of cryptoRandomObjectId from
@apify/utilities.Parameters
optionallength: int = 17
Returns str
dataset
Retrieve the sub-client for manipulating a single dataset.
Parameters
dataset_id: str
ID of the dataset to be manipulated
Returns DatasetClient
datasets
Retrieve the sub-client for manipulating datasets.
Returns DatasetCollectionClient
decrypt_input_secrets
Decrypt input secrets.
Parameters
private_key: rsa.RSAPrivateKey
input: Any
Returns Any
delete
Delete the dataset.
Returns None
delete
Delete the key-value store.
Returns None
delete
Delete the request queue.
Returns None
delete_record
Delete the specified record from the key-value store.
Parameters
key: str
The key of the record which to delete
Returns None
delete_request
Parameters
keyword-onlyrequest_id: str
keyword-onlyentity_directory: str
Returns None
delete_request
Delete a request from the queue.
Parameters
request_id: str
ID of the request to delete.
Returns None
emit
Emit an actor event manually.
Parameters
event_name: ActorEventTypes
The actor event which should be emitted.
data: Any
The data that should be emitted with the event.
Returns None
fetch_and_parse_env_var
Parameters
env_var: Any
optionaldefault: Any = None
Returns Any
force_remove
JS-like rm(filename, { force: true }).
Parameters
filename: str
Returns None
force_rename
Rename a directory. Checks for existence of source directory and removes destination directory if it exists.
Parameters
src_dir: str
dst_dir: str
Returns None
get
Retrieve the dataset.
Returns dict | None
dict, optional: The retrieved dataset, or None, if it does not exist
get
Retrieve the key-value store.
Returns dict | None
dict, optional: The retrieved key-value store, or None if it does not exist
get
Retrieve the request queue.
Returns dict | None
dict, optional: The retrieved request queue, or None, if it does not exist
get
Retrieve the storage.
Returns dict | None
dict, optional: The retrieved storage, or None, if it does not exist
get_basic_auth_header
Generate a basic authentication header for the given username and password.
Parameters
username: str
password: str
optionalauth_encoding: str = 'latin-1'
Returns bytes
get_cpu_usage_percent
Returns float
get_items_as_bytes
Parameters
_args: Any
_kwargs: Any
Returns bytes
get_memory_usage_bytes
Returns int
get_or_create
Retrieve a named key-value store, or create a new one when it doesn't exist.
Parameters
optionalkeyword-onlyname: str | None = None
The name of the key-value store to retrieve or create.
optionalkeyword-onlyschema: dict | None = None
The schema of the key-value store
optionalkeyword-only_id: str | None = None
Returns dict
dict: The retrieved or newly-created key-value store.
get_or_create
Retrieve a named storage, or create a new one when it doesn't exist.
Parameters
optionalkeyword-onlyname: str | None = None
The name of the storage to retrieve or create.
optionalkeyword-onlyschema: dict | None = None
The schema of the storage
optionalkeyword-only_id: str | None = None
Returns dict
dict: The retrieved or newly-created storage.
get_or_create
Retrieve a named request queue, or create a new one when it doesn't exist.
Parameters
optionalkeyword-onlyname: str | None = None
The name of the request queue to retrieve or create.
optionalkeyword-onlyschema: dict | None = None
The schema of the request queue
optionalkeyword-only_id: str | None = None
Returns dict
dict: The retrieved or newly-created request queue.
get_or_create
Retrieve a named dataset, or create a new one when it doesn't exist.
Parameters
optionalkeyword-onlyname: str | None = None
The name of the dataset to retrieve or create.
optionalkeyword-onlyschema: dict | None = None
The schema of the dataset
optionalkeyword-only_id: str | None = None
Returns dict
dict: The retrieved or newly-created dataset.
get_record
Retrieve the given record from the key-value store.
Parameters
key: str
Key of the record to retrieve
Returns dict | None
dict, optional: The requested record, or None, if the record does not exist
get_record_as_bytes
Retrieve the given record from the key-value store, without parsing it.
Parameters
key: str
Key of the record to retrieve
Returns dict | None
dict, optional: The requested record, or None, if the record does not exist
get_request
Retrieve a request from the queue.
Parameters
request_id: str
ID of the request to retrieve
Returns dict | None
dict, optional: The retrieved request, or None, if it did not exist.
get_running_event_loop_id
Get the ID of the currently running event loop.
It could be useful mainly for debugging purposes.
Returns int
The ID of the event loop.
get_storage_client
Get the current storage client instance.
Parameters
optionalforce_cloud: bool = False
Returns ApifyClientAsync | MemoryStorageClient
ApifyClientAsync or MemoryStorageClient: The current storage client instance.
get_system_info
Returns dict
guess_file_extension
Guess the file extension based on content type.
Parameters
content_type: str
Returns str | None
init
Initialize the event manager.
When running this on the Apify Platform, this will start processing events send by the platform to the events websocket and emitting them as events that can be listened to by the
Actor.on()method.Returns None
is_running_in_ipython
Returns bool
is_url
Check if the given string is a valid URL.
Parameters
url: str
Returns bool
items
Iterate over the pairs of (key, value) in the cache in order of insertion.
Returns ItemsView[str, T]
iterate_items
Iterate over the items in the dataset.
Parameters
optionalkeyword-onlyoffset: int = 0
Number of items that should be skipped at the start. The default value is 0
optionalkeyword-onlylimit: int | None = None
Maximum number of items to return. By default there is no limit.
optionalkeyword-onlyclean: bool | None = None
If True, returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The clean parameter is just a shortcut for skip_hidden=True and skip_empty=True parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the limit value.
optionalkeyword-onlydesc: bool | None = None
By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to True.
optionalkeyword-onlyfields: list[str] | None = None
A list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the fields parameter. You can use this feature to effectively fix the output format.
optionalkeyword-onlyomit: list[str] | None = None
A list of fields which should be omitted from the items.
optionalkeyword-onlyunwind: str | None = None
Name of a field which should be unwound. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object, then the item gets preserved as it is. Note that the unwound items ignore the desc parameter.
optionalkeyword-onlyskip_empty: bool | None = None
If True, then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value.
optionalkeyword-onlyskip_hidden: bool | None = None
If True, then hidden fields are skipped from the output, i.e. fields starting with the # character.
Returns AsyncIterator[dict]
key_value_store
Retrieve the sub-client for manipulating a single key-value store.
Parameters
key_value_store_id: str
ID of the key-value store to be manipulated
Returns KeyValueStoreClient
key_value_stores
Retrieve the sub-client for manipulating key-value stores.
Returns KeyValueStoreCollectionClient
list
List the available key-value stores.
Returns ListPage
ListPage: The list of available key-value stores matching the specified filters.
list
List the available storages.
Returns ListPage
ListPage: The list of available storages matching the specified filters.
list
List the available request queues.
Returns ListPage
ListPage: The list of available request queues matching the specified filters.
list
List the available datasets.
Returns ListPage
ListPage: The list of available datasets matching the specified filters.
list_head
Retrieve a given number of requests from the beginning of the queue.
Parameters
optionalkeyword-onlylimit: int | None = None
How many requests to retrieve
Returns dict
dict: The desired number of requests from the beginning of the queue.
list_items
List the items of the dataset.
Parameters
optionalkeyword-onlyoffset: int | None = 0
Number of items that should be skipped at the start. The default value is 0
optionalkeyword-onlylimit: int | None = LIST_ITEMS_LIMIT
Maximum number of items to return. By default there is no limit.
optionalkeyword-onlyclean: bool | None = None
If True, returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The clean parameter is just a shortcut for skip_hidden=True and skip_empty=True parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the limit value.
optionalkeyword-onlydesc: bool | None = None
By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to True.
optionalkeyword-onlyfields: list[str] | None = None
A list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the fields parameter. You can use this feature to effectively fix the output format.
optionalkeyword-onlyomit: list[str] | None = None
A list of fields which should be omitted from the items.
optionalkeyword-onlyunwind: str | None = None
Name of a field which should be unwound. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object, then the item gets preserved as it is. Note that the unwound items ignore the desc parameter.
optionalkeyword-onlyskip_empty: bool | None = None
If True, then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value.
optionalkeyword-onlyskip_hidden: bool | None = None
If True, then hidden fields are skipped from the output, i.e. fields starting with the # character.
optionalkeyword-onlyflatten: list[str] | None = None
A list of fields that should be flattened
optionalkeyword-onlyview: str | None = None
Name of the dataset view to be used
Returns ListPage
ListPage: A page of the list of dataset items according to the specified filters.
list_keys
List the keys in the key-value store.
Parameters
optionalkeyword-onlylimit: int = DEFAULT_API_PARAM_LIMIT
Number of keys to be returned. Maximum value is 1000
optionalkeyword-onlyexclusive_start_key: str | None = None
All keys up to this one (including) are skipped from the result
Returns dict
dict: The list of keys in the key-value store matching the given arguments
load_private_key
Parameters
private_key_file_base64: str
private_key_password: str
Returns rsa.RSAPrivateKey
maybe_parse_body
Parameters
body: bytes
content_type: str
Returns Any
maybe_parse_bool
Parameters
val: str | None
Returns bool
maybe_parse_datetime
Parameters
val: str
Returns datetime | str
maybe_parse_float
Parameters
val: str
Returns float | None
maybe_parse_int
Parameters
val: str
Returns int | None
normalize_url
Normalizes a URL.
This function cleans and standardizes a URL by removing leading and trailing whitespaces, converting the scheme and netloc to lower case, stripping unwanted tracking parameters (specifically those beginning with 'utm_'), sorting the remaining query parameters alphabetically, and optionally retaining the URL fragment. The goal is to ensure that URLs that are functionally identical but differ in trivial ways (such as parameter order or casing) are treated as the same.
Parameters
url: str
The URL to be normalized.
optionalkeyword-onlykeep_url_fragment: bool = False
Flag to determine whether the fragment part of the URL should be retained.
Returns str
A string containing the normalized URL.
off
Remove a listener, or all listeners, from an actor event.
Parameters
event_name: ActorEventTypes
The actor event for which to remove listeners.
optionallistener: Callable | None = None
The listener which is supposed to be removed. If not passed, all listeners of this event are removed.
Returns None
on
Add an event listener to the event manager.
Parameters
event_name: ActorEventTypes
The actor event for which to listen to.
listener: ListenerType
The function which is to be called when the event is emitted (can be async). Must accept either zero or one arguments (the first argument will be the event data).
Returns Callable
open
Open a storage, or return a cached storage object if it was opened before.
Opens a storage with the given ID or name. Returns the cached storage object if the storage was opened before.
Parameters
optionalkeyword-onlyid: str | None = None
ID of the storage to be opened. If neither
idnornameare provided, the method returns the default storage associated with the actor run. If the storage with the given ID does not exist, it raises an error.optionalkeyword-onlyname: str | None = None
Name of the storage to be opened. If neither
idnornameare provided, the method returns the default storage associated with the actor run. If the storage with the given name does not exist, it is created.optionalkeyword-onlyforce_cloud: bool = False
If set to True, it will open a storage on the Apify Platform even when running the actor locally. Defaults to False.
optionalkeyword-onlyconfig: Configuration | None = None
A
Configurationinstance, uses global configuration if omitted.
Returns BaseStorage
An instance of the storage.
open_queue_with_custom_client
Open a Request Queue with custom Apify Client.
TODO: add support for custom client to Actor.open_request_queue(), so that we don't have to do this hacky workaround
Returns RequestQueue
push_items
Push items to the dataset.
Parameters
items: JSONSerializable
The items which to push in the dataset. Either a stringified JSON, a dictionary, or a list of strings or dictionaries.
Returns None
raise_on_duplicate_storage
Parameters
client_type: StorageTypes
key_name: str
value: str
Returns NoReturn
raise_on_non_existing_storage
Parameters
client_type: StorageTypes
id: str
Returns NoReturn
request_queue
Retrieve the sub-client for manipulating a single request queue.
Parameters
request_queue_id: str
ID of the request queue to be manipulated
optionalkeyword-onlyclient_key: str | None = None
A unique identifier of the client accessing the request queue
Returns RequestQueueClient
request_queues
Retrieve the sub-client for manipulating request queues.
Returns RequestQueueCollectionClient
set_cloud_client
Set the storage client.
Parameters
client: ApifyClientAsync
The instance of a storage client.
Returns None
set_config
Set the config for the StorageClientManager.
Parameters
config: Configuration
The configuration this StorageClientManager should use.
Returns None
set_record
Set a value to the given record in the key-value store.
Parameters
key: str
The key of the record to save the value to
value: Any
The value to save into the record
optionalcontent_type: str | None = None
The content type of the saved value
Returns None
stream_items
Parameters
_args: Any
_kwargs: Any
Returns AsyncIterator
stream_record
Parameters
_key: str
Returns AsyncIterator[dict | None]
to_apify_request
Convert a Scrapy request to an Apify request.
Parameters
scrapy_request: Request
The Scrapy request to be converted.
spider: Spider
The Scrapy spider that the request is associated with.
Returns dict | None
The converted Apify request if the conversion was successful, otherwise None.
to_scrapy_request
Convert an Apify request to a Scrapy request.
Parameters
apify_request: dict
The Apify request to be converted.
spider: Spider
The Scrapy spider that the request is associated with.
Returns Request
The converted Scrapy request.
unique_key_to_request_id
Generate request ID based on unique key in a deterministic way.
Parameters
unique_key: str
Returns str
update
Update the dataset with specified fields.
Parameters
optionalkeyword-onlyname: str | None = None
The new name for the dataset
Returns dict
dict: The updated dataset
update
Update the key-value store with specified fields.
Parameters
optionalkeyword-onlyname: str | None = None
The new name for key-value store
Returns dict
dict: The updated key-value store
update
Update the request queue with specified fields.
Parameters
optionalkeyword-onlyname: str | None = None
The new name for the request queue
Returns dict
dict: The updated request queue
update_metadata
Parameters
keyword-onlydata: dict
keyword-onlyentity_directory: str
keyword-onlywrite_metadata: bool
Returns None
update_request
Update a request in the queue.
Parameters
request: dict
The updated request
optionalkeyword-onlyforefront: bool | None = None
Whether to put the updated request in the beginning or the end of the queue
Returns dict
dict: The updated request
update_request_queue_item
Parameters
keyword-onlyrequest_id: str
keyword-onlyrequest: dict
keyword-onlyentity_directory: str
keyword-onlypersist_storage: bool
Returns None
values
Iterate over the values in the cache in order of insertion.
Returns ValuesView[T]
wait_for_all_listeners_to_complete
Wait for all event listeners which are currently being executed to complete.
Parameters
optionalkeyword-onlytimeout_secs: float | None = None
Timeout for the wait. If the event listeners don't finish until the timeout, they will be canceled.
Returns None
wrap_internal
Parameters
implementation: ImplementationType
metadata_source: MetadataType
Returns MetadataType
Properties
__version__
API_PROCESSED_REQUESTS_DELAY_MILLIS
APIFY_PROXY_VALUE_REGEX
BASE64_REGEXP
BaseResourceClientType
BaseResourceCollectionClientType
COUNTRY_CODE_REGEX
DEFAULT_API_PARAM_LIMIT
DEPRECATED_NAMES
DualPropertyOwner
DualPropertyType
EFFECTIVE_LIMIT_BYTES
ENCRYPTED_INPUT_VALUE_PREFIX
ENCRYPTED_INPUT_VALUE_REGEXP
ENCRYPTION_AUTH_TAG_LENGTH
ENCRYPTION_IV_LENGTH
ENCRYPTION_KEY_LENGTH
EVENT_LISTENERS_TIMEOUT_SECS
ImplementationType
LIST_ITEMS_LIMIT
ListenerType
ListOrDictOrAny
LOCAL_ENTRY_NAME_DIGITS
logger
logger
logger_name
MainReturnType
MAX_CACHED_REQUESTS
MAX_PAYLOAD_SIZE_BYTES
MAX_QUERIES_FOR_CONSISTENCY
MetadataType
nested_event_loop
PARSE_DATE_FIELDS_KEY_SUFFIX
PARSE_DATE_FIELDS_MAX_DEPTH
QUERY_HEAD_BUFFER
QUERY_HEAD_MIN_LENGTH
RECENTLY_HANDLED_CACHE_SIZE
REQUEST_ID_LENGTH
REQUEST_QUEUE_HEAD_MAX_LIMIT
ResourceClientType
noqa: PLC0105
SAFETY_BUFFER_PERCENT
SESSION_ID_MAX_LENGTH
STORAGE_CONSISTENCY_DELAY_MILLIS
T
T
T
Scrapy integration
apply_apify_settings
Integrates Apify configuration into a Scrapy project settings.
Note: The function directly modifies the passed
settingsobject and also returns it.Parameters
optionalkeyword-onlysettings: Settings | None = None
Scrapy project settings to be modified.
optionalkeyword-onlyproxy_config: dict | None = None
Proxy configuration to be stored in the settings.
Returns Settings
Scrapy project settings with custom configurations.
Remove an item from the cache.