Skip to main content

libdeno Python API

The Python distribution and Rust crate are versioned at 0.3.7. The Python API is alpha and provides synchronous access to the runtime:

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, return an exit code, and release the GIL while Rust runs. Runtime reuses the resolver stack; 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

  • permissions contains CLI-style --allow-* strings. An empty sequence requires allow_all_permissions=True; prompting is not exposed. -A/--allow-all grants all capabilities.
  • args are exposed through process.argv; features optionally selects valid Deno unstable feature names. None keeps the runtime defaults.
  • execution_deadline is a finite, non-negative number of seconds. A busy JavaScript run normally raises DenoTimeoutError when 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_bytes is an optional V8 old-generation constraint. Values below 8 MiB are rejected with ConfigurationError; 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 .tgz path has the same 1 GiB response-body cap. For a gzip response, the final four body bytes are checked as an ISIZE hint (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 as DenoRuntimeError.
  • 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.

Limitations

  • 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); releases currently provide wheels.
  • The Python API remains alpha and may change.

Metadata

Release files for libdeno 0.3.7

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

Built distributions (wheels)

Table of built distributions (wheels) for libdeno 0.3.7
File
libdeno-0.3.7-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
libdeno-0.3.7-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details
libdeno-0.3.7-cp39-abi3-manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64 Details
libdeno-0.3.7-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
libdeno-0.3.7-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 293.3 MB

Release files / libdeno-0.3.7-cp39-abi3-win_amd64.whl

Download URL libdeno-0.3.7-cp39-abi3-win_amd64.whl
Size 54.7 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8373c8eea912eba293feec88c643e92b2605cb29cb039b4d47d0fe848d983d7d
BLAKE2b-256 checksum
How to use checksums
30780cce83233b9fcaa4c344011f4543586f6cbb78cc1fc8b3f42ee83d452ef3
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 25, 2026.

Transparency log

Release files / libdeno-0.3.7-cp39-abi3-manylinux_2_28_x86_64.whl

Download URL libdeno-0.3.7-cp39-abi3-manylinux_2_28_x86_64.whl
Size 62.1 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
362df2e7100a06177eb6bc520238afb7776fd136bdefe22d52fa8e8526283ab9
BLAKE2b-256 checksum
How to use checksums
fd3766251135b8d8343490bf6f72e0162cc846b2ef82b62961995453f89ce04f
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 25, 2026.

Transparency log

Release files / libdeno-0.3.7-cp39-abi3-manylinux_2_28_aarch64.whl

Download URL libdeno-0.3.7-cp39-abi3-manylinux_2_28_aarch64.whl
Size 65.6 MB
Tags CPython 3.9 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
14d1fb4dc7e2066937774391831574480a61072ddb78cecf807551b68d534540
BLAKE2b-256 checksum
How to use checksums
9ce234adf2f5dde7a2dff33a0524d214c0a34d70f611d23ee44a2d13691bff9f
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 25, 2026.

Transparency log

Release files / libdeno-0.3.7-cp39-abi3-macosx_11_0_arm64.whl

Download URL libdeno-0.3.7-cp39-abi3-macosx_11_0_arm64.whl
Size 54.1 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
27d8d1af03b55f3995805d3da438f4cc6dd22e42d019138e79e314da448ec690
BLAKE2b-256 checksum
How to use checksums
60bc2df78dee27477efb37744baf62c78929c5b18263abf36bcbdcaa62fd1ca4
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 25, 2026.

Transparency log

Release files / libdeno-0.3.7-cp39-abi3-macosx_10_12_x86_64.whl

Download URL libdeno-0.3.7-cp39-abi3-macosx_10_12_x86_64.whl
Size 56.7 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
d79e7d6d87e38eb92176de1669684e0f095d5f63b5e89496bc5e642ce6d139ab
BLAKE2b-256 checksum
How to use checksums
730edc237521b4e83fb47bd3d0edb4f527c3bbfb4115916ac268393cdf03d636
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 25, 2026.

Transparency log

Security for libdeno 0.3.7

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

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for libdeno-0.3.7-cp39-abi3-win_amd64.whl

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 25, 2026.

Transparency log

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