Skip to content

Commit

Permalink
Fix checking docs building on Ubuntu runners, rebuild docs (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
fnesveda authored May 17, 2021
1 parent 98d8c06 commit 3d87e77
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 28 deletions.
36 changes: 10 additions & 26 deletions docs/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ It provides useful features like automatic retries and convenience functions tha

Requires Python 3.7+

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).
To do that, run `pip install git+https://github.com/apify/apify-client-python.git`
You can install the client from its [PyPI listing](https://pypi.org/project/apify-client/).
To do that, simply run `pip install apify-client`.

## Quick Start

Expand All @@ -31,7 +31,7 @@ apify_client = ApifyClient('MY-APIFY-TOKEN')
actor_call = apify_client.actor('john-doe/my-cool-actor').call()

# Fetch results from the actor's default dataset
dataset_items = apify_client.dataset(actor_call['defaultDatasetId']).list_items()['items']
dataset_items = apify_client.dataset(actor_call['defaultDatasetId']).list_items().items
```

## Features
Expand Down Expand Up @@ -74,16 +74,16 @@ 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
my_actor = actor_collection_client.create({ name: 'my-actor' })
my_actor = actor_collection_client.create(name='my-actor')
# List all of your actors
actor_list = actor_collection_client.list()['items']
actor_list = actor_collection_client.list().items
```

```python
# Collection clients do not require a parameter
dataset_collection_client = apify_client.datasets()
# Get (or create, if it doesn't exist) a dataset with the name of my-dataset
my_dataset = dataset_collection_client.get_or_create('my-dataset')
my_dataset = dataset_collection_client.get_or_create(name='my-dataset')
```

```python
Expand All @@ -92,14 +92,14 @@ actor_client = apify_client.actor('john-doe/my-actor')
# Fetch the john-doe/my-actor object from the API
my_actor = actor_client.get()
# Start the run of john-doe/my-actor and return the Run object
my_actor_run = actor_client.start();
my_actor_run = actor_client.start()
```

```python
# Resource clients accept an ID of the resource
dataset_client = apify_client.dataset('john-doe/my-dataset')
# Append items to the end of john-doe/my-dataset
dataset_client.push_items([{ "foo": 1 }, { "bar": 2 }])
dataset_client.push_items([{ 'foo': 1 }, { 'bar': 2 }])
```

> The ID of the resource can be either the `id` of the said resource,
Expand All @@ -117,18 +117,14 @@ nested collections, such as runs of a given actor.
actor_client = apify_client.actor('john-doe/my-actor')
runs_client = actor_client.runs()
# List the last 10 runs of the john-doe/hello-world actor
actor_runs = runs_client.list(limit=10, desc=True)['items']
actor_runs = runs_client.list(limit=10, desc=True).items

# Select the last run of the john-doe/hello-world actor that finished with a SUCCEEDED status
last_succeeded_run_client = actor_client.last_run(status='SUCCEEDED')
# Fetch items from the run's dataset
dataset_items = last_succeeded_run_client.dataset().list_items()['items']
dataset_items = last_succeeded_run_client.dataset().list_items().items
```

> The quick access to `dataset` and other storages directly from the run
> client can now only be used with the `last_run()` method, but the feature
> will be available to all runs in the future.
### Pagination

Most methods named `list` or `list_something` return a [`ListPage`](#ListPage) object,
Expand Down Expand Up @@ -1108,9 +1104,6 @@ Run status will be updated to RUNNING and its container will be restarted with t

Get the client for the default dataset of the actor run.

Currently this works only through actor_client.last_run().dataset().
It will become available for all runs once the API supports it.

[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)

* **Returns**
Expand All @@ -1127,9 +1120,6 @@ It will become available for all runs once the API supports it.

Get the client for the default key-value store of the actor run.

Currently this works only through actor_client.last_run().key_value_store().
It will become available for all runs once the API supports it.

[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)

* **Returns**
Expand All @@ -1146,9 +1136,6 @@ It will become available for all runs once the API supports it.

Get the client for the default request queue of the actor run.

Currently this works only through actor_client.last_run().request_queue().
It will become available for all runs once the API supports it.

[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)

* **Returns**
Expand All @@ -1165,9 +1152,6 @@ It will become available for all runs once the API supports it.

Get the client for the log of the actor run.

Currently this works only through actor_client.last_run().log().
It will become available for all runs once the API supports it.

[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)

* **Returns**
Expand Down
4 changes: 2 additions & 2 deletions docs/res/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ cd "$( dirname "${BASH_SOURCE[0]}" )"


mv ../docs.md ../old_docs.md
OLD_MD5=$(md5 -q ../old_docs.md)
OLD_MD5=$(md5sum ../old_docs.md | cut -f 1 -d " ")

./build.sh
BUILD_STATUS=$?

NEW_MD5=$(md5 -q ../docs.md)
NEW_MD5=$(md5sum ../docs.md | cut -f 1 -d " ")
mv ../old_docs.md ../docs.md


Expand Down

0 comments on commit 3d87e77

Please sign in to comment.