Skip to content

Commit 2ed03ca

Browse files
docs: Revert documentation restructure (#763)
## Summary This PR reverts commit 89c0358 which restructured the documentation by splitting the overview page into three separate pages. ## Changes - Restores the original single overview page structure - Moves the webserver guide back from guides to concepts section - Renumbers concept pages back to their original order - Removes the separate introduction and installation pages ## Reason for revert [Add reason here] 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent aa0fa9d commit 2ed03ca

26 files changed

+79
-128
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ To create and run Actors through Apify Console,
159159
see the [Console documentation](https://docs.apify.com/academy/getting-started/creating-actors#choose-your-template).
160160

161161
To create and run Python Actors locally, check the documentation for
162-
[how to create and run Python Actors locally](https://docs.apify.com/sdk/python/docs/quick-start).
162+
[how to create and run Python Actors locally](https://docs.apify.com/sdk/python/docs/overview/running-locally).
163163

164164
## Guides
165165

docs/01_introduction/index.mdx

Lines changed: 0 additions & 45 deletions
This file was deleted.

docs/01_introduction/installation.mdx

Lines changed: 0 additions & 51 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 65 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,47 @@
11
---
2-
title: Quick start
3-
sidebar_label: Quick start
4-
description: 'Get started with the Apify SDK for Python by creating your first Actor and learning the basics.'
5-
---
6-
7-
Learn how to create and run Actors using the Apify SDK for Python.
8-
2+
title: Overview
3+
sidebar_label: Overview
94
---
105

116
import Tabs from '@theme/Tabs';
127
import TabItem from '@theme/TabItem';
138
import CodeBlock from '@theme/CodeBlock';
149

15-
## Step 1: Creating Actors
10+
The Apify SDK for Python is the official library for creating [Apify Actors](https://docs.apify.com/platform/actors) in Python.
11+
12+
```py
13+
from apify import Actor
14+
from bs4 import BeautifulSoup
15+
import requests
16+
17+
async def main():
18+
async with Actor:
19+
input = await Actor.get_input()
20+
response = requests.get(input['url'])
21+
soup = BeautifulSoup(response.content, 'html.parser')
22+
await Actor.push_data({ 'url': input['url'], 'title': soup.title.string })
23+
```
24+
25+
## Requirements
26+
27+
The Apify SDK requires Python version 3.10 or above to run Python Actors locally.
28+
29+
## Installation
30+
31+
The Apify Python SDK is available as [`apify`](https://pypi.org/project/apify/) package on PyPi. To install it, run:
32+
33+
```bash
34+
pip install apify
35+
```
36+
37+
When you create an Actor using the Apify CLI, the Apify SDK for Python is installed for you automatically.
38+
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](/api/client/python) directly.
41+
42+
## Quick start
43+
44+
### Creating Actors
1645

1746
To create and run Actors in Apify Console, refer to the [Console documentation](/platform/actors/development/quick-start/web-ide).
1847

@@ -26,9 +55,9 @@ apify create my-first-actor --template python-start
2655

2756
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.
2857

29-
![actor create command run](./images/apify-create.gif)
58+
![actor create command run](../01_overview/images/apify-create.gif)
3059

31-
## Step 2: Running the Actor
60+
#### Running the Actor
3261

3362
To run the Actor, you can use the [`apify run` command](/cli/docs/reference#apify-run):
3463

@@ -45,7 +74,7 @@ This command:
4574

4675
The Actor input, for example, will be in `storage/key_value_stores/default/INPUT.json`.
4776

48-
## Step 3: Understanding Actor structure
77+
## Actor structure
4978

5079
All Python Actor templates follow the same structure.
5180

@@ -93,6 +122,31 @@ asyncio.run(main())`
93122
If you want to modify the Actor structure, you need to make sure that your Actor is executable as a module, via `python -m src`, as that is the command started by `apify run` in the Apify CLI.
94123
We recommend keeping the entrypoint for the Actor in the `src/__main__.py` file.
95124

125+
## Adding dependencies
126+
127+
First, add the dependencies in the [`requirements.txt`](https://pip.pypa.io/en/stable/reference/requirements-file-format/) file in the Actor source folder.
128+
129+
Then activate the virtual environment in `.venv`:
130+
131+
<Tabs groupId="operating-systems">
132+
<TabItem value="unix" label="Linux / macOS" default>
133+
<CodeBlock language="bash">{
134+
`source .venv/bin/activate`
135+
}</CodeBlock>
136+
</TabItem>
137+
<TabItem value="win" label="Windows">
138+
<CodeBlock language="powershell">{
139+
`.venv\\Scripts\\activate`
140+
}</CodeBlock>
141+
</TabItem>
142+
</Tabs>
143+
144+
Finally, install the dependencies:
145+
146+
```bash
147+
python -m pip install -r requirements.txt
148+
```
149+
96150
## Next steps
97151

98152
### Guides

0 commit comments

Comments
 (0)