Execute Python code in a safe sandboxed environment via [inference.sh](https://inference.sh). Pre-installed: NumPy, Pandas, Matplotlib, requests, BeautifulSo...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install python-executor或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install python-executor⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/python-executor/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: python-executor description: "Execute Python code in a safe sandboxed environment via inference.sh. Pre-installed: NumPy, Pandas, Matplotlib, requests, BeautifulSoup, Selenium, Playwright, MoviePy, Pillow, OpenCV, trimesh, and 100+ more libraries. Use for: data processing, web scraping, image manipulation, video creation, 3D model processing, PDF generation, API calls, automation scripts. Triggers: python, execute code, run script, web scraping, data analysis, image processing, video editing, 3D models, automation, pandas, matplotlib" allowed-tools: Bash(infsh *) ---
Execute Python code in a safe, sandboxed environment with 100+ pre-installed libraries.
curl -fsSL https://cli.inference.sh | sh && infsh login
# Run Python code
infsh app run infsh/python-executor --input '{
"code": "import pandas as pd\nprint(pd.__version__)"
}'
> Install note: The install script only detects your OS/architecture, downloads the matching binary from dist.inference.sh, and verifies its SHA-256 checksum. No elevated permissions or background processes. Manual install & verification available.
| Property | Value | |----------|-------| | App ID | infsh/python-executor | | Environment | Python 3.10, CPU-only | | RAM | 8GB (default) / 16GB (high_memory) | | Timeout | 1-300 seconds (default: 30) |
{
"code": "print('Hello World!')",
"timeout": 30,
"capture_output": true,
"working_dir": null
}
requests, httpx, aiohttp - HTTP clientsbeautifulsoup4, lxml - HTML/XML parsingselenium, playwright - Browser automationscrapy - Web scraping frameworknumpy, pandas, scipy - Numerical computingmatplotlib, seaborn, plotly - Visualizationpillow, opencv-python-headless - Image manipulationscikit-image, imageio - Image algorithmsmoviepy - Video editingav (PyAV), ffmpeg-python - Video processingpydub - Audio manipulationtrimesh, open3d - 3D mesh processingnumpy-stl, meshio, pyvista - 3D file formatssvgwrite, cairosvg - SVG creationreportlab, pypdf2 - PDF generationinfsh app run infsh/python-executor --input '{
"code": "import requests\nfrom bs4 import BeautifulSoup\n\nresponse = requests.get(\"https://example.com\")\nsoup = BeautifulSoup(response.content, \"html.parser\")\nprint(soup.find(\"title\").text)"
}'
infsh app run infsh/python-executor --input '{
"code": "import pandas as pd\nimport matplotlib.pyplot as plt\n\ndata = {\"name\": [\"Alice\", \"Bob\"], \"sales\": [100, 150]}\ndf = pd.DataFrame(data)\n\nplt.bar(df[\"name\"], df[\"sales\"])\nplt.savefig(\"outputs/chart.png\")\nprint(\"Chart saved!\")"
}'
infsh app run infsh/python-executor --input '{
"code": "from PIL import Image\nimport numpy as np\n\n# Create gradient image\narr = np.linspace(0, 255, 256*256, dtype=np.uint8).reshape(256, 256)\nimg = Image.fromarray(arr, mode=\"L\")\nimg.save(\"outputs/gradient.png\")\nprint(\"Image created!\")"
}'
infsh app run infsh/python-executor --input '{
"code": "from moviepy.editor import ColorClip, TextClip, CompositeVideoClip\n\nclip = ColorClip(size=(640, 480), color=(0, 100, 200), duration=3)\ntxt = TextClip(\"Hello!\", fontsize=70, color=\"white\").set_position(\"center\").set_duration(3)\nvideo = CompositeVideoClip([clip, txt])\nvideo.write_videofile(\"outputs/hello.mp4\", fps=24)\nprint(\"Video created!\")",
"timeout": 120
}'
infsh app run infsh/python-executor --input '{
"code": "import trimesh\n\nsphere = trimesh.creation.icosphere(subdivisions=3, radius=1.0)\nsphere.export(\"outputs/sphere.stl\")\nprint(f\"Created sphere with {len(sphere.vertices)} vertices\")"
}'
infsh app run infsh/python-executor --input '{
"code": "import requests\nimport json\n\nresponse = requests.get(\"https://api.github.com/users/octocat\")\ndata = response.json()\nprint(json.dumps(data, indent=2))"
}'
Files saved to outputs/ are automatically returned:
# These files will be in the response
plt.savefig('outputs/chart.png')
df.to_csv('outputs/data.csv')
video.write_videofile('outputs/video.mp4')
mesh.export('outputs/model.stl')
# Default (8GB RAM)
infsh app run infsh/python-executor --input input.json
# High memory (16GB RAM) for large datasets
infsh app run infsh/python-executor@high_memory --input input.json
plt.savefig() not plt.show()# AI image generation (for ML-based images)
npx skills add inference-sh/skills@ai-image-generation
# AI video generation (for ML-based videos)
npx skills add inference-sh/skills@ai-video-generation
# LLM models (for text generation)
npx skills add inference-sh/skills@llm-models
安装 Python Executor 后,可以对 AI 说这些话来触发它
Help me get started with Python Executor
Explains what Python Executor does, walks through the setup, and runs a quick demo based on your current project
Use Python Executor to execute Python code in a safe sandboxed environment via [inference
Invokes Python Executor with the right parameters and returns the result directly in the conversation
What can I do with Python Executor in my data & analytics workflow?
Lists the top use cases for Python Executor, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/python-executor/ 目录(个人级,所有项目可用),或 .claude/skills/python-executor/(项目级)。重启 AI 客户端后,用 /python-executor 主动调用,或让 AI 根据上下文自动发现并使用。
Python Executor 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Python Executor 可免费安装使用。请查阅仓库了解许可证信息。
Execute Python code in a safe sandboxed environment via [inference.sh](https://inference.sh). Pre-installed: NumPy, Pandas, Matplotlib, requests, BeautifulSo...
Python Executor 属于「Data & Analytics」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my data & analytics tasks using Python Executor
Identifies repetitive steps in your workflow and sets up Python Executor to handle them automatically