diff --git a/CHANGELOG.md b/CHANGELOG.md index 34d4933a..d00c255c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -152,14 +152,14 @@ - added configurable socket timeout for requests to the Apify API - added `py.typed` file to signal type checkers that this package is typed - added method to update status message for a run -- added option to set up webhooks for actor builds +- added option to set up webhooks for Actor builds - added logger with basic debugging info - added support for `schema` parameter in `get_or_create` method for datasets and key-value stores - added support for `title` parameter in task and schedule methods - added `x-apify-workflow-key` header support - added support for `flatten` and `view` parameters in dataset items methods -- added support for `origin` parameter in actor/task run methods -- added clients for actor version environment variables +- added support for `origin` parameter in Actor/task run methods +- added clients for Actor version environment variables ### Fixed @@ -186,7 +186,7 @@ ### Removed -- Dropped support for single-file actors +- Dropped support for single-file Actors ### Internal changes @@ -248,11 +248,11 @@ ### Changed - replaced `base_url` with `api_url` in the client constructor - to enable easier passing of the API server url from environment variables available to actors on the Apify platform + to enable easier passing of the API server url from environment variables available to Actors on the Apify platform ### Internal changes -- changed tags for actor images with this client on Docker Hub to be aligned with the Apify SDK Node.js images +- changed tags for Actor images with this client on Docker Hub to be aligned with the Apify SDK Node.js images - updated the `requests` dependency to 2.26.0 - updated development dependencies @@ -267,7 +267,7 @@ - updated development dependencies - enforced unified use of single quotes and double quotes -- added repository dispatch to build actor images with this client when publishing a new version +- added repository dispatch to build Actor images with this client when publishing a new version ## [0.0.1](../../releases/tag/v0.0.1) - 2021-05-13 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f9d871fc..35cdea04 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,7 +50,7 @@ tests with HTML coverage report execute `make unit-tests-cov`. ## Integration tests -We have integration tests which build and run actors using the Python SDK on the Apify Platform. To run these tests, +We have integration tests which build and run Actors using the Python SDK on the Apify Platform. To run these tests, you need to set the `APIFY_TEST_USER_API_TOKEN` environment variable to the API token of the Apify user you want to use for the tests, and then start them with `make integration-tests`. diff --git a/README.md b/README.md index 70059e1a..d16e4ba3 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,10 @@ from apify_client import ApifyClient apify_client = ApifyClient('MY-APIFY-TOKEN') -# Start an actor and wait for it to finish +# Start an Actor and wait for it to finish actor_call = apify_client.actor('john-doe/my-cool-actor').call() -# Fetch results from the actor's default dataset +# Fetch results from the Actor's default dataset dataset_items = apify_client.dataset(actor_call['defaultDatasetId']).list_items().items ``` @@ -57,7 +57,7 @@ which allows you to work with the Apify API in an asynchronous way, using the st ### Convenience functions and options -Some actions can't be performed by the API itself, such as indefinite waiting for an actor run to finish +Some actions can't be performed by the API itself, such as indefinite waiting for an Actor run to finish (because of network timeouts). The client provides convenient `call()` and `wait_for_finish()` functions that do that. Key-value store records can be retrieved as objects, buffers or streams via the respective options, dataset items can be fetched as individual objects or serialized data and we plan to add better stream support and async iterators. diff --git a/docs/index.md b/docs/index.md index 4d336780..c8d1d3f0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -120,10 +120,10 @@ apify_client = ApifyClient('MY-APIFY-TOKEN') # Collection clients do not require a parameter actor_collection_client = apify_client.actors() -# Create an actor with the name: my-actor +# Create an Actor with the name: my-actor my_actor = actor_collection_client.create(name='my-actor') -# List all of your actors +# List all of your Actors actor_list = actor_collection_client.list().items ``` @@ -220,7 +220,7 @@ The package offers an asynchronous version of the client, [`ApifyClientAsync`](/reference/class/ApifyClientAsync), which allows you to work with the Apify API in an asynchronous way, using the standard `async`/`await` syntax [offered by Python](https://docs.python.org/3/library/asyncio-task.html). -For example, to run an actor and asynchronously stream its log while it's running, you can use this snippet: +For example, to run an Actor and asynchronously stream its log while it's running, you can use this snippet: ```python from apify_client import ApifyClientAsync @@ -258,7 +258,7 @@ please refer to the official Python [documentation on logging](https://docs.pyth ### Convenience functions and options -Some actions can't be performed by the API itself, such as indefinite waiting for an actor run to finish (because of network timeouts). +Some actions can't be performed by the API itself, such as indefinite waiting for an Actor run to finish (because of network timeouts). The client provides convenient [`call()`](/reference/class/ActorClient#call) and [`wait_for_finish()`](/reference/class/ActorClient#wait_for_finish) methods that do that. @@ -335,7 +335,7 @@ Instead of the parsed resource, they return a raw, context-managed which has to be consumed using the `with` keyword, and automatically gets closed once you exit the `with` block, preventing memory leaks and unclosed connections. -For example, to consume an actor run log in a streaming fashion, you can use this snippet: +For example, to consume an Actor run log in a streaming fashion, you can use this snippet: ```python with apify_client.run('MY-RUN-ID').log().stream() as log_stream: diff --git a/src/apify_client/client.py b/src/apify_client/client.py index 2a126145..9d25ee73 100644 --- a/src/apify_client/client.py +++ b/src/apify_client/client.py @@ -134,22 +134,22 @@ def __init__( ) def actor(self: ApifyClient, actor_id: str) -> ActorClient: - """Retrieve the sub-client for manipulating a single actor. + """Retrieve the sub-client for manipulating a single Actor. Args: - actor_id (str): ID of the actor to be manipulated + actor_id (str): ID of the Actor to be manipulated """ return ActorClient(resource_id=actor_id, **self._options()) def actors(self: ApifyClient) -> ActorCollectionClient: - """Retrieve the sub-client for manipulating actors.""" + """Retrieve the sub-client for manipulating Actors.""" return ActorCollectionClient(**self._options()) def build(self: ApifyClient, build_id: str) -> BuildClient: - """Retrieve the sub-client for manipulating a single actor build. + """Retrieve the sub-client for manipulating a single Actor build. Args: - build_id (str): ID of the actor build to be manipulated + build_id (str): ID of the Actor build to be manipulated """ return BuildClient(resource_id=build_id, **self._options()) @@ -158,15 +158,15 @@ def builds(self: ApifyClient) -> BuildCollectionClient: return BuildCollectionClient(**self._options()) def run(self: ApifyClient, run_id: str) -> RunClient: - """Retrieve the sub-client for manipulating a single actor run. + """Retrieve the sub-client for manipulating a single Actor run. Args: - run_id (str): ID of the actor run to be manipulated + run_id (str): ID of the Actor run to be manipulated """ return RunClient(resource_id=run_id, **self._options()) def runs(self: ApifyClient) -> RunCollectionClient: - """Retrieve the sub-client for querying multiple actor runs of a user.""" + """Retrieve the sub-client for querying multiple Actor runs of a user.""" return RunCollectionClient(**self._options()) def dataset(self: ApifyClient, dataset_id: str) -> DatasetClient: @@ -246,7 +246,7 @@ def log(self: ApifyClient, build_or_run_id: str) -> LogClient: """Retrieve the sub-client for retrieving logs. Args: - build_or_run_id (str): ID of the actor build or run for which to access the log + build_or_run_id (str): ID of the Actor build or run for which to access the log """ return LogClient(resource_id=build_or_run_id, **self._options()) @@ -315,22 +315,22 @@ def __init__( ) def actor(self: ApifyClientAsync, actor_id: str) -> ActorClientAsync: - """Retrieve the sub-client for manipulating a single actor. + """Retrieve the sub-client for manipulating a single Actor. Args: - actor_id (str): ID of the actor to be manipulated + actor_id (str): ID of the Actor to be manipulated """ return ActorClientAsync(resource_id=actor_id, **self._options()) def actors(self: ApifyClientAsync) -> ActorCollectionClientAsync: - """Retrieve the sub-client for manipulating actors.""" + """Retrieve the sub-client for manipulating Actors.""" return ActorCollectionClientAsync(**self._options()) def build(self: ApifyClientAsync, build_id: str) -> BuildClientAsync: - """Retrieve the sub-client for manipulating a single actor build. + """Retrieve the sub-client for manipulating a single Actor build. Args: - build_id (str): ID of the actor build to be manipulated + build_id (str): ID of the Actor build to be manipulated """ return BuildClientAsync(resource_id=build_id, **self._options()) @@ -339,15 +339,15 @@ def builds(self: ApifyClientAsync) -> BuildCollectionClientAsync: return BuildCollectionClientAsync(**self._options()) def run(self: ApifyClientAsync, run_id: str) -> RunClientAsync: - """Retrieve the sub-client for manipulating a single actor run. + """Retrieve the sub-client for manipulating a single Actor run. Args: - run_id (str): ID of the actor run to be manipulated + run_id (str): ID of the Actor run to be manipulated """ return RunClientAsync(resource_id=run_id, **self._options()) def runs(self: ApifyClientAsync) -> RunCollectionClientAsync: - """Retrieve the sub-client for querying multiple actor runs of a user.""" + """Retrieve the sub-client for querying multiple Actor runs of a user.""" return RunCollectionClientAsync(**self._options()) def dataset(self: ApifyClientAsync, dataset_id: str) -> DatasetClientAsync: @@ -427,7 +427,7 @@ def log(self: ApifyClientAsync, build_or_run_id: str) -> LogClientAsync: """Retrieve the sub-client for retrieving logs. Args: - build_or_run_id (str): ID of the actor build or run for which to access the log + build_or_run_id (str): ID of the Actor build or run for which to access the log """ return LogClientAsync(resource_id=build_or_run_id, **self._options()) diff --git a/src/apify_client/clients/base/actor_job_base_client.py b/src/apify_client/clients/base/actor_job_base_client.py index dd8cfd5a..55fd1f12 100644 --- a/src/apify_client/clients/base/actor_job_base_client.py +++ b/src/apify_client/clients/base/actor_job_base_client.py @@ -20,7 +20,7 @@ @ignore_docs class ActorJobBaseClient(ResourceClient): - """Base sub-client class for actor runs and actor builds.""" + """Base sub-client class for Actor runs and Actor builds.""" def _wait_for_finish(self: ActorJobBaseClient, wait_secs: int | None = None) -> dict | None: started_at = datetime.now(timezone.utc) @@ -73,7 +73,7 @@ def _abort(self: ActorJobBaseClient, gracefully: bool | None = None) -> dict: @ignore_docs class ActorJobBaseClientAsync(ResourceClientAsync): - """Base async sub-client class for actor runs and actor builds.""" + """Base async sub-client class for Actor runs and Actor builds.""" async def _wait_for_finish(self: ActorJobBaseClientAsync, wait_secs: int | None = None) -> dict | None: started_at = datetime.now(timezone.utc) diff --git a/src/apify_client/clients/resource_clients/actor.py b/src/apify_client/clients/resource_clients/actor.py index 3cc3fb6c..e65659eb 100644 --- a/src/apify_client/clients/resource_clients/actor.py +++ b/src/apify_client/clients/resource_clients/actor.py @@ -83,7 +83,7 @@ def get_actor_representation( class ActorClient(ResourceClient): - """Sub-client for manipulating a single actor.""" + """Sub-client for manipulating a single Actor.""" @ignore_docs def __init__(self: ActorClient, *args: Any, **kwargs: Any) -> None: @@ -92,12 +92,12 @@ def __init__(self: ActorClient, *args: Any, **kwargs: Any) -> None: super().__init__(*args, resource_path=resource_path, **kwargs) def get(self: ActorClient) -> dict | None: - """Retrieve the actor. + """Retrieve the Actor. https://docs.apify.com/api/v2#/reference/actors/actor-object/get-actor Returns: - dict, optional: The retrieved actor + dict, optional: The retrieved Actor """ return self._get() @@ -128,28 +128,28 @@ def update( actor_standby_build: str | None = None, actor_standby_memory_mbytes: int | None = None, ) -> dict: - """Update the actor with the specified fields. + """Update the Actor with the specified fields. https://docs.apify.com/api/v2#/reference/actors/actor-object/update-actor Args: - name (str, optional): The name of the actor - title (str, optional): The title of the actor (human-readable) - description (str, optional): The description for the actor - seo_title (str, optional): The title of the actor optimized for search engines - seo_description (str, optional): The description of the actor optimized for search engines - versions (list of dict, optional): The list of actor versions - restart_on_error (bool, optional): If true, the main actor run process will be restarted whenever it exits with a non-zero status code. - is_public (bool, optional): Whether the actor is public. - is_deprecated (bool, optional): Whether the actor is deprecated. - is_anonymously_runnable (bool, optional): Whether the actor is anonymously runnable. - categories (list of str, optional): The categories to which the actor belongs to. + name (str, optional): The name of the Actor + title (str, optional): The title of the Actor (human-readable) + description (str, optional): The description for the Actor + seo_title (str, optional): The title of the Actor optimized for search engines + seo_description (str, optional): The description of the Actor optimized for search engines + versions (list of dict, optional): The list of Actor versions + restart_on_error (bool, optional): If true, the main Actor run process will be restarted whenever it exits with a non-zero status code. + is_public (bool, optional): Whether the Actor is public. + is_deprecated (bool, optional): Whether the Actor is deprecated. + is_anonymously_runnable (bool, optional): Whether the Actor is anonymously runnable. + categories (list of str, optional): The categories to which the Actor belongs to. default_run_build (str, optional): Tag or number of the build that you want to run by default. default_run_max_items (int, optional): Default limit of the number of results that will be returned by runs of this Actor, if the Actor is charged per result. - default_run_memory_mbytes (int, optional): Default amount of memory allocated for the runs of this actor, in megabytes. - default_run_timeout_secs (int, optional): Default timeout for the runs of this actor in seconds. - example_run_input_body (Any, optional): Input to be prefilled as default input to new users of this actor. + default_run_memory_mbytes (int, optional): Default amount of memory allocated for the runs of this Actor, in megabytes. + default_run_timeout_secs (int, optional): Default timeout for the runs of this Actor in seconds. + example_run_input_body (Any, optional): Input to be prefilled as default input to new users of this Actor. example_run_input_content_type (str, optional): The content type of the example run input. actor_standby_is_enabled (bool, optional): Whether the Actor Standby is enabled. actor_standby_desired_requests_per_actor_run (int, optional): The desired number of concurrent HTTP requests for @@ -160,7 +160,7 @@ def update( actor_standby_memory_mbytes (int, optional): The memory in megabytes to use when the Actor is in Standby mode. Returns: - dict: The updated actor + dict: The updated Actor """ actor_representation = get_actor_representation( name=name, @@ -191,7 +191,7 @@ def update( return self._update(filter_out_none_values_recursively(actor_representation)) def delete(self: ActorClient) -> None: - """Delete the actor. + """Delete the Actor. https://docs.apify.com/api/v2#/reference/actors/actor-object/delete-actor """ @@ -209,27 +209,27 @@ def start( wait_for_finish: int | None = None, webhooks: list[dict] | None = None, ) -> dict: - """Start the actor and immediately return the Run object. + """Start the Actor and immediately return the Run object. https://docs.apify.com/api/v2#/reference/actors/run-collection/run-actor Args: - run_input (Any, optional): The input to pass to the actor run. + run_input (Any, optional): The input to pass to the Actor run. content_type (str, optional): The content type of the input. - build (str, optional): Specifies the actor build to run. It can be either a build tag or build number. - By default, the run uses the build specified in the default run configuration for the actor (typically latest). + build (str, optional): Specifies the Actor build to run. It can be either a build tag or build number. + By default, the run uses the build specified in the default run configuration for the Actor (typically latest). max_items (int, optional): Maximum number of results that will be returned by this run. If the Actor is charged per result, you will not be charged for more results than the given limit. memory_mbytes (int, optional): Memory limit for the run, in megabytes. - By default, the run uses a memory limit specified in the default run configuration for the actor. + By default, the run uses a memory limit specified in the default run configuration for the Actor. timeout_secs (int, optional): Optional timeout for the run, in seconds. - By default, the run uses timeout specified in the default run configuration for the actor. + By default, the run uses timeout specified in the default run configuration for the Actor. wait_for_finish (int, optional): The maximum number of seconds the server waits for the run to finish. By default, it is 0, the maximum value is 60. webhooks (list of dict, optional): Optional ad-hoc webhooks (https://docs.apify.com/webhooks/ad-hoc-webhooks) - associated with the actor run which can be used to receive a notification, - e.g. when the actor finished or failed. - If you already have a webhook set up for the actor or task, you do not have to add it again here. + associated with the Actor run which can be used to receive a notification, + e.g. when the Actor finished or failed. + If you already have a webhook set up for the Actor or task, you do not have to add it again here. Each webhook is represented by a dictionary containing these items: * ``event_types``: list of ``WebhookEventType`` values which trigger the webhook * ``request_url``: URL to which to send the webhook HTTP request @@ -271,26 +271,26 @@ def call( webhooks: list[dict] | None = None, wait_secs: int | None = None, ) -> dict | None: - """Start the actor and wait for it to finish before returning the Run object. + """Start the Actor and wait for it to finish before returning the Run object. It waits indefinitely, unless the wait_secs argument is provided. https://docs.apify.com/api/v2#/reference/actors/run-collection/run-actor Args: - run_input (Any, optional): The input to pass to the actor run. + run_input (Any, optional): The input to pass to the Actor run. content_type (str, optional): The content type of the input. - build (str, optional): Specifies the actor build to run. It can be either a build tag or build number. - By default, the run uses the build specified in the default run configuration for the actor (typically latest). + build (str, optional): Specifies the Actor build to run. It can be either a build tag or build number. + By default, the run uses the build specified in the default run configuration for the Actor (typically latest). max_items (int, optional): Maximum number of results that will be returned by this run. If the Actor is charged per result, you will not be charged for more results than the given limit. memory_mbytes (int, optional): Memory limit for the run, in megabytes. - By default, the run uses a memory limit specified in the default run configuration for the actor. + By default, the run uses a memory limit specified in the default run configuration for the Actor. timeout_secs (int, optional): Optional timeout for the run, in seconds. - By default, the run uses timeout specified in the default run configuration for the actor. - webhooks (list, optional): Optional webhooks (https://docs.apify.com/webhooks) associated with the actor run, - which can be used to receive a notification, e.g. when the actor finished or failed. - If you already have a webhook set up for the actor, you do not have to add it again here. + By default, the run uses timeout specified in the default run configuration for the Actor. + webhooks (list, optional): Optional webhooks (https://docs.apify.com/webhooks) associated with the Actor run, + which can be used to receive a notification, e.g. when the Actor finished or failed. + If you already have a webhook set up for the Actor, you do not have to add it again here. wait_secs (int, optional): The maximum number of seconds the server waits for the run to finish. If not provided, waits indefinitely. Returns: @@ -317,16 +317,16 @@ def build( use_cache: bool | None = None, wait_for_finish: int | None = None, ) -> dict: - """Build the actor. + """Build the Actor. https://docs.apify.com/api/v2#/reference/actors/build-collection/build-actor Args: version_number (str): Actor version number to be built. - beta_packages (bool, optional): If True, then the actor is built with beta versions of Apify NPM packages. + beta_packages (bool, optional): If True, then the Actor is built with beta versions of Apify NPM packages. By default, the build uses latest stable packages. - tag (str, optional): Tag to be applied to the build on success. By default, the tag is taken from the actor version's buildTag property. - use_cache (bool, optional): If true, the actor's Docker container will be rebuilt using layer cache + tag (str, optional): Tag to be applied to the build on success. By default, the tag is taken from the Actor version's buildTag property. + use_cache (bool, optional): If true, the Actor's Docker container will be rebuilt using layer cache (https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache). This is to enable quick rebuild during development. By default, the cache is not used. @@ -353,11 +353,11 @@ def build( return parse_date_fields(pluck_data(response.json())) def builds(self: ActorClient) -> BuildCollectionClient: - """Retrieve a client for the builds of this actor.""" + """Retrieve a client for the builds of this Actor.""" return BuildCollectionClient(**self._sub_resource_init_options(resource_path='builds')) def runs(self: ActorClient) -> RunCollectionClient: - """Retrieve a client for the runs of this actor.""" + """Retrieve a client for the runs of this Actor.""" return RunCollectionClient(**self._sub_resource_init_options(resource_path='runs')) def last_run( @@ -366,7 +366,7 @@ def last_run( status: ActorJobStatus | None = None, origin: MetaOrigin | None = None, ) -> RunClient: - """Retrieve the client for the last run of this actor. + """Retrieve the client for the last run of this Actor. Last run is retrieved based on the start time of the runs. @@ -375,7 +375,7 @@ def last_run( origin (MetaOrigin, optional): Consider only runs started with this origin. Returns: - RunClient: The resource client for the last run of this actor. + RunClient: The resource client for the last run of this Actor. """ return RunClient( **self._sub_resource_init_options( @@ -389,27 +389,27 @@ def last_run( ) def versions(self: ActorClient) -> ActorVersionCollectionClient: - """Retrieve a client for the versions of this actor.""" + """Retrieve a client for the versions of this Actor.""" return ActorVersionCollectionClient(**self._sub_resource_init_options()) def version(self: ActorClient, version_number: str) -> ActorVersionClient: - """Retrieve the client for the specified version of this actor. + """Retrieve the client for the specified version of this Actor. Args: version_number (str): The version number for which to retrieve the resource client. Returns: - ActorVersionClient: The resource client for the specified actor version. + ActorVersionClient: The resource client for the specified Actor version. """ return ActorVersionClient(**self._sub_resource_init_options(resource_id=version_number)) def webhooks(self: ActorClient) -> WebhookCollectionClient: - """Retrieve a client for webhooks associated with this actor.""" + """Retrieve a client for webhooks associated with this Actor.""" return WebhookCollectionClient(**self._sub_resource_init_options()) class ActorClientAsync(ResourceClientAsync): - """Async sub-client for manipulating a single actor.""" + """Async sub-client for manipulating a single Actor.""" @ignore_docs def __init__(self: ActorClientAsync, *args: Any, **kwargs: Any) -> None: @@ -418,12 +418,12 @@ def __init__(self: ActorClientAsync, *args: Any, **kwargs: Any) -> None: super().__init__(*args, resource_path=resource_path, **kwargs) async def get(self: ActorClientAsync) -> dict | None: - """Retrieve the actor. + """Retrieve the Actor. https://docs.apify.com/api/v2#/reference/actors/actor-object/get-actor Returns: - dict, optional: The retrieved actor + dict, optional: The retrieved Actor """ return await self._get() @@ -454,28 +454,28 @@ async def update( actor_standby_build: str | None = None, actor_standby_memory_mbytes: int | None = None, ) -> dict: - """Update the actor with the specified fields. + """Update the Actor with the specified fields. https://docs.apify.com/api/v2#/reference/actors/actor-object/update-actor Args: - name (str, optional): The name of the actor - title (str, optional): The title of the actor (human-readable) - description (str, optional): The description for the actor - seo_title (str, optional): The title of the actor optimized for search engines - seo_description (str, optional): The description of the actor optimized for search engines - versions (list of dict, optional): The list of actor versions - restart_on_error (bool, optional): If true, the main actor run process will be restarted whenever it exits with a non-zero status code. - is_public (bool, optional): Whether the actor is public. - is_deprecated (bool, optional): Whether the actor is deprecated. - is_anonymously_runnable (bool, optional): Whether the actor is anonymously runnable. - categories (list of str, optional): The categories to which the actor belongs to. + name (str, optional): The name of the Actor + title (str, optional): The title of the Actor (human-readable) + description (str, optional): The description for the Actor + seo_title (str, optional): The title of the Actor optimized for search engines + seo_description (str, optional): The description of the Actor optimized for search engines + versions (list of dict, optional): The list of Actor versions + restart_on_error (bool, optional): If true, the main Actor run process will be restarted whenever it exits with a non-zero status code. + is_public (bool, optional): Whether the Actor is public. + is_deprecated (bool, optional): Whether the Actor is deprecated. + is_anonymously_runnable (bool, optional): Whether the Actor is anonymously runnable. + categories (list of str, optional): The categories to which the Actor belongs to. default_run_build (str, optional): Tag or number of the build that you want to run by default. default_run_max_items (int, optional): Default limit of the number of results that will be returned by runs of this Actor, if the Actor is charged per result. - default_run_memory_mbytes (int, optional): Default amount of memory allocated for the runs of this actor, in megabytes. - default_run_timeout_secs (int, optional): Default timeout for the runs of this actor in seconds. - example_run_input_body (Any, optional): Input to be prefilled as default input to new users of this actor. + default_run_memory_mbytes (int, optional): Default amount of memory allocated for the runs of this Actor, in megabytes. + default_run_timeout_secs (int, optional): Default timeout for the runs of this Actor in seconds. + example_run_input_body (Any, optional): Input to be prefilled as default input to new users of this Actor. example_run_input_content_type (str, optional): The content type of the example run input. actor_standby_is_enabled (bool, optional): Whether the Actor Standby is enabled. actor_standby_desired_requests_per_actor_run (int, optional): The desired number of concurrent HTTP requests for @@ -486,7 +486,7 @@ async def update( actor_standby_memory_mbytes (int, optional): The memory in megabytes to use when the Actor is in Standby mode. Returns: - dict: The updated actor + dict: The updated Actor """ actor_representation = get_actor_representation( name=name, @@ -517,7 +517,7 @@ async def update( return await self._update(filter_out_none_values_recursively(actor_representation)) async def delete(self: ActorClientAsync) -> None: - """Delete the actor. + """Delete the Actor. https://docs.apify.com/api/v2#/reference/actors/actor-object/delete-actor """ @@ -535,27 +535,27 @@ async def start( wait_for_finish: int | None = None, webhooks: list[dict] | None = None, ) -> dict: - """Start the actor and immediately return the Run object. + """Start the Actor and immediately return the Run object. https://docs.apify.com/api/v2#/reference/actors/run-collection/run-actor Args: - run_input (Any, optional): The input to pass to the actor run. + run_input (Any, optional): The input to pass to the Actor run. content_type (str, optional): The content type of the input. - build (str, optional): Specifies the actor build to run. It can be either a build tag or build number. - By default, the run uses the build specified in the default run configuration for the actor (typically latest). + build (str, optional): Specifies the Actor build to run. It can be either a build tag or build number. + By default, the run uses the build specified in the default run configuration for the Actor (typically latest). max_items (int, optional): Maximum number of results that will be returned by this run. If the Actor is charged per result, you will not be charged for more results than the given limit. memory_mbytes (int, optional): Memory limit for the run, in megabytes. - By default, the run uses a memory limit specified in the default run configuration for the actor. + By default, the run uses a memory limit specified in the default run configuration for the Actor. timeout_secs (int, optional): Optional timeout for the run, in seconds. - By default, the run uses timeout specified in the default run configuration for the actor. + By default, the run uses timeout specified in the default run configuration for the Actor. wait_for_finish (int, optional): The maximum number of seconds the server waits for the run to finish. By default, it is 0, the maximum value is 60. webhooks (list of dict, optional): Optional ad-hoc webhooks (https://docs.apify.com/webhooks/ad-hoc-webhooks) - associated with the actor run which can be used to receive a notification, - e.g. when the actor finished or failed. - If you already have a webhook set up for the actor or task, you do not have to add it again here. + associated with the Actor run which can be used to receive a notification, + e.g. when the Actor finished or failed. + If you already have a webhook set up for the Actor or task, you do not have to add it again here. Each webhook is represented by a dictionary containing these items: * ``event_types``: list of ``WebhookEventType`` values which trigger the webhook * ``request_url``: URL to which to send the webhook HTTP request @@ -597,26 +597,26 @@ async def call( webhooks: list[dict] | None = None, wait_secs: int | None = None, ) -> dict | None: - """Start the actor and wait for it to finish before returning the Run object. + """Start the Actor and wait for it to finish before returning the Run object. It waits indefinitely, unless the wait_secs argument is provided. https://docs.apify.com/api/v2#/reference/actors/run-collection/run-actor Args: - run_input (Any, optional): The input to pass to the actor run. + run_input (Any, optional): The input to pass to the Actor run. content_type (str, optional): The content type of the input. - build (str, optional): Specifies the actor build to run. It can be either a build tag or build number. - By default, the run uses the build specified in the default run configuration for the actor (typically latest). + build (str, optional): Specifies the Actor build to run. It can be either a build tag or build number. + By default, the run uses the build specified in the default run configuration for the Actor (typically latest). max_items (int, optional): Maximum number of results that will be returned by this run. If the Actor is charged per result, you will not be charged for more results than the given limit. memory_mbytes (int, optional): Memory limit for the run, in megabytes. - By default, the run uses a memory limit specified in the default run configuration for the actor. + By default, the run uses a memory limit specified in the default run configuration for the Actor. timeout_secs (int, optional): Optional timeout for the run, in seconds. - By default, the run uses timeout specified in the default run configuration for the actor. - webhooks (list, optional): Optional webhooks (https://docs.apify.com/webhooks) associated with the actor run, - which can be used to receive a notification, e.g. when the actor finished or failed. - If you already have a webhook set up for the actor, you do not have to add it again here. + By default, the run uses timeout specified in the default run configuration for the Actor. + webhooks (list, optional): Optional webhooks (https://docs.apify.com/webhooks) associated with the Actor run, + which can be used to receive a notification, e.g. when the Actor finished or failed. + If you already have a webhook set up for the Actor, you do not have to add it again here. wait_secs (int, optional): The maximum number of seconds the server waits for the run to finish. If not provided, waits indefinitely. Returns: @@ -643,16 +643,16 @@ async def build( use_cache: bool | None = None, wait_for_finish: int | None = None, ) -> dict: - """Build the actor. + """Build the Actor. https://docs.apify.com/api/v2#/reference/actors/build-collection/build-actor Args: version_number (str): Actor version number to be built. - beta_packages (bool, optional): If True, then the actor is built with beta versions of Apify NPM packages. + beta_packages (bool, optional): If True, then the Actor is built with beta versions of Apify NPM packages. By default, the build uses latest stable packages. - tag (str, optional): Tag to be applied to the build on success. By default, the tag is taken from the actor version's buildTag property. - use_cache (bool, optional): If true, the actor's Docker container will be rebuilt using layer cache + tag (str, optional): Tag to be applied to the build on success. By default, the tag is taken from the Actor version's buildTag property. + use_cache (bool, optional): If true, the Actor's Docker container will be rebuilt using layer cache (https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache). This is to enable quick rebuild during development. By default, the cache is not used. @@ -679,15 +679,15 @@ async def build( return parse_date_fields(pluck_data(response.json())) def builds(self: ActorClientAsync) -> BuildCollectionClientAsync: - """Retrieve a client for the builds of this actor.""" + """Retrieve a client for the builds of this Actor.""" return BuildCollectionClientAsync(**self._sub_resource_init_options(resource_path='builds')) def runs(self: ActorClientAsync) -> RunCollectionClientAsync: - """Retrieve a client for the runs of this actor.""" + """Retrieve a client for the runs of this Actor.""" return RunCollectionClientAsync(**self._sub_resource_init_options(resource_path='runs')) def last_run(self: ActorClientAsync, *, status: ActorJobStatus | None = None, origin: MetaOrigin | None = None) -> RunClientAsync: - """Retrieve the client for the last run of this actor. + """Retrieve the client for the last run of this Actor. Last run is retrieved based on the start time of the runs. @@ -696,7 +696,7 @@ def last_run(self: ActorClientAsync, *, status: ActorJobStatus | None = None, or origin (MetaOrigin, optional): Consider only runs started with this origin. Returns: - RunClientAsync: The resource client for the last run of this actor. + RunClientAsync: The resource client for the last run of this Actor. """ return RunClientAsync( **self._sub_resource_init_options( @@ -710,20 +710,20 @@ def last_run(self: ActorClientAsync, *, status: ActorJobStatus | None = None, or ) def versions(self: ActorClientAsync) -> ActorVersionCollectionClientAsync: - """Retrieve a client for the versions of this actor.""" + """Retrieve a client for the versions of this Actor.""" return ActorVersionCollectionClientAsync(**self._sub_resource_init_options()) def version(self: ActorClientAsync, version_number: str) -> ActorVersionClientAsync: - """Retrieve the client for the specified version of this actor. + """Retrieve the client for the specified version of this Actor. Args: version_number (str): The version number for which to retrieve the resource client. Returns: - ActorVersionClientAsync: The resource client for the specified actor version. + ActorVersionClientAsync: The resource client for the specified Actor version. """ return ActorVersionClientAsync(**self._sub_resource_init_options(resource_id=version_number)) def webhooks(self: ActorClientAsync) -> WebhookCollectionClientAsync: - """Retrieve a client for webhooks associated with this actor.""" + """Retrieve a client for webhooks associated with this Actor.""" return WebhookCollectionClientAsync(**self._sub_resource_init_options()) diff --git a/src/apify_client/clients/resource_clients/actor_collection.py b/src/apify_client/clients/resource_clients/actor_collection.py index 5a028bbb..14de9cab 100644 --- a/src/apify_client/clients/resource_clients/actor_collection.py +++ b/src/apify_client/clients/resource_clients/actor_collection.py @@ -12,7 +12,7 @@ class ActorCollectionClient(ResourceCollectionClient): - """Sub-client for manipulating actors.""" + """Sub-client for manipulating Actors.""" @ignore_docs def __init__(self: ActorCollectionClient, *args: Any, **kwargs: Any) -> None: @@ -28,18 +28,18 @@ def list( offset: int | None = None, desc: bool | None = None, ) -> ListPage[dict]: - """List the actors the user has created or used. + """List the Actors the user has created or used. https://docs.apify.com/api/v2#/reference/actors/actor-collection/get-list-of-actors Args: - my (bool, optional): If True, will return only actors which the user has created themselves. - limit (int, optional): How many actors to list - offset (int, optional): What actor to include as first when retrieving the list - desc (bool, optional): Whether to sort the actors in descending order based on their creation date + my (bool, optional): If True, will return only Actors which the user has created themselves. + limit (int, optional): How many Actors to list + offset (int, optional): What Actor to include as first when retrieving the list + desc (bool, optional): Whether to sort the Actors in descending order based on their creation date Returns: - ListPage: The list of available actors matching the specified filters. + ListPage: The list of available Actors matching the specified filters. """ return self._list(my=my, limit=limit, offset=offset, desc=desc) @@ -70,28 +70,28 @@ def create( actor_standby_build: str | None = None, actor_standby_memory_mbytes: int | None = None, ) -> dict: - """Create a new actor. + """Create a new Actor. https://docs.apify.com/api/v2#/reference/actors/actor-collection/create-actor Args: - name (str): The name of the actor - title (str, optional): The title of the actor (human-readable) - description (str, optional): The description for the actor - seo_title (str, optional): The title of the actor optimized for search engines - seo_description (str, optional): The description of the actor optimized for search engines - versions (list of dict, optional): The list of actor versions - restart_on_error (bool, optional): If true, the main actor run process will be restarted whenever it exits with a non-zero status code. - is_public (bool, optional): Whether the actor is public. - is_deprecated (bool, optional): Whether the actor is deprecated. - is_anonymously_runnable (bool, optional): Whether the actor is anonymously runnable. - categories (list of str, optional): The categories to which the actor belongs to. + name (str): The name of the Actor + title (str, optional): The title of the Actor (human-readable) + description (str, optional): The description for the Actor + seo_title (str, optional): The title of the Actor optimized for search engines + seo_description (str, optional): The description of the Actor optimized for search engines + versions (list of dict, optional): The list of Actor versions + restart_on_error (bool, optional): If true, the main Actor run process will be restarted whenever it exits with a non-zero status code. + is_public (bool, optional): Whether the Actor is public. + is_deprecated (bool, optional): Whether the Actor is deprecated. + is_anonymously_runnable (bool, optional): Whether the Actor is anonymously runnable. + categories (list of str, optional): The categories to which the Actor belongs to. default_run_build (str, optional): Tag or number of the build that you want to run by default. default_run_max_items (int, optional): Default limit of the number of results that will be returned by runs of this Actor, if the Actor is charged per result. - default_run_memory_mbytes (int, optional): Default amount of memory allocated for the runs of this actor, in megabytes. - default_run_timeout_secs (int, optional): Default timeout for the runs of this actor in seconds. - example_run_input_body (Any, optional): Input to be prefilled as default input to new users of this actor. + default_run_memory_mbytes (int, optional): Default amount of memory allocated for the runs of this Actor, in megabytes. + default_run_timeout_secs (int, optional): Default timeout for the runs of this Actor in seconds. + example_run_input_body (Any, optional): Input to be prefilled as default input to new users of this Actor. example_run_input_content_type (str, optional): The content type of the example run input. actor_standby_is_enabled (bool, optional): Whether the Actor Standby is enabled. actor_standby_desired_requests_per_actor_run (int, optional): The desired number of concurrent HTTP requests for @@ -102,7 +102,7 @@ def create( actor_standby_memory_mbytes (int, optional): The memory in megabytes to use when the Actor is in Standby mode. Returns: - dict: The created actor. + dict: The created Actor. """ actor_representation = get_actor_representation( name=name, @@ -134,7 +134,7 @@ def create( class ActorCollectionClientAsync(ResourceCollectionClientAsync): - """Async sub-client for manipulating actors.""" + """Async sub-client for manipulating Actors.""" @ignore_docs def __init__(self: ActorCollectionClientAsync, *args: Any, **kwargs: Any) -> None: @@ -150,18 +150,18 @@ async def list( offset: int | None = None, desc: bool | None = None, ) -> ListPage[dict]: - """List the actors the user has created or used. + """List the Actors the user has created or used. https://docs.apify.com/api/v2#/reference/actors/actor-collection/get-list-of-actors Args: - my (bool, optional): If True, will return only actors which the user has created themselves. - limit (int, optional): How many actors to list - offset (int, optional): What actor to include as first when retrieving the list - desc (bool, optional): Whether to sort the actors in descending order based on their creation date + my (bool, optional): If True, will return only Actors which the user has created themselves. + limit (int, optional): How many Actors to list + offset (int, optional): What Actor to include as first when retrieving the list + desc (bool, optional): Whether to sort the Actors in descending order based on their creation date Returns: - ListPage: The list of available actors matching the specified filters. + ListPage: The list of available Actors matching the specified filters. """ return await self._list(my=my, limit=limit, offset=offset, desc=desc) @@ -192,28 +192,28 @@ async def create( actor_standby_build: str | None = None, actor_standby_memory_mbytes: int | None = None, ) -> dict: - """Create a new actor. + """Create a new Actor. https://docs.apify.com/api/v2#/reference/actors/actor-collection/create-actor Args: - name (str): The name of the actor - title (str, optional): The title of the actor (human-readable) - description (str, optional): The description for the actor - seo_title (str, optional): The title of the actor optimized for search engines - seo_description (str, optional): The description of the actor optimized for search engines - versions (list of dict, optional): The list of actor versions - restart_on_error (bool, optional): If true, the main actor run process will be restarted whenever it exits with a non-zero status code. - is_public (bool, optional): Whether the actor is public. - is_deprecated (bool, optional): Whether the actor is deprecated. - is_anonymously_runnable (bool, optional): Whether the actor is anonymously runnable. - categories (list of str, optional): The categories to which the actor belongs to. + name (str): The name of the Actor + title (str, optional): The title of the Actor (human-readable) + description (str, optional): The description for the Actor + seo_title (str, optional): The title of the Actor optimized for search engines + seo_description (str, optional): The description of the Actor optimized for search engines + versions (list of dict, optional): The list of Actor versions + restart_on_error (bool, optional): If true, the main Actor run process will be restarted whenever it exits with a non-zero status code. + is_public (bool, optional): Whether the Actor is public. + is_deprecated (bool, optional): Whether the Actor is deprecated. + is_anonymously_runnable (bool, optional): Whether the Actor is anonymously runnable. + categories (list of str, optional): The categories to which the Actor belongs to. default_run_build (str, optional): Tag or number of the build that you want to run by default. default_run_max_items (int, optional): Default limit of the number of results that will be returned by runs of this Actor, if the Actor is charged per result. - default_run_memory_mbytes (int, optional): Default amount of memory allocated for the runs of this actor, in megabytes. - default_run_timeout_secs (int, optional): Default timeout for the runs of this actor in seconds. - example_run_input_body (Any, optional): Input to be prefilled as default input to new users of this actor. + default_run_memory_mbytes (int, optional): Default amount of memory allocated for the runs of this Actor, in megabytes. + default_run_timeout_secs (int, optional): Default timeout for the runs of this Actor in seconds. + example_run_input_body (Any, optional): Input to be prefilled as default input to new users of this Actor. example_run_input_content_type (str, optional): The content type of the example run input. actor_standby_is_enabled (bool, optional): Whether the Actor Standby is enabled. actor_standby_desired_requests_per_actor_run (int, optional): The desired number of concurrent HTTP requests for @@ -224,7 +224,7 @@ async def create( actor_standby_memory_mbytes (int, optional): The memory in megabytes to use when the Actor is in Standby mode. Returns: - dict: The created actor. + dict: The created Actor. """ actor_representation = get_actor_representation( name=name, diff --git a/src/apify_client/clients/resource_clients/actor_env_var.py b/src/apify_client/clients/resource_clients/actor_env_var.py index 0aff6066..b9428a36 100644 --- a/src/apify_client/clients/resource_clients/actor_env_var.py +++ b/src/apify_client/clients/resource_clients/actor_env_var.py @@ -22,7 +22,7 @@ def get_actor_env_var_representation( class ActorEnvVarClient(ResourceClient): - """Sub-client for manipulating a single actor environment variable.""" + """Sub-client for manipulating a single Actor environment variable.""" @ignore_docs def __init__(self: ActorEnvVarClient, *args: Any, **kwargs: Any) -> None: @@ -31,12 +31,12 @@ def __init__(self: ActorEnvVarClient, *args: Any, **kwargs: Any) -> None: super().__init__(*args, resource_path=resource_path, **kwargs) def get(self: ActorEnvVarClient) -> dict | None: - """Return information about the actor environment variable. + """Return information about the Actor environment variable. https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/get-environment-variable Returns: - dict, optional: The retrieved actor environment variable data + dict, optional: The retrieved Actor environment variable data """ return self._get() @@ -47,7 +47,7 @@ def update( name: str, value: str, ) -> dict: - """Update the actor environment variable with specified fields. + """Update the Actor environment variable with specified fields. https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/update-environment-variable @@ -57,7 +57,7 @@ def update( value (str): The value of the environment variable Returns: - dict: The updated actor environment variable + dict: The updated Actor environment variable """ actor_env_var_representation = get_actor_env_var_representation( is_secret=is_secret, @@ -68,7 +68,7 @@ def update( return self._update(filter_out_none_values_recursively(actor_env_var_representation)) def delete(self: ActorEnvVarClient) -> None: - """Delete the actor environment variable. + """Delete the Actor environment variable. https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/delete-environment-variable """ @@ -76,7 +76,7 @@ def delete(self: ActorEnvVarClient) -> None: class ActorEnvVarClientAsync(ResourceClientAsync): - """Async sub-client for manipulating a single actor environment variable.""" + """Async sub-client for manipulating a single Actor environment variable.""" @ignore_docs def __init__(self: ActorEnvVarClientAsync, *args: Any, **kwargs: Any) -> None: @@ -85,12 +85,12 @@ def __init__(self: ActorEnvVarClientAsync, *args: Any, **kwargs: Any) -> None: super().__init__(*args, resource_path=resource_path, **kwargs) async def get(self: ActorEnvVarClientAsync) -> dict | None: - """Return information about the actor environment variable. + """Return information about the Actor environment variable. https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/get-environment-variable Returns: - dict, optional: The retrieved actor environment variable data + dict, optional: The retrieved Actor environment variable data """ return await self._get() @@ -101,7 +101,7 @@ async def update( name: str, value: str, ) -> dict: - """Update the actor environment variable with specified fields. + """Update the Actor environment variable with specified fields. https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/update-environment-variable @@ -111,7 +111,7 @@ async def update( value (str): The value of the environment variable Returns: - dict: The updated actor environment variable + dict: The updated Actor environment variable """ actor_env_var_representation = get_actor_env_var_representation( is_secret=is_secret, @@ -122,7 +122,7 @@ async def update( return await self._update(filter_out_none_values_recursively(actor_env_var_representation)) async def delete(self: ActorEnvVarClientAsync) -> None: - """Delete the actor environment variable. + """Delete the Actor environment variable. https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/delete-environment-variable """ diff --git a/src/apify_client/clients/resource_clients/actor_version.py b/src/apify_client/clients/resource_clients/actor_version.py index c1f9cc48..de3ae219 100644 --- a/src/apify_client/clients/resource_clients/actor_version.py +++ b/src/apify_client/clients/resource_clients/actor_version.py @@ -38,7 +38,7 @@ def _get_actor_version_representation( class ActorVersionClient(ResourceClient): - """Sub-client for manipulating a single actor version.""" + """Sub-client for manipulating a single Actor version.""" @ignore_docs def __init__(self: ActorVersionClient, *args: Any, **kwargs: Any) -> None: @@ -47,12 +47,12 @@ def __init__(self: ActorVersionClient, *args: Any, **kwargs: Any) -> None: super().__init__(*args, resource_path=resource_path, **kwargs) def get(self: ActorVersionClient) -> dict | None: - """Return information about the actor version. + """Return information about the Actor version. https://docs.apify.com/api/v2#/reference/actors/version-object/get-version Returns: - dict, optional: The retrieved actor version data + dict, optional: The retrieved Actor version data """ return self._get() @@ -68,17 +68,17 @@ def update( tarball_url: str | None = None, github_gist_url: str | None = None, ) -> dict: - """Update the actor version with specified fields. + """Update the Actor version with specified fields. https://docs.apify.com/api/v2#/reference/actors/version-object/update-version Args: build_tag (str, optional): Tag that is automatically set to the latest successful build of the current version. - env_vars (list of dict, optional): Environment variables that will be available to the actor run process, + env_vars (list of dict, optional): Environment variables that will be available to the Actor run process, and optionally also to the build process. See the API docs for their exact structure. - apply_env_vars_to_build (bool, optional): Whether the environment variables specified for the actor run - will also be set to the actor build process. - source_type (ActorSourceType, optional): What source type is the actor version using. + apply_env_vars_to_build (bool, optional): Whether the environment variables specified for the Actor run + will also be set to the Actor build process. + source_type (ActorSourceType, optional): What source type is the Actor version using. source_files (list of dict, optional): Source code comprised of multiple files, each an item of the array. Required when ``source_type`` is ``ActorSourceType.SOURCE_FILES``. See the API docs for the exact structure. git_repo_url (str, optional): The URL of a Git repository from which the source code will be cloned. @@ -89,7 +89,7 @@ def update( Required when ``source_type`` is ``ActorSourceType.GITHUB_GIST``. Returns: - dict: The updated actor version + dict: The updated Actor version """ actor_version_representation = _get_actor_version_representation( build_tag=build_tag, @@ -105,30 +105,30 @@ def update( return self._update(filter_out_none_values_recursively(actor_version_representation)) def delete(self: ActorVersionClient) -> None: - """Delete the actor version. + """Delete the Actor version. https://docs.apify.com/api/v2#/reference/actors/version-object/delete-version """ return self._delete() def env_vars(self: ActorVersionClient) -> ActorEnvVarCollectionClient: - """Retrieve a client for the environment variables of this actor version.""" + """Retrieve a client for the environment variables of this Actor version.""" return ActorEnvVarCollectionClient(**self._sub_resource_init_options()) def env_var(self: ActorVersionClient, env_var_name: str) -> ActorEnvVarClient: - """Retrieve the client for the specified environment variable of this actor version. + """Retrieve the client for the specified environment variable of this Actor version. Args: env_var_name (str): The name of the environment variable for which to retrieve the resource client. Returns: - ActorEnvVarClient: The resource client for the specified actor environment variable. + ActorEnvVarClient: The resource client for the specified Actor environment variable. """ return ActorEnvVarClient(**self._sub_resource_init_options(resource_id=env_var_name)) class ActorVersionClientAsync(ResourceClientAsync): - """Async sub-client for manipulating a single actor version.""" + """Async sub-client for manipulating a single Actor version.""" @ignore_docs def __init__(self: ActorVersionClientAsync, *args: Any, **kwargs: Any) -> None: @@ -137,12 +137,12 @@ def __init__(self: ActorVersionClientAsync, *args: Any, **kwargs: Any) -> None: super().__init__(*args, resource_path=resource_path, **kwargs) async def get(self: ActorVersionClientAsync) -> dict | None: - """Return information about the actor version. + """Return information about the Actor version. https://docs.apify.com/api/v2#/reference/actors/version-object/get-version Returns: - dict, optional: The retrieved actor version data + dict, optional: The retrieved Actor version data """ return await self._get() @@ -158,17 +158,17 @@ async def update( tarball_url: str | None = None, github_gist_url: str | None = None, ) -> dict: - """Update the actor version with specified fields. + """Update the Actor version with specified fields. https://docs.apify.com/api/v2#/reference/actors/version-object/update-version Args: build_tag (str, optional): Tag that is automatically set to the latest successful build of the current version. - env_vars (list of dict, optional): Environment variables that will be available to the actor run process, + env_vars (list of dict, optional): Environment variables that will be available to the Actor run process, and optionally also to the build process. See the API docs for their exact structure. - apply_env_vars_to_build (bool, optional): Whether the environment variables specified for the actor run - will also be set to the actor build process. - source_type (ActorSourceType, optional): What source type is the actor version using. + apply_env_vars_to_build (bool, optional): Whether the environment variables specified for the Actor run + will also be set to the Actor build process. + source_type (ActorSourceType, optional): What source type is the Actor version using. source_files (list of dict, optional): Source code comprised of multiple files, each an item of the array. Required when ``source_type`` is ``ActorSourceType.SOURCE_FILES``. See the API docs for the exact structure. git_repo_url (str, optional): The URL of a Git repository from which the source code will be cloned. @@ -179,7 +179,7 @@ async def update( Required when ``source_type`` is ``ActorSourceType.GITHUB_GIST``. Returns: - dict: The updated actor version + dict: The updated Actor version """ actor_version_representation = _get_actor_version_representation( build_tag=build_tag, @@ -195,23 +195,23 @@ async def update( return await self._update(filter_out_none_values_recursively(actor_version_representation)) async def delete(self: ActorVersionClientAsync) -> None: - """Delete the actor version. + """Delete the Actor version. https://docs.apify.com/api/v2#/reference/actors/version-object/delete-version """ return await self._delete() def env_vars(self: ActorVersionClientAsync) -> ActorEnvVarCollectionClientAsync: - """Retrieve a client for the environment variables of this actor version.""" + """Retrieve a client for the environment variables of this Actor version.""" return ActorEnvVarCollectionClientAsync(**self._sub_resource_init_options()) def env_var(self: ActorVersionClientAsync, env_var_name: str) -> ActorEnvVarClientAsync: - """Retrieve the client for the specified environment variable of this actor version. + """Retrieve the client for the specified environment variable of this Actor version. Args: env_var_name (str): The name of the environment variable for which to retrieve the resource client. Returns: - ActorEnvVarClientAsync: The resource client for the specified actor environment variable. + ActorEnvVarClientAsync: The resource client for the specified Actor environment variable. """ return ActorEnvVarClientAsync(**self._sub_resource_init_options(resource_id=env_var_name)) diff --git a/src/apify_client/clients/resource_clients/actor_version_collection.py b/src/apify_client/clients/resource_clients/actor_version_collection.py index 0802e2b7..1f82983c 100644 --- a/src/apify_client/clients/resource_clients/actor_version_collection.py +++ b/src/apify_client/clients/resource_clients/actor_version_collection.py @@ -13,7 +13,7 @@ class ActorVersionCollectionClient(ResourceCollectionClient): - """Sub-client for manipulating actor versions.""" + """Sub-client for manipulating Actor versions.""" @ignore_docs def __init__(self: ActorVersionCollectionClient, *args: Any, **kwargs: Any) -> None: @@ -22,12 +22,12 @@ def __init__(self: ActorVersionCollectionClient, *args: Any, **kwargs: Any) -> N super().__init__(*args, resource_path=resource_path, **kwargs) def list(self: ActorVersionCollectionClient) -> ListPage[dict]: - """List the available actor versions. + """List the available Actor versions. https://docs.apify.com/api/v2#/reference/actors/version-collection/get-list-of-versions Returns: - ListPage: The list of available actor versions. + ListPage: The list of available Actor versions. """ return self._list() @@ -44,18 +44,18 @@ def create( tarball_url: str | None = None, github_gist_url: str | None = None, ) -> dict: - """Create a new actor version. + """Create a new Actor version. https://docs.apify.com/api/v2#/reference/actors/version-collection/create-version Args: - version_number (str): Major and minor version of the actor (e.g. ``1.0``) + version_number (str): Major and minor version of the Actor (e.g. ``1.0``) build_tag (str, optional): Tag that is automatically set to the latest successful build of the current version. - env_vars (list of dict, optional): Environment variables that will be available to the actor run process, + env_vars (list of dict, optional): Environment variables that will be available to the Actor run process, and optionally also to the build process. See the API docs for their exact structure. - apply_env_vars_to_build (bool, optional): Whether the environment variables specified for the actor run - will also be set to the actor build process. - source_type (ActorSourceType): What source type is the actor version using. + apply_env_vars_to_build (bool, optional): Whether the environment variables specified for the Actor run + will also be set to the Actor build process. + source_type (ActorSourceType): What source type is the Actor version using. source_files (list of dict, optional): Source code comprised of multiple files, each an item of the array. Required when ``source_type`` is ``ActorSourceType.SOURCE_FILES``. See the API docs for the exact structure. git_repo_url (str, optional): The URL of a Git repository from which the source code will be cloned. @@ -66,7 +66,7 @@ def create( Required when ``source_type`` is ``ActorSourceType.GITHUB_GIST``. Returns: - dict: The created actor version + dict: The created Actor version """ actor_version_representation = _get_actor_version_representation( version_number=version_number, @@ -84,7 +84,7 @@ def create( class ActorVersionCollectionClientAsync(ResourceCollectionClientAsync): - """Async sub-client for manipulating actor versions.""" + """Async sub-client for manipulating Actor versions.""" @ignore_docs def __init__(self: ActorVersionCollectionClientAsync, *args: Any, **kwargs: Any) -> None: @@ -93,12 +93,12 @@ def __init__(self: ActorVersionCollectionClientAsync, *args: Any, **kwargs: Any) super().__init__(*args, resource_path=resource_path, **kwargs) async def list(self: ActorVersionCollectionClientAsync) -> ListPage[dict]: - """List the available actor versions. + """List the available Actor versions. https://docs.apify.com/api/v2#/reference/actors/version-collection/get-list-of-versions Returns: - ListPage: The list of available actor versions. + ListPage: The list of available Actor versions. """ return await self._list() @@ -115,18 +115,18 @@ async def create( tarball_url: str | None = None, github_gist_url: str | None = None, ) -> dict: - """Create a new actor version. + """Create a new Actor version. https://docs.apify.com/api/v2#/reference/actors/version-collection/create-version Args: - version_number (str): Major and minor version of the actor (e.g. ``1.0``) + version_number (str): Major and minor version of the Actor (e.g. ``1.0``) build_tag (str, optional): Tag that is automatically set to the latest successful build of the current version. - env_vars (list of dict, optional): Environment variables that will be available to the actor run process, + env_vars (list of dict, optional): Environment variables that will be available to the Actor run process, and optionally also to the build process. See the API docs for their exact structure. - apply_env_vars_to_build (bool, optional): Whether the environment variables specified for the actor run - will also be set to the actor build process. - source_type (ActorSourceType): What source type is the actor version using. + apply_env_vars_to_build (bool, optional): Whether the environment variables specified for the Actor run + will also be set to the Actor build process. + source_type (ActorSourceType): What source type is the Actor version using. source_files (list of dict, optional): Source code comprised of multiple files, each an item of the array. Required when ``source_type`` is ``ActorSourceType.SOURCE_FILES``. See the API docs for the exact structure. git_repo_url (str, optional): The URL of a Git repository from which the source code will be cloned. @@ -137,7 +137,7 @@ async def create( Required when ``source_type`` is ``ActorSourceType.GITHUB_GIST``. Returns: - dict: The created actor version + dict: The created Actor version """ actor_version_representation = _get_actor_version_representation( version_number=version_number, diff --git a/src/apify_client/clients/resource_clients/build.py b/src/apify_client/clients/resource_clients/build.py index 7307c1c9..84a8ce70 100644 --- a/src/apify_client/clients/resource_clients/build.py +++ b/src/apify_client/clients/resource_clients/build.py @@ -9,7 +9,7 @@ class BuildClient(ActorJobBaseClient): - """Sub-client for manipulating a single actor build.""" + """Sub-client for manipulating a single Actor build.""" @ignore_docs def __init__(self: BuildClient, *args: Any, **kwargs: Any) -> None: @@ -18,12 +18,12 @@ def __init__(self: BuildClient, *args: Any, **kwargs: Any) -> None: super().__init__(*args, resource_path=resource_path, **kwargs) def get(self: BuildClient) -> dict | None: - """Return information about the actor build. + """Return information about the Actor build. https://docs.apify.com/api/v2#/reference/actor-builds/build-object/get-build Returns: - dict, optional: The retrieved actor build data + dict, optional: The retrieved Actor build data """ return self._get() @@ -35,12 +35,12 @@ def delete(self: BuildClient) -> None: return self._delete() def abort(self: BuildClient) -> dict: - """Abort the actor build which is starting or currently running and return its details. + """Abort the Actor build which is starting or currently running and return its details. https://docs.apify.com/api/v2#/reference/actor-builds/abort-build/abort-build Returns: - dict: The data of the aborted actor build + dict: The data of the aborted Actor build """ return self._abort() @@ -51,18 +51,18 @@ def wait_for_finish(self: BuildClient, *, wait_secs: int | None = None) -> dict wait_secs (int, optional): how long does the client wait for build to finish. None for indefinite. Returns: - dict, optional: The actor build data. If the status on the object is not one of the terminal statuses + dict, optional: The Actor build data. If the status on the object is not one of the terminal statuses (SUCEEDED, FAILED, TIMED_OUT, ABORTED), then the build has not yet finished. """ return self._wait_for_finish(wait_secs=wait_secs) def log(self: BuildClient) -> LogClient: - """Get the client for the log of the actor build. + """Get the client for the log of the Actor build. https://docs.apify.com/api/v2/#/reference/actor-builds/build-log/get-log Returns: - LogClient: A client allowing access to the log of this actor build. + LogClient: A client allowing access to the log of this Actor build. """ return LogClient( **self._sub_resource_init_options(resource_path='log'), @@ -70,7 +70,7 @@ def log(self: BuildClient) -> LogClient: class BuildClientAsync(ActorJobBaseClientAsync): - """Async sub-client for manipulating a single actor build.""" + """Async sub-client for manipulating a single Actor build.""" @ignore_docs def __init__(self: BuildClientAsync, *args: Any, **kwargs: Any) -> None: @@ -79,22 +79,22 @@ def __init__(self: BuildClientAsync, *args: Any, **kwargs: Any) -> None: super().__init__(*args, resource_path=resource_path, **kwargs) async def get(self: BuildClientAsync) -> dict | None: - """Return information about the actor build. + """Return information about the Actor build. https://docs.apify.com/api/v2#/reference/actor-builds/build-object/get-build Returns: - dict, optional: The retrieved actor build data + dict, optional: The retrieved Actor build data """ return await self._get() async def abort(self: BuildClientAsync) -> dict: - """Abort the actor build which is starting or currently running and return its details. + """Abort the Actor build which is starting or currently running and return its details. https://docs.apify.com/api/v2#/reference/actor-builds/abort-build/abort-build Returns: - dict: The data of the aborted actor build + dict: The data of the aborted Actor build """ return await self._abort() @@ -112,18 +112,18 @@ async def wait_for_finish(self: BuildClientAsync, *, wait_secs: int | None = Non wait_secs (int, optional): how long does the client wait for build to finish. None for indefinite. Returns: - dict, optional: The actor build data. If the status on the object is not one of the terminal statuses + dict, optional: The Actor build data. If the status on the object is not one of the terminal statuses (SUCEEDED, FAILED, TIMED_OUT, ABORTED), then the build has not yet finished. """ return await self._wait_for_finish(wait_secs=wait_secs) def log(self: BuildClientAsync) -> LogClientAsync: - """Get the client for the log of the actor build. + """Get the client for the log of the Actor build. https://docs.apify.com/api/v2/#/reference/actor-builds/build-log/get-log Returns: - LogClientAsync: A client allowing access to the log of this actor build. + LogClientAsync: A client allowing access to the log of this Actor build. """ return LogClientAsync( **self._sub_resource_init_options(resource_path='log'), diff --git a/src/apify_client/clients/resource_clients/build_collection.py b/src/apify_client/clients/resource_clients/build_collection.py index 1f0f29ea..0f36c912 100644 --- a/src/apify_client/clients/resource_clients/build_collection.py +++ b/src/apify_client/clients/resource_clients/build_collection.py @@ -11,7 +11,7 @@ class BuildCollectionClient(ResourceCollectionClient): - """Sub-client for listing actor builds.""" + """Sub-client for listing Actor builds.""" @ignore_docs def __init__(self: BuildCollectionClient, *args: Any, **kwargs: Any) -> None: @@ -26,7 +26,7 @@ def list( offset: int | None = None, desc: bool | None = None, ) -> ListPage[dict]: - """List all actor builds (either of a single actor, or all user's actors, depending on where this client was initialized from). + """List all Actor builds (either of a single Actor, or all user's Actors, depending on where this client was initialized from). https://docs.apify.com/api/v2#/reference/actors/build-collection/get-list-of-builds https://docs.apify.com/api/v2#/reference/actor-builds/build-collection/get-user-builds-list @@ -37,13 +37,13 @@ def list( desc (bool, optional): Whether to sort the builds in descending order based on their start date Returns: - ListPage: The retrieved actor builds + ListPage: The retrieved Actor builds """ return self._list(limit=limit, offset=offset, desc=desc) class BuildCollectionClientAsync(ResourceCollectionClientAsync): - """Async sub-client for listing actor builds.""" + """Async sub-client for listing Actor builds.""" @ignore_docs def __init__(self: BuildCollectionClientAsync, *args: Any, **kwargs: Any) -> None: @@ -58,7 +58,7 @@ async def list( offset: int | None = None, desc: bool | None = None, ) -> ListPage[dict]: - """List all actor builds (either of a single actor, or all user's actors, depending on where this client was initialized from). + """List all Actor builds (either of a single Actor, or all user's Actors, depending on where this client was initialized from). https://docs.apify.com/api/v2#/reference/actors/build-collection/get-list-of-builds https://docs.apify.com/api/v2#/reference/actor-builds/build-collection/get-user-builds-list @@ -69,6 +69,6 @@ async def list( desc (bool, optional): Whether to sort the builds in descending order based on their start date Returns: - ListPage: The retrieved actor builds + ListPage: The retrieved Actor builds """ return await self._list(limit=limit, offset=offset, desc=desc) diff --git a/src/apify_client/clients/resource_clients/run.py b/src/apify_client/clients/resource_clients/run.py index 61fa0242..d835d28f 100644 --- a/src/apify_client/clients/resource_clients/run.py +++ b/src/apify_client/clients/resource_clients/run.py @@ -13,7 +13,7 @@ class RunClient(ActorJobBaseClient): - """Sub-client for manipulating a single actor run.""" + """Sub-client for manipulating a single Actor run.""" @ignore_docs def __init__(self: RunClient, *args: Any, **kwargs: Any) -> None: @@ -22,12 +22,12 @@ def __init__(self: RunClient, *args: Any, **kwargs: Any) -> None: super().__init__(*args, resource_path=resource_path, **kwargs) def get(self: RunClient) -> dict | None: - """Return information about the actor run. + """Return information about the Actor run. https://docs.apify.com/api/v2#/reference/actor-runs/run-object/get-run Returns: - dict: The retrieved actor run data + dict: The retrieved Actor run data """ return self._get() @@ -58,17 +58,17 @@ def delete(self: RunClient) -> None: return self._delete() def abort(self: RunClient, *, gracefully: bool | None = None) -> dict: - """Abort the actor run which is starting or currently running and return its details. + """Abort the Actor run which is starting or currently running and return its details. https://docs.apify.com/api/v2#/reference/actor-runs/abort-run/abort-run Args: - gracefully (bool, optional): If True, the actor run will abort gracefully. + gracefully (bool, optional): If True, the Actor run will abort gracefully. It will send ``aborting`` and ``persistStates`` events into the run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. Returns: - dict: The data of the aborted actor run + dict: The data of the aborted Actor run """ return self._abort(gracefully=gracefully) @@ -79,7 +79,7 @@ def wait_for_finish(self: RunClient, *, wait_secs: int | None = None) -> dict | wait_secs (int, optional): how long does the client wait for run to finish. None for indefinite. Returns: - dict, optional: The actor run data. If the status on the object is not one of the terminal statuses + dict, optional: The Actor run data. If the status on the object is not one of the terminal statuses (SUCEEDED, FAILED, TIMED_OUT, ABORTED), then the run has not yet finished. """ return self._wait_for_finish(wait_secs=wait_secs) @@ -92,19 +92,19 @@ def metamorph( run_input: Any = None, content_type: str | None = None, ) -> dict: - """Transform an actor run into a run of another actor with a new input. + """Transform an Actor run into a run of another Actor with a new input. https://docs.apify.com/api/v2#/reference/actor-runs/metamorph-run/metamorph-run Args: - target_actor_id (str): ID of the target actor that the run should be transformed into - target_actor_build (str, optional): The build of the target actor. It can be either a build tag or build number. - By default, the run uses the build specified in the default run configuration for the target actor (typically the latest build). + target_actor_id (str): ID of the target Actor that the run should be transformed into + target_actor_build (str, optional): The build of the target Actor. It can be either a build tag or build number. + By default, the run uses the build specified in the default run configuration for the target Actor (typically the latest build). run_input (Any, optional): The input to pass to the new run. content_type (str, optional): The content type of the input. Returns: - dict: The actor run data. + dict: The Actor run data. """ run_input, content_type = encode_key_value_store_record_value(run_input, content_type) @@ -132,7 +132,7 @@ def resurrect( memory_mbytes: int | None = None, timeout_secs: int | None = None, ) -> dict: - """Resurrect a finished actor run. + """Resurrect a finished Actor run. Only finished runs, i.e. runs with status FINISHED, FAILED, ABORTED and TIMED-OUT can be resurrected. Run status will be updated to RUNNING and its container will be restarted with the same default storages. @@ -140,7 +140,7 @@ def resurrect( https://docs.apify.com/api/v2#/reference/actor-runs/resurrect-run/resurrect-run Args: - build (str, optional): Which actor build the resurrected run should use. It can be either a build tag or build number. + build (str, optional): Which Actor build the resurrected run should use. It can be either a build tag or build number. By default, the resurrected run uses the same build as before. memory_mbytes (int, optional): New memory limit for the resurrected run, in megabytes. By default, the resurrected run uses the same memory limit as before. @@ -148,7 +148,7 @@ def resurrect( By default, the resurrected run uses the same timeout as before. Returns: - dict: The actor run data. + dict: The Actor run data. """ request_params = self._params( build=build, @@ -179,48 +179,48 @@ def reboot(self: RunClient) -> dict: return parse_date_fields(pluck_data(response.json())) def dataset(self: RunClient) -> DatasetClient: - """Get the client for the default dataset of the actor run. + """Get the client for the default dataset of the Actor run. https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages Returns: - DatasetClient: A client allowing access to the default dataset of this actor run. + DatasetClient: A client allowing access to the default dataset of this Actor run. """ return DatasetClient( **self._sub_resource_init_options(resource_path='dataset'), ) def key_value_store(self: RunClient) -> KeyValueStoreClient: - """Get the client for the default key-value store of the actor run. + """Get the client for the default key-value store of the Actor run. https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages Returns: - KeyValueStoreClient: A client allowing access to the default key-value store of this actor run. + KeyValueStoreClient: A client allowing access to the default key-value store of this Actor run. """ return KeyValueStoreClient( **self._sub_resource_init_options(resource_path='key-value-store'), ) def request_queue(self: RunClient) -> RequestQueueClient: - """Get the client for the default request queue of the actor run. + """Get the client for the default request queue of the Actor run. https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages Returns: - RequestQueueClient: A client allowing access to the default request_queue of this actor run. + RequestQueueClient: A client allowing access to the default request_queue of this Actor run. """ return RequestQueueClient( **self._sub_resource_init_options(resource_path='request-queue'), ) def log(self: RunClient) -> LogClient: - """Get the client for the log of the actor run. + """Get the client for the log of the Actor run. https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages Returns: - LogClient: A client allowing access to the log of this actor run. + LogClient: A client allowing access to the log of this Actor run. """ return LogClient( **self._sub_resource_init_options(resource_path='log'), @@ -228,7 +228,7 @@ def log(self: RunClient) -> LogClient: class RunClientAsync(ActorJobBaseClientAsync): - """Async sub-client for manipulating a single actor run.""" + """Async sub-client for manipulating a single Actor run.""" @ignore_docs def __init__(self: RunClientAsync, *args: Any, **kwargs: Any) -> None: @@ -237,12 +237,12 @@ def __init__(self: RunClientAsync, *args: Any, **kwargs: Any) -> None: super().__init__(*args, resource_path=resource_path, **kwargs) async def get(self: RunClientAsync) -> dict | None: - """Return information about the actor run. + """Return information about the Actor run. https://docs.apify.com/api/v2#/reference/actor-runs/run-object/get-run Returns: - dict: The retrieved actor run data + dict: The retrieved Actor run data """ return await self._get() @@ -266,17 +266,17 @@ async def update(self: RunClientAsync, *, status_message: str | None = None, is_ return await self._update(filter_out_none_values_recursively(updated_fields)) async def abort(self: RunClientAsync, *, gracefully: bool | None = None) -> dict: - """Abort the actor run which is starting or currently running and return its details. + """Abort the Actor run which is starting or currently running and return its details. https://docs.apify.com/api/v2#/reference/actor-runs/abort-run/abort-run Args: - gracefully (bool, optional): If True, the actor run will abort gracefully. + gracefully (bool, optional): If True, the Actor run will abort gracefully. It will send ``aborting`` and ``persistStates`` events into the run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. Returns: - dict: The data of the aborted actor run + dict: The data of the aborted Actor run """ return await self._abort(gracefully=gracefully) @@ -287,7 +287,7 @@ async def wait_for_finish(self: RunClientAsync, *, wait_secs: int | None = None) wait_secs (int, optional): how long does the client wait for run to finish. None for indefinite. Returns: - dict, optional: The actor run data. If the status on the object is not one of the terminal statuses + dict, optional: The Actor run data. If the status on the object is not one of the terminal statuses (SUCEEDED, FAILED, TIMED_OUT, ABORTED), then the run has not yet finished. """ return await self._wait_for_finish(wait_secs=wait_secs) @@ -307,19 +307,19 @@ async def metamorph( run_input: Any = None, content_type: str | None = None, ) -> dict: - """Transform an actor run into a run of another actor with a new input. + """Transform an Actor run into a run of another Actor with a new input. https://docs.apify.com/api/v2#/reference/actor-runs/metamorph-run/metamorph-run Args: - target_actor_id (str): ID of the target actor that the run should be transformed into - target_actor_build (str, optional): The build of the target actor. It can be either a build tag or build number. - By default, the run uses the build specified in the default run configuration for the target actor (typically the latest build). + target_actor_id (str): ID of the target Actor that the run should be transformed into + target_actor_build (str, optional): The build of the target Actor. It can be either a build tag or build number. + By default, the run uses the build specified in the default run configuration for the target Actor (typically the latest build). run_input (Any, optional): The input to pass to the new run. content_type (str, optional): The content type of the input. Returns: - dict: The actor run data. + dict: The Actor run data. """ run_input, content_type = encode_key_value_store_record_value(run_input, content_type) @@ -347,7 +347,7 @@ async def resurrect( memory_mbytes: int | None = None, timeout_secs: int | None = None, ) -> dict: - """Resurrect a finished actor run. + """Resurrect a finished Actor run. Only finished runs, i.e. runs with status FINISHED, FAILED, ABORTED and TIMED-OUT can be resurrected. Run status will be updated to RUNNING and its container will be restarted with the same default storages. @@ -355,7 +355,7 @@ async def resurrect( https://docs.apify.com/api/v2#/reference/actor-runs/resurrect-run/resurrect-run Args: - build (str, optional): Which actor build the resurrected run should use. It can be either a build tag or build number. + build (str, optional): Which Actor build the resurrected run should use. It can be either a build tag or build number. By default, the resurrected run uses the same build as before. memory_mbytes (int, optional): New memory limit for the resurrected run, in megabytes. By default, the resurrected run uses the same memory limit as before. @@ -363,7 +363,7 @@ async def resurrect( By default, the resurrected run uses the same timeout as before. Returns: - dict: The actor run data. + dict: The Actor run data. """ request_params = self._params( build=build, @@ -394,48 +394,48 @@ async def reboot(self: RunClientAsync) -> dict: return parse_date_fields(pluck_data(response.json())) def dataset(self: RunClientAsync) -> DatasetClientAsync: - """Get the client for the default dataset of the actor run. + """Get the client for the default dataset of the Actor run. https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages Returns: - DatasetClientAsync: A client allowing access to the default dataset of this actor run. + DatasetClientAsync: A client allowing access to the default dataset of this Actor run. """ return DatasetClientAsync( **self._sub_resource_init_options(resource_path='dataset'), ) def key_value_store(self: RunClientAsync) -> KeyValueStoreClientAsync: - """Get the client for the default key-value store of the actor run. + """Get the client for the default key-value store of the Actor run. https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages Returns: - KeyValueStoreClientAsync: A client allowing access to the default key-value store of this actor run. + KeyValueStoreClientAsync: A client allowing access to the default key-value store of this Actor run. """ return KeyValueStoreClientAsync( **self._sub_resource_init_options(resource_path='key-value-store'), ) def request_queue(self: RunClientAsync) -> RequestQueueClientAsync: - """Get the client for the default request queue of the actor run. + """Get the client for the default request queue of the Actor run. https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages Returns: - RequestQueueClientAsync: A client allowing access to the default request_queue of this actor run. + RequestQueueClientAsync: A client allowing access to the default request_queue of this Actor run. """ return RequestQueueClientAsync( **self._sub_resource_init_options(resource_path='request-queue'), ) def log(self: RunClientAsync) -> LogClientAsync: - """Get the client for the log of the actor run. + """Get the client for the log of the Actor run. https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages Returns: - LogClientAsync: A client allowing access to the log of this actor run. + LogClientAsync: A client allowing access to the log of this Actor run. """ return LogClientAsync( **self._sub_resource_init_options(resource_path='log'), diff --git a/src/apify_client/clients/resource_clients/run_collection.py b/src/apify_client/clients/resource_clients/run_collection.py index 4bb11b8c..65103dab 100644 --- a/src/apify_client/clients/resource_clients/run_collection.py +++ b/src/apify_client/clients/resource_clients/run_collection.py @@ -12,7 +12,7 @@ class RunCollectionClient(ResourceCollectionClient): - """Sub-client for listing actor runs.""" + """Sub-client for listing Actor runs.""" @ignore_docs def __init__(self: RunCollectionClient, *args: Any, **kwargs: Any) -> None: @@ -28,7 +28,7 @@ def list( desc: bool | None = None, status: ActorJobStatus | None = None, ) -> ListPage[dict]: - """List all actor runs (either of a single actor, or all user's actors, depending on where this client was initialized from). + """List all Actor runs (either of a single Actor, or all user's Actors, depending on where this client was initialized from). https://docs.apify.com/api/v2#/reference/actors/run-collection/get-list-of-runs @@ -41,7 +41,7 @@ def list( status (ActorJobStatus, optional): Retrieve only runs with the provided status Returns: - ListPage: The retrieved actor runs + ListPage: The retrieved Actor runs """ return self._list( limit=limit, @@ -52,7 +52,7 @@ def list( class RunCollectionClientAsync(ResourceCollectionClientAsync): - """Async sub-client for listing actor runs.""" + """Async sub-client for listing Actor runs.""" @ignore_docs def __init__(self: RunCollectionClientAsync, *args: Any, **kwargs: Any) -> None: @@ -68,7 +68,7 @@ async def list( desc: bool | None = None, status: ActorJobStatus | None = None, ) -> ListPage[dict]: - """List all actor runs (either of a single actor, or all user's actors, depending on where this client was initialized from). + """List all Actor runs (either of a single Actor, or all user's Actors, depending on where this client was initialized from). https://docs.apify.com/api/v2#/reference/actors/run-collection/get-list-of-runs @@ -81,7 +81,7 @@ async def list( status (ActorJobStatus, optional): Retrieve only runs with the provided status Returns: - ListPage: The retrieved actor runs + ListPage: The retrieved Actor runs """ return await self._list( limit=limit, diff --git a/src/apify_client/clients/resource_clients/schedule.py b/src/apify_client/clients/resource_clients/schedule.py index d7c845af..76bf5f92 100644 --- a/src/apify_client/clients/resource_clients/schedule.py +++ b/src/apify_client/clients/resource_clients/schedule.py @@ -69,7 +69,7 @@ def update( Args: cron_expression (str, optional): The cron expression used by this schedule is_enabled (bool, optional): True if the schedule should be enabled - is_exclusive (bool, optional): When set to true, don't start actor or actor task if it's still running from the previous schedule. + is_exclusive (bool, optional): When set to true, don't start Actor or Actor task if it's still running from the previous schedule. name (str, optional): The name of the schedule to create. actions (list of dict, optional): Actors or tasks that should be run on this schedule. See the API documentation for exact structure. description (str, optional): Description of this schedule @@ -159,7 +159,7 @@ async def update( Args: cron_expression (str, optional): The cron expression used by this schedule is_enabled (bool, optional): True if the schedule should be enabled - is_exclusive (bool, optional): When set to true, don't start actor or actor task if it's still running from the previous schedule. + is_exclusive (bool, optional): When set to true, don't start Actor or Actor task if it's still running from the previous schedule. name (str, optional): The name of the schedule to create. actions (list of dict, optional): Actors or tasks that should be run on this schedule. See the API documentation for exact structure. description (str, optional): Description of this schedule diff --git a/src/apify_client/clients/resource_clients/schedule_collection.py b/src/apify_client/clients/resource_clients/schedule_collection.py index dd4edbce..b82ae9ed 100644 --- a/src/apify_client/clients/resource_clients/schedule_collection.py +++ b/src/apify_client/clients/resource_clients/schedule_collection.py @@ -60,7 +60,7 @@ def create( Args: cron_expression (str): The cron expression used by this schedule is_enabled (bool): True if the schedule should be enabled - is_exclusive (bool): When set to true, don't start actor or actor task if it's still running from the previous schedule. + is_exclusive (bool): When set to true, don't start Actor or Actor task if it's still running from the previous schedule. name (str, optional): The name of the schedule to create. actions (list of dict, optional): Actors or tasks that should be run on this schedule. See the API documentation for exact structure. description (str, optional): Description of this schedule @@ -137,7 +137,7 @@ async def create( Args: cron_expression (str): The cron expression used by this schedule is_enabled (bool): True if the schedule should be enabled - is_exclusive (bool): When set to true, don't start actor or actor task if it's still running from the previous schedule. + is_exclusive (bool): When set to true, don't start Actor or Actor task if it's still running from the previous schedule. name (str, optional): The name of the schedule to create. actions (list of dict, optional): Actors or tasks that should be run on this schedule. See the API documentation for exact structure. description (str, optional): Description of this schedule diff --git a/src/apify_client/clients/resource_clients/task.py b/src/apify_client/clients/resource_clients/task.py index dd3e39fb..2df842a4 100644 --- a/src/apify_client/clients/resource_clients/task.py +++ b/src/apify_client/clients/resource_clients/task.py @@ -158,7 +158,7 @@ def start( Args: task_input (dict, optional): Task input dictionary - build (str, optional): Specifies the actor build to run. It can be either a build tag or build number. + build (str, optional): Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build specified in the task settings (typically latest). max_items (int, optional): Maximum number of results that will be returned by this run. If the Actor is charged per result, you will not be charged for more results than the given limit. @@ -168,9 +168,9 @@ def start( wait_for_finish (int, optional): The maximum number of seconds the server waits for the run to finish. By default, it is 0, the maximum value is 60. webhooks (list of dict, optional): Optional ad-hoc webhooks (https://docs.apify.com/webhooks/ad-hoc-webhooks) - associated with the actor run which can be used to receive a notification, - e.g. when the actor finished or failed. - If you already have a webhook set up for the actor or task, you do not have to add it again here. + associated with the Actor run which can be used to receive a notification, + e.g. when the Actor finished or failed. + If you already have a webhook set up for the Actor or task, you do not have to add it again here. Each webhook is represented by a dictionary containing these items: * ``event_types``: list of ``WebhookEventType`` values which trigger the webhook * ``request_url``: URL to which to send the webhook HTTP request @@ -217,15 +217,15 @@ def call( Args: task_input (dict, optional): Task input dictionary - build (str, optional): Specifies the actor build to run. It can be either a build tag or build number. + build (str, optional): Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build specified in the task settings (typically latest). max_items (int, optional): Maximum number of results that will be returned by this run. If the Actor is charged per result, you will not be charged for more results than the given limit. memory_mbytes (int, optional): Memory limit for the run, in megabytes. By default, the run uses a memory limit specified in the task settings. timeout_secs (int, optional): Optional timeout for the run, in seconds. By default, the run uses timeout specified in the task settings. - webhooks (list, optional): Specifies optional webhooks associated with the actor run, which can be used to receive a notification - e.g. when the actor finished or failed. Note: if you already have a webhook set up for the actor or task, + webhooks (list, optional): Specifies optional webhooks associated with the Actor run, which can be used to receive a notification + e.g. when the Actor finished or failed. Note: if you already have a webhook set up for the Actor or task, you do not have to add it again here. wait_secs (int, optional): The maximum number of seconds the server waits for the task run to finish. If not provided, waits indefinitely. @@ -411,7 +411,7 @@ async def start( Args: task_input (dict, optional): Task input dictionary - build (str, optional): Specifies the actor build to run. It can be either a build tag or build number. + build (str, optional): Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build specified in the task settings (typically latest). max_items (int, optional): Maximum number of results that will be returned by this run. If the Actor is charged per result, you will not be charged for more results than the given limit. @@ -421,9 +421,9 @@ async def start( wait_for_finish (int, optional): The maximum number of seconds the server waits for the run to finish. By default, it is 0, the maximum value is 60. webhooks (list of dict, optional): Optional ad-hoc webhooks (https://docs.apify.com/webhooks/ad-hoc-webhooks) - associated with the actor run which can be used to receive a notification, - e.g. when the actor finished or failed. - If you already have a webhook set up for the actor or task, you do not have to add it again here. + associated with the Actor run which can be used to receive a notification, + e.g. when the Actor finished or failed. + If you already have a webhook set up for the Actor or task, you do not have to add it again here. Each webhook is represented by a dictionary containing these items: * ``event_types``: list of ``WebhookEventType`` values which trigger the webhook * ``request_url``: URL to which to send the webhook HTTP request @@ -470,15 +470,15 @@ async def call( Args: task_input (dict, optional): Task input dictionary - build (str, optional): Specifies the actor build to run. It can be either a build tag or build number. + build (str, optional): Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build specified in the task settings (typically latest). max_items (int, optional): Maximum number of results that will be returned by this run. If the Actor is charged per result, you will not be charged for more results than the given limit. memory_mbytes (int, optional): Memory limit for the run, in megabytes. By default, the run uses a memory limit specified in the task settings. timeout_secs (int, optional): Optional timeout for the run, in seconds. By default, the run uses timeout specified in the task settings. - webhooks (list, optional): Specifies optional webhooks associated with the actor run, which can be used to receive a notification - e.g. when the actor finished or failed. Note: if you already have a webhook set up for the actor or task, + webhooks (list, optional): Specifies optional webhooks associated with the Actor run, which can be used to receive a notification + e.g. when the Actor finished or failed. Note: if you already have a webhook set up for the Actor or task, you do not have to add it again here. wait_secs (int, optional): The maximum number of seconds the server waits for the task run to finish. If not provided, waits indefinitely. diff --git a/src/apify_client/clients/resource_clients/task_collection.py b/src/apify_client/clients/resource_clients/task_collection.py index 5e063d6f..3245869c 100644 --- a/src/apify_client/clients/resource_clients/task_collection.py +++ b/src/apify_client/clients/resource_clients/task_collection.py @@ -63,7 +63,7 @@ def create( https://docs.apify.com/api/v2#/reference/actor-tasks/task-collection/create-task Args: - actor_id (str): Id of the actor that should be run + actor_id (str): Id of the Actor that should be run name (str): Name of the task build (str, optional): Actor build to run. It can be either a build tag or build number. By default, the run uses the build specified in the task settings (typically latest). @@ -155,7 +155,7 @@ async def create( https://docs.apify.com/api/v2#/reference/actor-tasks/task-collection/create-task Args: - actor_id (str): Id of the actor that should be run + actor_id (str): Id of the Actor that should be run name (str): Name of the task build (str, optional): Actor build to run. It can be either a build tag or build number. By default, the run uses the build specified in the task settings (typically latest). diff --git a/src/apify_client/clients/resource_clients/webhook.py b/src/apify_client/clients/resource_clients/webhook.py index 35a32f52..c2f8bcde 100644 --- a/src/apify_client/clients/resource_clients/webhook.py +++ b/src/apify_client/clients/resource_clients/webhook.py @@ -99,9 +99,9 @@ def update( request_url (str, optional): URL that will be invoked once the webhook is triggered. payload_template (str, optional): Specification of the payload that will be sent to request_url headers_template (str, optional): Headers that will be sent to the request_url - actor_id (str, optional): Id of the actor whose runs should trigger the webhook. - actor_task_id (str, optional): Id of the actor task whose runs should trigger the webhook. - actor_run_id (str, optional): Id of the actor run which should trigger the webhook. + actor_id (str, optional): Id of the Actor whose runs should trigger the webhook. + actor_task_id (str, optional): Id of the Actor task whose runs should trigger the webhook. + actor_run_id (str, optional): Id of the Actor run which should trigger the webhook. ignore_ssl_errors (bool, optional): Whether the webhook should ignore SSL errors returned by request_url do_not_retry (bool, optional): Whether the webhook should retry sending the payload to request_url upon failure. @@ -212,9 +212,9 @@ async def update( request_url (str, optional): URL that will be invoked once the webhook is triggered. payload_template (str, optional): Specification of the payload that will be sent to request_url headers_template (str, optional): Headers that will be sent to the request_url - actor_id (str, optional): Id of the actor whose runs should trigger the webhook. - actor_task_id (str, optional): Id of the actor task whose runs should trigger the webhook. - actor_run_id (str, optional): Id of the actor run which should trigger the webhook. + actor_id (str, optional): Id of the Actor whose runs should trigger the webhook. + actor_task_id (str, optional): Id of the Actor task whose runs should trigger the webhook. + actor_run_id (str, optional): Id of the Actor run which should trigger the webhook. ignore_ssl_errors (bool, optional): Whether the webhook should ignore SSL errors returned by request_url do_not_retry (bool, optional): Whether the webhook should retry sending the payload to request_url upon failure. diff --git a/src/apify_client/clients/resource_clients/webhook_collection.py b/src/apify_client/clients/resource_clients/webhook_collection.py index 2ff99f70..e5851dca 100644 --- a/src/apify_client/clients/resource_clients/webhook_collection.py +++ b/src/apify_client/clients/resource_clients/webhook_collection.py @@ -68,9 +68,9 @@ def create( request_url (str): URL that will be invoked once the webhook is triggered. payload_template (str, optional): Specification of the payload that will be sent to request_url headers_template (str, optional): Headers that will be sent to the request_url - actor_id (str, optional): Id of the actor whose runs should trigger the webhook. - actor_task_id (str, optional): Id of the actor task whose runs should trigger the webhook. - actor_run_id (str, optional): Id of the actor run which should trigger the webhook. + actor_id (str, optional): Id of the Actor whose runs should trigger the webhook. + actor_task_id (str, optional): Id of the Actor task whose runs should trigger the webhook. + actor_run_id (str, optional): Id of the Actor run which should trigger the webhook. ignore_ssl_errors (bool, optional): Whether the webhook should ignore SSL errors returned by request_url do_not_retry (bool, optional): Whether the webhook should retry sending the payload to request_url upon failure. @@ -155,9 +155,9 @@ async def create( request_url (str): URL that will be invoked once the webhook is triggered. payload_template (str, optional): Specification of the payload that will be sent to request_url headers_template (str, optional): Headers that will be sent to the request_url - actor_id (str, optional): Id of the actor whose runs should trigger the webhook. - actor_task_id (str, optional): Id of the actor task whose runs should trigger the webhook. - actor_run_id (str, optional): Id of the actor run which should trigger the webhook. + actor_id (str, optional): Id of the Actor whose runs should trigger the webhook. + actor_task_id (str, optional): Id of the Actor task whose runs should trigger the webhook. + actor_run_id (str, optional): Id of the Actor run which should trigger the webhook. ignore_ssl_errors (bool, optional): Whether the webhook should ignore SSL errors returned by request_url do_not_retry (bool, optional): Whether the webhook should retry sending the payload to request_url upon failure. diff --git a/website/src/pages/index.js b/website/src/pages/index.js index 75fcb890..cf975834 100644 --- a/website/src/pages/index.js +++ b/website/src/pages/index.js @@ -67,8 +67,8 @@ export default function Home() {
- For example, the Apify API Client for Python makes it easy to run your own actors or actors from the Apify Store
- {' '}by simply using the .call()
method to start an actor and wait for it to finish.
+ For example, the Apify API Client for Python makes it easy to run your own Actors or Actors from the Apify Store
+ {' '}by simply using the .call()
method to start an Actor and wait for it to finish.