SuperAPI AI 工具集

python-executor

编程与开发

查看项目

更新于 10-16 06:48

技能介绍

用途:在安全沙箱环境中执行 Python 代码,返回运行输出与生成文件,适合数据抓取、分析可视化、图像与音视频处理、3D 模型处理、API 调用、PDF 生成及脚本自动化。

主要能力与配置:App ID 为 infsh/python-executor,环境为 Python 3.10(仅 CPU),默认 8GB 内存,可用 high_memory 变体获得 16GB;超时 1-300 秒,默认 30 秒。预装库覆盖 HTTP 抓取(requests、httpx、aiohttp、beautifulsoup4、lxml、selenium、playwright、scrapy)、数据处理(numpy、pandas、scipy、matplotlib、seaborn、plotly)、图像(pillow、opencv-python-headless、scikit-image、imageio)、音视频(moviepy、av、ffmpeg-python、pydub)、3D(trimesh、open3d、numpy-stl、meshio、pyvista)以及文档图形(svgwrite、cairosvg、reportlab、pypdf2)。

使用方式:需先安装 inference.sh CLI(belt)并登录,执行 belt login,再用 belt app run infsh/python-executor --input '{"code":"..."}' 运行;高内存变体用 infsh/python-executor@high_memory。输入 schema 支持 code、timeout、capture_output、working_dir。保存到 outputs/ 的文件会自动随响应返回。

限制:仅 CPU,不含 GPU/ML 库;非交互式,绘图需用 plt.savefig() 而非 plt.show();代码在隔离子进程中安全执行。资料未提供具体收费与价格信息。