{"id":34530907,"url":"https://github.com/ucloud/ucloud-sandbox-sdk-python","last_synced_at":"2026-04-01T18:04:19.162Z","repository":{"id":328268186,"uuid":"1114866181","full_name":"ucloud/ucloud-sandbox-sdk-python","owner":"ucloud","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-18T09:52:41.000Z","size":271,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-19T01:07:14.540Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ucloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-12T02:15:41.000Z","updated_at":"2026-03-18T09:52:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ucloud/ucloud-sandbox-sdk-python","commit_stats":null,"previous_names":["ucloud/ucloud-sandbox-sdk-python"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/ucloud/ucloud-sandbox-sdk-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucloud%2Fucloud-sandbox-sdk-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucloud%2Fucloud-sandbox-sdk-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucloud%2Fucloud-sandbox-sdk-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucloud%2Fucloud-sandbox-sdk-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ucloud","download_url":"https://codeload.github.com/ucloud/ucloud-sandbox-sdk-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucloud%2Fucloud-sandbox-sdk-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-24T05:37:06.399Z","updated_at":"2026-04-01T18:04:19.152Z","avatar_url":"https://github.com/ucloud.png","language":"Python","readme":"# UCloud Sandbox Python SDK\n\nUCloud Sandbox Python SDK 提供云端沙箱环境，用于安全运行 AI 生成的代码。\n\n## 安装\n\n```bash\npip install ucloud_sandbox\n```\n\n## 快速开始\n\n### 1. 获取 API Key\n\n1. 访问 [UCloud Sandbox](https://sandbox.ucloudai.com) 注册账号\n2. 在控制台获取 API Key\n3. 设置环境变量：\n\n```bash\nexport UCLOUD_SANDBOX_API_KEY=your_api_key\n```\n\n### 2. 基础沙箱\n\n```python\nfrom ucloud_sandbox import Sandbox\n\nwith Sandbox.create() as sandbox:\n    result = sandbox.commands.run(\"echo 'Hello, World!'\")\n    print(result.stdout)\n```\n\n### 3. Code Interpreter（代码解释器）\n\n支持有状态的代码执行，变量在多次调用之间保持：\n\n```python\nfrom ucloud_sandbox.code_interpreter import Sandbox\n\nwith Sandbox.create() as sandbox:\n    sandbox.run_code(\"x = 1\")\n    execution = sandbox.run_code(\"x += 1; print(x)\")\n    print(execution.logs.stdout)  # ['2']\n```\n\n### 4. Desktop（桌面环境）\n\n支持鼠标键盘控制、截图、VNC 流媒体：\n\n```python\nfrom ucloud_sandbox.desktop import Sandbox\n\ndesktop = Sandbox.create()\n\n# 截图\nscreenshot = desktop.screenshot()\n\n# 鼠标操作\ndesktop.left_click(100, 200)\ndesktop.write(\"Hello, World!\")\n\n# VNC 流\ndesktop.stream.start()\nprint(desktop.stream.get_url())\n\ndesktop.kill()\n```\n\n## 文档\n访问 [Sandbox 文档](https://github.com/UCloudDoc-Team/agent-sandbox) 获取更多信息。\n\n## 致谢\n\n本项目基于 [E2B](https://github.com/e2b-dev/e2b) 开源项目开发，感谢 E2B 团队的贡献。\n\n## 许可证\n\nMIT License - 详见 [LICENSE](./LICENSE) 文件\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucloud%2Fucloud-sandbox-sdk-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fucloud%2Fucloud-sandbox-sdk-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucloud%2Fucloud-sandbox-sdk-python/lists"}