@@ -17,8 +17,8 @@ It provides useful features like automatic retries and convenience functions tha
1717
1818Requires Python 3.7+
1919
20- Right now the client is not available on PyPI yet, so you can install it only from its [ git repo ] ( https://github.com/apify /apify-client-python ) .
21- To do that, run ` pip install git+https://github.com/ apify/apify -client-python.git `
20+ You can install the client from its [ PyPI listing ] ( https://pypi.org/project /apify-client/ ) .
21+ To do that, simply run ` pip install apify-client ` .
2222
2323## Quick Start
2424
@@ -31,7 +31,7 @@ apify_client = ApifyClient('MY-APIFY-TOKEN')
3131actor_call = apify_client.actor(' john-doe/my-cool-actor' ).call()
3232
3333# Fetch results from the actor's default dataset
34- dataset_items = apify_client.dataset(actor_call[' defaultDatasetId' ]).list_items()[ ' items' ]
34+ dataset_items = apify_client.dataset(actor_call[' defaultDatasetId' ]).list_items(). items
3535```
3636
3737## Features
@@ -74,16 +74,16 @@ apify_client = ApifyClient('MY-APIFY-TOKEN')
7474# Collection clients do not require a parameter
7575actor_collection_client = apify_client.actors()
7676# Create an actor with the name: my-actor
77- my_actor = actor_collection_client.create({ name: ' my-actor' } )
77+ my_actor = actor_collection_client.create(name = ' my-actor' )
7878# List all of your actors
79- actor_list = actor_collection_client.list()[ ' items' ]
79+ actor_list = actor_collection_client.list(). items
8080```
8181
8282``` python
8383# Collection clients do not require a parameter
8484dataset_collection_client = apify_client.datasets()
8585# Get (or create, if it doesn't exist) a dataset with the name of my-dataset
86- my_dataset = dataset_collection_client.get_or_create(' my-dataset' )
86+ my_dataset = dataset_collection_client.get_or_create(name = ' my-dataset' )
8787```
8888
8989``` python
@@ -92,14 +92,14 @@ actor_client = apify_client.actor('john-doe/my-actor')
9292# Fetch the john-doe/my-actor object from the API
9393my_actor = actor_client.get()
9494# Start the run of john-doe/my-actor and return the Run object
95- my_actor_run = actor_client.start();
95+ my_actor_run = actor_client.start()
9696```
9797
9898``` python
9999# Resource clients accept an ID of the resource
100100dataset_client = apify_client.dataset(' john-doe/my-dataset' )
101101# Append items to the end of john-doe/my-dataset
102- dataset_client.push_items([{ " foo" : 1 }, { " bar" : 2 }])
102+ dataset_client.push_items([{ ' foo' : 1 }, { ' bar' : 2 }])
103103```
104104
105105> The ID of the resource can be either the ` id ` of the said resource,
@@ -117,18 +117,14 @@ nested collections, such as runs of a given actor.
117117actor_client = apify_client.actor(' john-doe/my-actor' )
118118runs_client = actor_client.runs()
119119# List the last 10 runs of the john-doe/hello-world actor
120- actor_runs = runs_client.list(limit = 10 , desc = True )[ ' items' ]
120+ actor_runs = runs_client.list(limit = 10 , desc = True ). items
121121
122122# Select the last run of the john-doe/hello-world actor that finished with a SUCCEEDED status
123123last_succeeded_run_client = actor_client.last_run(status = ' SUCCEEDED' )
124124# Fetch items from the run's dataset
125- dataset_items = last_succeeded_run_client.dataset().list_items()[ ' items' ]
125+ dataset_items = last_succeeded_run_client.dataset().list_items(). items
126126```
127127
128- > The quick access to ` dataset ` and other storages directly from the run
129- > client can now only be used with the ` last_run() ` method, but the feature
130- > will be available to all runs in the future.
131-
132128### Pagination
133129
134130Most methods named ` list ` or ` list_something ` return a [ ` ListPage ` ] ( #ListPage ) object,
@@ -1108,9 +1104,6 @@ Run status will be updated to RUNNING and its container will be restarted with t
11081104
11091105Get the client for the default dataset of the actor run.
11101106
1111- Currently this works only through actor_client.last_run().dataset().
1112- It will become available for all runs once the API supports it.
1113-
11141107[ https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages ] ( https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages )
11151108
11161109* ** Returns**
@@ -1127,9 +1120,6 @@ It will become available for all runs once the API supports it.
11271120
11281121Get the client for the default key-value store of the actor run.
11291122
1130- Currently this works only through actor_client.last_run().key_value_store().
1131- It will become available for all runs once the API supports it.
1132-
11331123[ https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages ] ( https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages )
11341124
11351125* ** Returns**
@@ -1146,9 +1136,6 @@ It will become available for all runs once the API supports it.
11461136
11471137Get the client for the default request queue of the actor run.
11481138
1149- Currently this works only through actor_client.last_run().request_queue().
1150- It will become available for all runs once the API supports it.
1151-
11521139[ https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages ] ( https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages )
11531140
11541141* ** Returns**
@@ -1165,9 +1152,6 @@ It will become available for all runs once the API supports it.
11651152
11661153Get the client for the log of the actor run.
11671154
1168- Currently this works only through actor_client.last_run().log().
1169- It will become available for all runs once the API supports it.
1170-
11711155[ https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages ] ( https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages )
11721156
11731157* ** Returns**
0 commit comments