Table of contents
SDK v2 introduces several important changes:- New creation pattern in Python Synchronous SDK
- Secure by default
- Updated file operations in Python SDK
- Updated list method
Breaking changes
1. Sandbox creation in synchronous Python SDK
In v2, the synchronous Python SDK uses a class methodcreate()
instead of the constructor Sandbox()
.
2. Secure communication by default
Sandboxes are now secure by default. That means you cannot access the sandbox directly via its URL; there’s authentication required. If you use the SDK, this is handled for you automatically. This shouldn’t affect you, but if you need to access sandbox directly without SDK and you are now getting 401, you may need to setsecure
to false
.
If you are using custom code interpreter templates, it may be necessary to rebuild the template to ensure compatibility with secure sandboxes.
3. File writing in Python SDK
The file writing API in Python has been made more consistent. In v2, usesandbox.files.write()
for single files and sandbox.files.write_files()
for multiple files:
write()
method was overloaded for both single and multiple files: