经 AI Skill Hub 精选评估,Apify Python SDK 获评「强烈推荐」。这款Agent工作流在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.0 分,适合有一定技术背景的用户使用。
构建服务器端Apify Actor的官方Python库,实现工作流自动化
Apify Python SDK 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
构建服务器端Apify Actor的官方Python库,实现工作流自动化
Apify Python SDK 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:pip 安装(推荐)
pip install apify-sdk-python
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install apify-sdk-python
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/apify/apify-sdk-python
cd apify-sdk-python
pip install -e .
# 验证安装
python -c "import apify_sdk_python; print('安装成功')"
# 命令行使用
apify-sdk-python --help
# 基本用法
apify-sdk-python input_file -o output_file
# Python 代码中调用
import apify_sdk_python
# 示例
result = apify_sdk_python.process("input")
print(result)
# apify-sdk-python 配置文件示例(config.yml) app: name: "apify-sdk-python" debug: false log_level: "INFO" # 运行时指定配置文件 apify-sdk-python --config config.yml # 或通过环境变量配置 export APIFY_SDK_PYTHON_API_KEY="your-key" export APIFY_SDK_PYTHON_OUTPUT_DIR="./output"
<p align="center"> <strong>The official Python SDK for building <a href="https://docs.apify.com/platform/actors">Apify Actors</a>.</strong> </p>
<p align="center"> <a href="https://pypi.org/project/apify/"><img src="https://badge.fury.io/py/apify.svg" alt="PyPI version"></a> <a href="https://pypi.org/project/apify/"><img src="https://img.shields.io/pypi/dm/apify" alt="PyPI downloads"></a> <a href="https://pypi.org/project/apify/"><img src="https://img.shields.io/badge/python-3.11%2B-blue" alt="Python versions"></a> <a href="https://github.com/apify/apify-sdk-python/actions/workflows/on_master.yaml"><img src="https://github.com/apify/apify-sdk-python/actions/workflows/on_master.yaml/badge.svg?branch=master" alt="Build status"></a> <a href="https://codecov.io/gh/apify/apify-sdk-python"><img src="https://codecov.io/gh/apify/apify-sdk-python/graph/badge.svg?token=Y6JBIZQFT6" alt="Coverage"></a> <a href="https://github.com/apify/apify-sdk-python/blob/master/LICENSE"><img src="https://img.shields.io/pypi/l/apify" alt="License"></a> <a href="https://discord.gg/jyEM2PRvMU"><img src="https://img.shields.io/discord/801163717915574323?label=discord" alt="Chat on Discord"></a> </p>
apify is the official SDK for building Apify Actors in Python. It handles the Actor lifecycle, storage access, platform events, Apify Proxy, pay-per-event charging, and more.
If you only need to consume the Apify API from Python (running Actors, reading datasets, managing storages) rather than building Actors, use the Apify API client for Python instead. It comes bundled with this SDK.
async with Actor:, covering init, exit, failures, status messages, and reboots (Actor lifecycle).Actor.get_input() (Actor input).ApifyClient (Accessing the Apify API).The Apify SDK for Python requires Python 3.11 or higher. It is published on PyPI as the apify package and can be installed with pip:
pip install apify
or with uv:
uv add apify
To use the Scrapy integration, install the scrapy extra:
pip install 'apify[scrapy]'
Almost any Python project can become an Actor, including projects for:
Whatever you build, the Apify SDK doesn't lock you into a particular framework. Bring the libraries you already use, and let Apify run your project in the cloud.
An Actor is a Python program that runs inside the async with Actor: context. The context initializes the Actor when it starts and tears it down when it finishes. Here's a minimal Actor that reads its input and stores a result:
from apify import Actor
async def main() -> None:
async with Actor:
actor_input = await Actor.get_input()
Actor.log.info('Actor input: %s', actor_input)
await Actor.set_value('OUTPUT', 'Hello, world!')
The quickest way to scaffold a full Actor project, with the .actor configuration, input schema, and Dockerfile already in place, is the Apify CLI:
npm install -g apify-cli
apify create my-actor --template python-start
cd my-actor
apify run
To create, run, and deploy your first Actor step by step, see the Quick start guide.
The examples below show two common setups, but the same async with Actor: pattern works with any stack. For more, see the guides.
高质量的Python库,实现Apify Actor的构建和工作流自动化
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
AI Skill Hub 点评:Apify Python SDK 的核心功能完整,质量优秀。对于自动化工程师和运维人员来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | apify-sdk-python |
| 原始描述 | 开源AI工作流:Apify SDK for Python—The official library for building Apify Actors: serverless 。⭐169 · Python |
| Topics | apifyactorautomationcrawleedata-extraction |
| GitHub | https://github.com/apify/apify-sdk-python |
| License | Apache-2.0 |
| 语言 | Python |
收录时间:2026-06-05 · 更新时间:2026-06-05 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端