You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/01_overview/index.mdx
+13-10Lines changed: 13 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ import CodeBlock from '@theme/CodeBlock';
9
9
10
10
The Apify SDK for Python is the official library for creating [Apify Actors](https://docs.apify.com/platform/actors) in Python.
11
11
12
-
```python
12
+
```py
13
13
from apify import Actor
14
14
from bs4 import BeautifulSoup
15
15
import requests
@@ -37,42 +37,45 @@ pip install apify
37
37
When you create an Actor using the Apify CLI, the Apify SDK for Python is installed for you automatically.
38
38
39
39
If you are not developing Apify Actors and you just need to access the Apify API from Python,
40
-
consider using the [Apify API client for Python](https://docs.apify.com/api/client/python) directly.
40
+
consider using the [Apify API client for Python](/api/client/python) directly.
41
41
42
42
## Quick start
43
43
44
44
### Creating Actors
45
45
46
-
To create and run Actors in Apify Console, refer to the [Console documentation](https://docs.apify.com/academy/getting-started/creating-actors#choose-your-template).
46
+
To create and run Actors in Apify Console, refer to the [Console documentation](/platform/actors/development/quick-start/web-ide).
47
47
48
-
To create a new Apify Actor on your computer, you can use the [Apify CLI](https://docs.apify.com/cli), and select one of the [Python Actor templates](https://apify.com/templates?category=python).
48
+
To create a new Apify Actor on your computer, you can use the [Apify CLI](/cli), and select one of the [Python Actor templates](https://apify.com/templates?category=python).
49
49
50
-
For example, to create an Actor from the "[beta] Python SDK" template, you can use the [`apify create` command](https://docs.apify.com/cli/docs/reference#apify-create-actorname).
50
+
For example, to create an Actor from the "[beta] Python SDK" template, you can use the [`apify create` command](/cli/docs/reference#apify-create-actorname).
This will create a new folder called `my-first-actor`, download and extract the "Getting started with Python" Actor template there, create a virtual environment in `my-first-actor/.venv`, and install the Actor dependencies in it.
57
57
58
-
### Running the Actor
59
-
60
-
To run the Actor, you can use the [`apify run` command](https://docs.apify.com/cli/docs/reference#apify-run):
58
+
#### Running the Actor
61
59
60
+
To run the Actor, you can use the [`apify run` command](/cli/docs/reference#apify-run):
62
61
```bash
63
62
cd my-first-actor
64
63
apify run
65
64
```
66
65
67
-
This will activate the virtual environment in `.venv` (if no other virtual environment is activated yet), then start the Actor, passing the right environment variables for local running, and configure it to use local storages from the `storage` folder.
66
+
This command:
67
+
68
+
- Activates the virtual environment in `.venv` (if no other virtual environment is activated yet)
69
+
- Starts the Actor with the appropriate environment variables for local running
70
+
- Configures it to use local storages from the `storage` folder
68
71
69
72
The Actor input, for example, will be in `storage/key_value_stores/default/INPUT.json`.
70
73
71
74
## Actor structure
72
75
73
76
All Python Actor templates follow the same structure.
74
77
75
-
The `.actor` directory contains the [Actor configuration](https://docs.apify.com/platform/actors/development/actor-config), such as the Actor's definition and input schema, and the Dockerfile necessary to run the Actor on the Apify platform.
78
+
The `.actor` directory contains the [Actor configuration](/platform/actors/development/actor-config), such as the Actor's definition and input schema, and the Dockerfile necessary to run the Actor on the Apify platform.
76
79
77
80
The Actor's runtime dependencies are specified in the `requirements.txt` file, which follows the [standard requirements file format](https://pip.pypa.io/en/stable/reference/requirements-file-format/).
0 commit comments