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.3. 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/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.3

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.3
File
libdeno-0.3.3-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
libdeno-0.3.3-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details
libdeno-0.3.3-cp39-abi3-manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64 Details
libdeno-0.3.3-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
libdeno-0.3.3-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.3-cp39-abi3-win_amd64.whl

Download URL libdeno-0.3.3-cp39-abi3-win_amd64.whl
Size 54.4 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
38fbdaf065b5218ff52e6be825afdd02482cea0670c63470792002e151c3403b
BLAKE2b-256 checksum
How to use checksums
a3291fb7a8a75165386b88490a42d1a3804560f2c9212efec547b067dfc18d18
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 9, 2026.

Transparency log

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

Download URL libdeno-0.3.3-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
b215ac7bace23eea899ce435061f71c02210f5b03adfedb6dcf442d96e0e3247
BLAKE2b-256 checksum
How to use checksums
cedfc0732a57a2fcdd26f7d6341c59d5cb33695b00fb68880088dfda07473a7a
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 9, 2026.

Transparency log

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

Download URL libdeno-0.3.3-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
3d05dc3e4f0218e7c5b169725b7564d7a0a2cbf03892e79c62c7d1ea98987192
BLAKE2b-256 checksum
How to use checksums
8404c9c14354b6a9bfed4eb3ef90a4749944772ebb5ce7c01ac537c9e53530bd
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 9, 2026.

Transparency log

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

Download URL libdeno-0.3.3-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
49d12e385d58ba443f318fd40068492db51eb03acf28d03327c6d4a1ad10ed08
BLAKE2b-256 checksum
How to use checksums
cd43f5c07f63b13fb594cd907e595f3158cede2d96f03480ba1eec57639ebbd5
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 9, 2026.

Transparency log

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

Download URL libdeno-0.3.3-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
f129bc82db30162445dd97c66e440f5a0b970eaffbc714610c893cd6715c0c9d
BLAKE2b-256 checksum
How to use checksums
ee270a75d16b6672ed3944e597548490e05291d4483f6ff30712665afa0687bb
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 9, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.4

5 release files

This release

0.3.3 This release

5 release files

0.3.2

5 release files

0.3.1

5 release 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