Skip to main content

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

  • permissions contains CLI-style --allow-* capability strings. An empty sequence is rejected with ConfigurationError unless allow_all_permissions=True is explicit. -A/--allow-all is equivalent.
  • 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.

Exceptions

The facade exports LibdenoError and these subclasses:

  • EntryError — entry resolution failed.
  • DenoPermissionError — invalid/denied permission access.
  • 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/python -m pip install "maturin>=1.11,<2"
./build-wheel.sh
.venv/bin/python -m pip install target/wheels/*.whl

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.

Run the stdlib test suite after installing the wheel (from the repository root, so the source package does not shadow the installed package):

python -m unittest discover -s python/tests -p 'test_*.py'

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

libdeno-0.3.2-cp39-abi3-win_amd64.whl (54.3 MB view details)

Uploaded CPython 3.9+Windows x86-64

libdeno-0.3.2-cp39-abi3-manylinux_2_28_x86_64.whl (61.6 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ x86-64

libdeno-0.3.2-cp39-abi3-manylinux_2_28_aarch64.whl (65.1 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

libdeno-0.3.2-cp39-abi3-macosx_11_0_arm64.whl (53.6 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

libdeno-0.3.2-cp39-abi3-macosx_10_12_x86_64.whl (56.3 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file libdeno-0.3.2-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: libdeno-0.3.2-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 54.3 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for libdeno-0.3.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4f08491bcc1dd9dae518ddf1d99e85bac91173d7a2473735030c4517d26977c2
MD5 945064377a5338e4083df13bad14c0f1
BLAKE2b-256 8824acafbeb8874508148dc2c63a295f3fd7b12186c41cad24a272ba31b11966

See more details on using hashes here.

Provenance

The following attestation bundles were made for libdeno-0.3.2-cp39-abi3-win_amd64.whl:

Publisher: release.yml on agentsyaml/libdeno

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libdeno-0.3.2-cp39-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for libdeno-0.3.2-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 68869f5ed375fb34d2daf17ba81fb1a50e8e7651bca0554d30e8da96958f40fa
MD5 c26adde90a95420143271d691ae24a31
BLAKE2b-256 bcb1349adb6fca23b3ce92eacb550ba00176e36046cbd31295caaf19ce5aac44

See more details on using hashes here.

Provenance

The following attestation bundles were made for libdeno-0.3.2-cp39-abi3-manylinux_2_28_x86_64.whl:

Publisher: release.yml on agentsyaml/libdeno

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libdeno-0.3.2-cp39-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for libdeno-0.3.2-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 04724eeb46a0f76352f3c2fc83961ea72587ab641464322cc1d613a7ca558a18
MD5 4f0cc288ba60de949bd4718c89acac9a
BLAKE2b-256 1d1f2c64583a707651d6709c12bd9fde0cea1aee98d38848ebb868262323e295

See more details on using hashes here.

Provenance

The following attestation bundles were made for libdeno-0.3.2-cp39-abi3-manylinux_2_28_aarch64.whl:

Publisher: release.yml on agentsyaml/libdeno

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libdeno-0.3.2-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libdeno-0.3.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bc5bc824cdc400ec55dfba75a9fe328e8ed114b9ab3a8752437bc71a11699fdb
MD5 90759f48b72cd3410cb967a6e51ddd17
BLAKE2b-256 820c123a0423247c2de3cd9e57c75fc8ba48775fe79ca974ae540d4bfe1b8b72

See more details on using hashes here.

Provenance

The following attestation bundles were made for libdeno-0.3.2-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on agentsyaml/libdeno

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libdeno-0.3.2-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for libdeno-0.3.2-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ddd262215f3f8428b9979278494f90828e26eed535bf1c4c6aa1d64aeef60cc9
MD5 4e5287f0bdfc81586a5cacb7f1425418
BLAKE2b-256 8f52c47108d36cb183cad410834f0f0e0bd1e8b61b6e18601db211172d22a5eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for libdeno-0.3.2-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on agentsyaml/libdeno

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.2 This release

5 files

0.3.1

5 files

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