Corevelos Python SDK
Official Python SDK for Corevelos — manage fast and secure VMs, commands, files, terminals, and more.
- Website: https://corevelos.com
- Console: https://app.corevelos.com
- Documentation: https://corevelos.com/docs/sdk-cli
- Source: https://github.com/Corevelos/corevelos-sdk-python
Installation
Requires Python 3.10 or later.
pip install corevelos
From a local source checkout:
python -m pip install ".[dev]"
python -m pytest
Authentication
Create an API key in the Corevelos Console and export it in your environment:
export COREVELOS_API_KEY="cv_your_project_key"
By default, the SDK connects to https://api.corevelos.com. For another trusted deployment, set COREVELOS_API_URL or pass api_base_url / api_key directly to CorevelosClient or Sandbox.create.
Quickstart
from corevelos import Sandbox
sandbox = Sandbox.create(template="corevelos-base", timeout_seconds=300)
try:
result = sandbox.commands.run("python3 --version")
print(result["exitCode"], result["stdout"])
finally:
sandbox.kill()
Working with Files & Code
from corevelos import Sandbox
sandbox = Sandbox.create()
try:
# Text and binary file I/O
sandbox.files.write("/workspace/hello.txt", "hello corevelos\n")
print(sandbox.files.read("/workspace/hello.txt"))
sandbox.files.write_bytes("/workspace/data.bin", b"\x00\x01\x02")
raw = sandbox.files.read_bytes("/workspace/data.bin")
entries = sandbox.files.list("/workspace")
# Stateful code execution kernel
execution = sandbox.run_code("x = 21 * 2\nx")
print(execution["results"])
finally:
sandbox.kill()
Background Processes & Terminals (PTY)
pid = sandbox.commands.run_in_background("echo starting && sleep 1 && echo done")
for event in sandbox.commands.stream_output(pid):
print(event["type"], event)
session = sandbox.pty.connect(
on_data=lambda chunk: print(chunk.decode(errors="replace"), end=""),
cols=80,
rows=24,
)
session.ready.wait(timeout=10)
session.input(b"ls -la\n")
session.close()
Lifecycle, Snapshots & Preview URLs
- Lifecycle:
sandbox.pause(),sandbox.resume(),sandbox.refresh(),sandbox.set_timeout(...),sandbox.fork(),sandbox.kill() - Snapshots:
snap = sandbox.create_snapshot(name="checkpoint"),sandbox.rollback(snap["snapshotId"]) - Preview URLs:
sandbox.get_preview_url(3000, path="/")andsandbox.get_preview_info() - Observability & Cost:
sandbox.get_metrics(),sandbox.get_logs(),sandbox.get_cost()
Platform & Account Surfaces
from corevelos import (
Billing,
CorevelosClient,
Keys,
Schedules,
Snapshots,
Templates,
Volumes,
Webhooks,
get_health,
)
print(get_health()) # unauthenticated health check
client = CorevelosClient() # uses COREVELOS_API_KEY and COREVELOS_API_URL
templates = Templates(client).list()
volumes = Volumes(client).list()
snapshots = Snapshots(client).list()
usage = Billing(client).get_estimate()
corevelos also exports verify_webhook_signature(...) for verifying x-corevelos-signature webhook deliveries.
Error Handling
from corevelos import CorevelosApiError, CorevelosContractError, Sandbox
try:
sandbox = Sandbox.create()
except CorevelosApiError as err:
print(err.status, err.code, str(err))
except CorevelosContractError as err:
print(err.path, err.missing)
E2B Migration Compatibility
For migrating existing @e2b/code-interpreter / e2b Python integrations, corevelos.e2b provides compatible Sandbox, CodeInterpreter, and wait_for_timeout wrappers backed by the Corevelos control plane.
Related Packages
- TypeScript SDK:
npm install @corevelos/sdk - CLI:
npm install -g @corevelos/cli - MCP Server:
npx -y @corevelos/mcp-server
Sandbox creation consumes account resources. Always delete disposable sandboxes and snapshots when finished.
Apache-2.0. Community support is best effort. See SECURITY.md to report vulnerabilities privately.
Metadata
Release files for corevelos 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| corevelos-1.0.1.tar.gz | 35.7 kB | With provenance | Details for corevelos-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| corevelos-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for corevelos-1.0.1-py3-none-any.whl |
Total release size: 74.4 kB
Release files / corevelos-1.0.1.tar.gz
| Download URL | corevelos-1.0.1.tar.gz |
|---|---|
| Size | 35.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9959f66a77fa802287c2b77115461393f92be684f34cb8cd5f895ea79a8d99ee
|
|
BLAKE2b-256 checksum How to use checksums |
203f8b8d375dce78a58c2d22500d617cf9117c612a68634f9dce8706dfd9d48e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.
Transparency logRelease files / corevelos-1.0.1-py3-none-any.whl
| Download URL | corevelos-1.0.1-py3-none-any.whl |
|---|---|
| Size | 38.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a7cb5d6f4aa3010339e57a704b18224eab749ac7569ac8b60a22169b22467f73
|
|
BLAKE2b-256 checksum How to use checksums |
36704e72ab286d0dba524c749be48c65ed82744ae4ef6bfca8185d8c5f0942a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.
Transparency logSecurity for corevelos 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for corevelos-1.0.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.