SuperAPI AI 工具集

python-executor

编程与开发

查看项目

更新于 10-16 05:48

技能介绍

python-executor 用于在安全沙箱中执行 Python 代码,通过 inference.sh 提供的 app 运行。先安装 belt CLI:npx skills add belt-sh/cli,再执行 belt login 登录。运行命令为 belt app run infsh/python-executor --input '{"code": "..."}'。应用 ID 为 infsh/python-executor,环境为 Python 3.10、仅 CPU,默认 8GB 内存,可选 16GB(high_memory),超时 1-300 秒,默认 30 秒。输入字段包括 code、timeout、capture_output、working_dir。预装库覆盖 HTTP 与网页抓取(requests、httpx、aiohttp、beautifulsoup4、lxml、selenium、playwright、scrapy)、数据处理(numpy、pandas、scipy)、可视化(matplotlib、seaborn、plotly)、图像(pillow、opencv-python-headless、scikit-image、imageio)、视频与音频(moviepy、PyAV、ffmpeg-python、pydub)、3D(trimesh、open3d、numpy-stl、meshio、pyvista)、文档与图形(svgwrite、cairosvg、reportlab、pypdf2)。保存到 outputs/ 的文件会自动返回,可用于图表、CSV、视频、模型等。适用场景包括网页抓取、数据分析、图像处理、视频创建、3D 处理、API 调用、PDF 生成和自动化脚本。限制:仅 CPU,无 GPU/ML 库;非交互式,须用 plt.savefig() 而非 plt.show();运行在隔离子进程中。高内存版本使用 infsh/python-executor@high_memory。付费、价格与更多平台细节暂未提供。