Skip to main content

fcvm for Python

A client for the HTTP API of fcvm, which runs disposable, isolated Firecracker microVMs with container ergonomics. Use it to give an agent framework, a test harness or a build pipeline real VM sandboxes: create one from any OCI image, run commands, move files, snapshot it and fork running copies in about 150 ms.

The client has no dependencies and needs Python 3.9 or newer. The VMs run on a Linux host with KVM where fcvm is installed; the client itself runs anywhere that can reach that host's API.

pip install fcvm
from fcvm import Client

c = Client()
with c.create("box", template="python-sandbox", ttl="1h") as sb:      # removed when the block ends
    out = sb.run("pip install -q requests && python -c 'import requests; print(requests.__version__)'")
    sb.write_file("/work/app.py", "print('hi')\n")
    print(sb.exec("python /work/app.py").stdout)                      # ExecResult: exit_code, stdout, stderr
    job = sb.exec("python -m http.server 8000", background=True)      # a Job
    port = sb.publish(8000)                                           # http://127.0.0.1:{port} on the host
    job.kill()

snap = c.sandbox("prepared").snapshot("ready")
forks = snap.fork("try", count=3)                                     # three running Sandbox objects

Client() finds the local fcvm service by itself. For another host, set FCVM_URL and FCVM_TOKEN. The token gives full control of fcvm, so treat it like an SSH key.

Apache License 2.0.

Metadata

Release files for fcvm 0.12.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fcvm 0.12.1
File Size Uploaded Provenance Actions
fcvm-0.12.1.tar.gz 11.6 kB Without provenance Details for fcvm-0.12.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fcvm 0.12.1
File Interpreter ABI Platform Actions
fcvm-0.12.1-py3-none-any.whl Python 3 none any Details for fcvm-0.12.1-py3-none-any.whl

Total release size: 23.7 kB

Release files / fcvm-0.12.1.tar.gz

Download URL fcvm-0.12.1.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0372c52fc262c7f9a9e85e8bbe6e097879233e5b5a45f77dea49c860a9a49032
BLAKE2b-256 checksum
How to use checksums
11c048e3bc6d5d3c2ec33317fc5b8335dd04348210ee1da8bb0f61e03f3e765f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / fcvm-0.12.1-py3-none-any.whl

Download URL fcvm-0.12.1-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7dcef16bf3485d8af0bb1df32552107df089ae32bf9b41406d3095a5f42ba71
BLAKE2b-256 checksum
How to use checksums
6434da5e787492862e0f59c29c7b71e62f40aeba1f98b629e0a6164453efd853
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for fcvm 0.12.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page