libdeno Python API
This is a private alpha Python binding for the Rust libdeno runtime. The
Python distribution and core Rust crate are both versioned at 0.3.4. The
contract is deliberately small, synchronous, and fail-closed:
import libdeno
exit_code = libdeno.run(
"entry.js",
permissions=("--allow-read=.",),
args=("app-arg",),
)
runtime = libdeno.Runtime(cwd=None)
exit_code = runtime.run("entry.js", allow_all_permissions=True)
run() and Runtime.run() block until the script and its event loop finish and
return an integer exit code. The native call releases the Python GIL while the
Rust runtime executes. Runtime reuses its resolver stack while permissions,
module graphs, and isolates remain per run.
entry and cwd accept str, bytes, and os.PathLike values, including
non-ASCII paths. cwd=None (or an omitted cwd) means the process current
directory. For Runtime, that directory is fixed when the object is created;
the process cwd is never changed. Options after entry are keyword-only.
The Python binding does not expose output capture, async APIs, subprocess helpers, or permission hooks. Script-level Deno APIs still follow the Rust runtime's permission model.
Options and limits
permissionscontains CLI-style--allow-*capability strings. An empty sequence is rejected withConfigurationErrorunlessallow_all_permissions=Trueis explicit.-A/--allow-allis equivalent.argsare exposed throughprocess.argv;featuresoptionally selects valid Deno unstable feature names.Nonekeeps the runtime defaults.execution_deadlineis a finite, non-negative number of seconds. A busy JavaScript run normally raisesDenoTimeoutErrorwhen the deadline fires, but this is best effort: blocking system calls, native code, and blocked permission paths can make a run exceed it.max_heap_bytesis an optional V8 old-generation constraint. Values below 8 MiB are rejected withConfigurationError; the value does not cap native allocations, external memory, host memory, RSS, CPU, or child processes. It is not an OS/process isolation boundary.- HTTP body limits apply to reqwest-returned, transport-decoded response-body
bytes, not wire bytes; upstream decoding may allocate before the limit is
checked. The explicit npm
.tgzpath has the same 1 GiB response-body cap. For a gzip response, the final four body bytes are checked as anISIZEhint (the final member's size modulo 2^32); this threshold is not a decompressed- output budget and does not identify the first consumed member or total extraction. Fallback extraction has no hard output budget, so this is not a decompression or RSS cap.
Exceptions
The facade exports LibdenoError and these subclasses:
EntryError— entry resolution failed.DenoPermissionError— invalid permission flags or denials carrying typed Rust permission provenance. JavaScript exception names/classes/causes are not trusted as denial evidence; a JS failure, including a denial whose typed provenance was lost, is reported asDenoRuntimeError.ConfigurationError— options cannot form a valid run, including empty permissions without an explicit opt-in, invalid deadlines, or an undersized heap value.DenoRuntimeError— runtime startup or JavaScript failure.DenoIOError— host filesystem/I/O failure.DenoTimeoutError— the runtime reported an execution deadline timeout.
Build and install a wheel
Use a virtual environment rather than installing build tools globally:
cd python
python -m venv .venv
. .venv/bin/activate
python -m pip install "maturin>=1.11,<2"
./build-wheel.sh
python -m pip install target/wheels/*.whl
cd ..
python -m unittest discover -s python/tests -p 'test_*.py'
The wheel uses the Python 3.9 stable ABI and targets Python 3.9+. The build
script clears RUSTC_WRAPPER, resolves the active compiler dynamically, and
uses Cargo's locked dependency resolution. The activation command above uses
POSIX shell syntax; this build script requires Bash.
Run the stdlib test suite after installing the wheel from the repository root,
so the source package does not shadow the installed package. Keep the same
virtual environment activated so python refers to its interpreter.
Not supported yet
- Prompting and permission hooks.
- Output capture, async APIs, and subprocess execution.
- Python-facing permission/options objects beyond the keyword arguments above.
- Native addons.
- Source distributions (
sdist); this prototype only defines a wheel build path. - A stable public contract; this is a private alpha API and may change without notice.
Metadata
Release files for libdeno 0.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| libdeno-0.3.4-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| libdeno-0.3.4-cp39-abi3-manylinux_2_28_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.28+ x86-64 | Details |
| libdeno-0.3.4-cp39-abi3-manylinux_2_28_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.28+ ARM64 | Details |
| libdeno-0.3.4-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details |
| libdeno-0.3.4-cp39-abi3-macosx_10_12_x86_64.whl | CPython 3.9 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 291.5 MB
Release files / libdeno-0.3.4-cp39-abi3-win_amd64.whl
| Download URL | libdeno-0.3.4-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 54.4 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
598557d140d3ba653ee2640ccb9e1a25d6e3952a8886b68e1fa7c7e3e72d1c3b
|
|
BLAKE2b-256 checksum How to use checksums |
d59d75e8f7e1e34503f1986e559119b29033d24842d3983e6cb7d250f20ec416
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 11, 2026.
Transparency logRelease files / libdeno-0.3.4-cp39-abi3-manylinux_2_28_x86_64.whl
| Download URL | libdeno-0.3.4-cp39-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 61.7 MB |
| Tags | CPython 3.9 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b0eeadcd5e2c1fb8bb5acfaa54b078509478511b935f545778792782971230d1
|
|
BLAKE2b-256 checksum How to use checksums |
501cc8ca63cfa69cbc9a6391e4c2dbba75ed2087ac562a874a61d95ca96ea29c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 11, 2026.
Transparency logRelease files / libdeno-0.3.4-cp39-abi3-manylinux_2_28_aarch64.whl
| Download URL | libdeno-0.3.4-cp39-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 65.3 MB |
| Tags | CPython 3.9 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
bdaaacafd67fea09c91500fc6846ab437cf81a4280243db51d4ab783aaadaa73
|
|
BLAKE2b-256 checksum How to use checksums |
f49b8ad0c7b44302a7724bf0fa8d0622c5516d0cb321dfa3ca2a731d3799331c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 11, 2026.
Transparency logRelease files / libdeno-0.3.4-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | libdeno-0.3.4-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 53.8 MB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
89cbd6cc48e20534754b37bb5fd43f603947fa0b19b7a87cf121815bccda2c26
|
|
BLAKE2b-256 checksum How to use checksums |
1c5c94f3439b10604c2430021ee56ac5bfd3a59d490d202d7f0199e8f54e3ac7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 11, 2026.
Transparency logRelease files / libdeno-0.3.4-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | libdeno-0.3.4-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 56.4 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
9c5debef509f91de343483003de707317093012efdd0952c39e1ec0a946f2f8c
|
|
BLAKE2b-256 checksum How to use checksums |
472c5cc4158f32e0d87a3079c9b443ebb79eac460ad6327e5497668466a5707c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 11, 2026.
Transparency log