Skip to main content

apify-client-python

Index

Async Resource Clients

Classes

Data structures

Errors

Methods

Properties

Async Resource Clients

retry_with_exp_backoff_async

  • async retry_with_exp_backoff_async(async_func, *, max_retries, backoff_base_millis, backoff_factor, random_factor): T
  • Parameters

    • async_func: Callable[[StopRetryingType, int], Awaitable[T]]
    • optionalkeyword-onlymax_retries: int = 8
    • optionalkeyword-onlybackoff_base_millis: int = 500
    • optionalkeyword-onlybackoff_factor: float = 2
    • optionalkeyword-onlyrandom_factor: float = 1

    Returns T

Methods

__getattr__

  • __getattr__(name): Any
  • Parameters

    • name: str

    Returns Any

catch_not_found_or_throw

  • catch_not_found_or_throw(exc): None

encode_key_value_store_record_value

  • encode_key_value_store_record_value(value, content_type): tuple[Any, str]
  • Parameters

    • value: Any
    • optionalcontent_type: str | None = None

    Returns tuple[Any, str]

encode_webhook_list_to_base64

  • encode_webhook_list_to_base64(webhooks): str
  • Encode a list of dictionaries representing webhooks to their base64-encoded representation for the API.


    Parameters

    • webhooks: list[dict]

    Returns str

get_actor_env_var_representation

  • get_actor_env_var_representation(*, is_secret, name, value): dict
  • Return an environment variable representation of the Actor in a dictionary.


    Parameters

    • optionalkeyword-onlyis_secret: bool | None = None
    • optionalkeyword-onlyname: str | None = None
    • optionalkeyword-onlyvalue: str | None = None

    Returns dict

get_actor_representation

  • get_actor_representation(*, name, title, description, seo_title, seo_description, versions, restart_on_error, is_public, is_deprecated, is_anonymously_runnable, categories, default_run_build, default_run_max_items, default_run_memory_mbytes, default_run_timeout_secs, example_run_input_body, example_run_input_content_type, actor_standby_is_enabled, actor_standby_desired_requests_per_actor_run, actor_standby_max_requests_per_actor_run, actor_standby_idle_timeout_secs, actor_standby_build, actor_standby_memory_mbytes, pricing_infos): dict
  • Get dictionary representation of the Actor.


    Parameters

    • keyword-onlyname: str | None
    • optionalkeyword-onlytitle: str | None = None
    • optionalkeyword-onlydescription: str | None = None
    • optionalkeyword-onlyseo_title: str | None = None
    • optionalkeyword-onlyseo_description: str | None = None
    • optionalkeyword-onlyversions: list[dict] | None = None
    • optionalkeyword-onlyrestart_on_error: bool | None = None
    • optionalkeyword-onlyis_public: bool | None = None
    • optionalkeyword-onlyis_deprecated: bool | None = None
    • optionalkeyword-onlyis_anonymously_runnable: bool | None = None
    • optionalkeyword-onlycategories: list[str] | None = None
    • optionalkeyword-onlydefault_run_build: str | None = None
    • optionalkeyword-onlydefault_run_max_items: int | None = None
    • optionalkeyword-onlydefault_run_memory_mbytes: int | None = None
    • optionalkeyword-onlydefault_run_timeout_secs: int | None = None
    • optionalkeyword-onlyexample_run_input_body: Any = None
    • optionalkeyword-onlyexample_run_input_content_type: str | None = None
    • optionalkeyword-onlyactor_standby_is_enabled: bool | None = None
    • optionalkeyword-onlyactor_standby_desired_requests_per_actor_run: int | None = None
    • optionalkeyword-onlyactor_standby_max_requests_per_actor_run: int | None = None
    • optionalkeyword-onlyactor_standby_idle_timeout_secs: int | None = None
    • optionalkeyword-onlyactor_standby_build: str | None = None
    • optionalkeyword-onlyactor_standby_memory_mbytes: int | None = None
    • optionalkeyword-onlypricing_infos: list[dict] | None = None

    Returns dict

get_task_representation

  • get_task_representation(actor_id, name, task_input, build, max_items, memory_mbytes, timeout_secs, title, actor_standby_desired_requests_per_actor_run, actor_standby_max_requests_per_actor_run, actor_standby_idle_timeout_secs, actor_standby_build, actor_standby_memory_mbytes): dict
  • Get the dictionary representation of a task.


    Parameters

    • optionalactor_id: str | None = None
    • optionalname: str | None = None
    • optionaltask_input: dict | None = None
    • optionalbuild: str | None = None
    • optionalmax_items: int | None = None
    • optionalmemory_mbytes: int | None = None
    • optionaltimeout_secs: int | None = None
    • optionaltitle: str | None = None
    • optionalactor_standby_desired_requests_per_actor_run: int | None = None
    • optionalactor_standby_max_requests_per_actor_run: int | None = None
    • optionalactor_standby_idle_timeout_secs: int | None = None
    • optionalactor_standby_build: str | None = None
    • optionalactor_standby_memory_mbytes: int | None = None

    Returns dict

get_webhook_representation

  • get_webhook_representation(*, event_types, request_url, payload_template, headers_template, actor_id, actor_task_id, actor_run_id, ignore_ssl_errors, do_not_retry, idempotency_key, is_ad_hoc): dict
  • Prepare webhook dictionary representation for clients.


    Parameters

    • optionalkeyword-onlyevent_types: list[WebhookEventType] | None = None
    • optionalkeyword-onlyrequest_url: str | None = None
    • optionalkeyword-onlypayload_template: str | None = None
    • optionalkeyword-onlyheaders_template: str | None = None
    • optionalkeyword-onlyactor_id: str | None = None
    • optionalkeyword-onlyactor_task_id: str | None = None
    • optionalkeyword-onlyactor_run_id: str | None = None
    • optionalkeyword-onlyignore_ssl_errors: bool | None = None
    • optionalkeyword-onlydo_not_retry: bool | None = None
    • optionalkeyword-onlyidempotency_key: str | None = None
    • optionalkeyword-onlyis_ad_hoc: bool | None = None

    Returns dict

is_retryable_error

  • is_retryable_error(exc): bool
  • Check if the given error is retryable.


    Parameters

    • exc: Exception

    Returns bool

pluck_data

  • pluck_data(parsed_response): dict
  • Parameters

    • parsed_response: Any

    Returns dict

pluck_data_as_list

  • pluck_data_as_list(parsed_response): list
  • Parameters

    • parsed_response: Any

    Returns list

retry_with_exp_backoff

  • retry_with_exp_backoff(func, *, max_retries, backoff_base_millis, backoff_factor, random_factor): T
  • Parameters

    • func: Callable[[StopRetryingType, int], T]
    • optionalkeyword-onlymax_retries: int = 8
    • optionalkeyword-onlybackoff_base_millis: int = 500
    • optionalkeyword-onlybackoff_factor: float = 2
    • optionalkeyword-onlyrandom_factor: float = 1

    Returns T

to_safe_id

  • to_safe_id(id): str
  • Parameters

    • id: str

    Returns str

Properties

__version__

__version__: Undefined

API_VERSION

API_VERSION: Undefined

DEFAULT_API_URL

DEFAULT_API_URL: Undefined

DEFAULT_BACKOFF_EXPONENTIAL_FACTOR

DEFAULT_BACKOFF_EXPONENTIAL_FACTOR: Undefined

DEFAULT_BACKOFF_RANDOM_FACTOR

DEFAULT_BACKOFF_RANDOM_FACTOR: Undefined

DEFAULT_WAIT_FOR_FINISH_SEC

DEFAULT_WAIT_FOR_FINISH_SEC: Undefined

DEFAULT_WAIT_WHEN_JOB_NOT_EXIST_SEC

DEFAULT_WAIT_WHEN_JOB_NOT_EXIST_SEC: Undefined

DEPRECATED_NAMES

DEPRECATED_NAMES: Undefined

http_client

http_client: HTTPClient

http_client

http_client: HTTPClientAsync

log_context

log_context: Undefined

logger

logger: Undefined

logger

logger: Undefined

logger

logger: Undefined

logger_name

logger_name: Undefined

PARSE_DATE_FIELDS_KEY_SUFFIX

PARSE_DATE_FIELDS_KEY_SUFFIX: Undefined

PARSE_DATE_FIELDS_MAX_DEPTH

PARSE_DATE_FIELDS_MAX_DEPTH: Undefined

RECORD_NOT_FOUND_EXCEPTION_TYPES

RECORD_NOT_FOUND_EXCEPTION_TYPES: Undefined

root_client

root_client: ApifyClient

root_client

root_client: ApifyClientAsync

StopRetryingType

StopRetryingType: Undefined

T

T: Undefined