Newshot

Vercel Sandbox Python SDK 1.0 is now available

Summary

The Vercel Sandbox Python SDK has reached 1.0, stabilizing its public API and bringing feature parity with the TypeScript SDK. Use it to run AI-generated code, test changes, and analyze datasets in isolated sandboxes from your Python application. The SDK includes context managers for automatic sandbox cleanup and AnyIO -based async support for asyncio and Trio. For synchronous code, use vercel.sandbox.sync . Install with uv add 'vercel-sandbox>=1.0' and configure authentication . If you’re upgrading from 0.x, review the 1.0 release notes for breaking changes, including the switch to bytes for command input and output. Learn more in the Python SDK documentation . Read more

Original text(via Vercel Blog)
题图
题图

The Vercel Sandbox Python SDK has reached 1.0, stabilizing its public API and bringing feature parity with the TypeScript SDK. Use it to run AI-generated code, test changes, and analyze datasets in isolated sandboxes from your Python application.

The SDK includes context managers for automatic sandbox cleanup and AnyIO-based async support for asyncio and Trio. For synchronous code, use vercel.sandbox.sync.

Install with uv add 'vercel-sandbox>=1.0' and configure authentication.


        import asyncio
from vercel import sandboxfrom vercel.sandbox import GitSource
async def main():    async with sandbox.create_sandbox(        source=GitSource(            url="https://github.com/your-org/your-repo.git",            revision="your-pr-branch",        )    ) as box:        await box.run_command(            "uv",            ["run", "pytest", "-q"],            check=True,        )
asyncio.run(main())
      

Run tests from a Git branch, then automatically clean up the sandbox.

If you’re upgrading from 0.x, review the 1.0 release notes for breaking changes, including the switch to bytes for command input and output.

Learn more in the Python SDK documentation.

The text above was extracted automatically from the source page and may miss images, tables or code blocks. The original is authoritative.

Published by Vercel Blog
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗