Skip to main content

A minimal, secure javascript runtime for python

Project description

Belgie: A secure JavaScript runtime for Python, powered by Deno

Belgie lets you run JavaScript and TypeScript from Python. Deno is bundled — you do not need Node.js or Deno on your PATH.

  • Scripts from Python: Run inline or file-based JS/TS with Runtime and Script, sync or async.
  • Inline dependencies: Import npm, JSR, and URL modules directly from JS/TS source.
  • Isolated packages: Use Environment for lockfiles, custom cache/options, local packages, and commands.
  • CLI tools: Run npm binaries (Vite, esbuild, etc.) through Command.
  • Simple data bridge: Pass JSON-safe dicts, lists, and primitives across the boundary.

Installation

uv add belgie
uvx library-skills install  # optional: install the use-belgie skill for Cursor, Codex, Claude, etc.

uv add belgie adds the library (Python >=3.12,<3.15, no runtime Python deps).

uvx library-skills install is optional. It links the bundled use-belgie agent skill into .agents/skills/ so coding agents can follow belgie's public API when you work on integrations. Skip it if you only need the Python library.

Quick Start

import asyncio

from belgie import Runtime, Script

script = Script(
    """
import camelcase from "npm:camelcase@8.0.0";

export default function run(input) {
  return camelcase(input);
}
"""
)

async def main() -> None:
    async with Runtime() as run:
        print(await run(script)("foo-bar"))  # prints: fooBar

asyncio.run(main())

Examples

  • simple: Async Runtime with a TypeScript file on disk.
  • inline-deps: Direct npm:, jsr:, and URL imports in a script.
  • jsr-deps: JSR packages declared through an explicit Environment.
  • environment: Sync and async Environment setup with path.
  • commands: npm package binaries via Runtime and Command.

For deeper integration guidance, optionally install the use-belgie skill with uvx library-skills install.

Project details


Download files

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

Source Distribution

belgie-0.27.1.tar.gz (173.4 kB view details)

Uploaded Source

Built Distributions

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

belgie-0.27.1-cp312-abi3-win_amd64.whl (53.8 MB view details)

Uploaded CPython 3.12+Windows x86-64

belgie-0.27.1-cp312-abi3-manylinux_2_28_x86_64.whl (61.4 MB view details)

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

belgie-0.27.1-cp312-abi3-manylinux_2_28_aarch64.whl (63.1 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.28+ ARM64

belgie-0.27.1-cp312-abi3-macosx_11_0_arm64.whl (55.9 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

belgie-0.27.1-cp312-abi3-macosx_10_12_x86_64.whl (57.8 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

Details for the file belgie-0.27.1.tar.gz.

File metadata

  • Download URL: belgie-0.27.1.tar.gz
  • Upload date:
  • Size: 173.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for belgie-0.27.1.tar.gz
Algorithm Hash digest
SHA256 495e0d8f68028e04d6f69a8d6efa8e790449ff697453a8b1aeb7cf40831aee57
MD5 2b66fc89d438ac580d1a29b1916dd688
BLAKE2b-256 d53de9b5a7d160b7e566480839a9256ded77a8867ef1365a4286e814542b7b1a

See more details on using hashes here.

File details

Details for the file belgie-0.27.1-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: belgie-0.27.1-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 53.8 MB
  • Tags: CPython 3.12+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for belgie-0.27.1-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c1143165303b33d458fcd71bce2fbe788766cce27609e293f86eaef82c1edc4e
MD5 9b2e38cae3c2d2ecef6b33a246dfc3b1
BLAKE2b-256 05941cb9e873a685f46846f524ed963fbc0e637255a7c07a04c95b3d9c56f448

See more details on using hashes here.

File details

Details for the file belgie-0.27.1-cp312-abi3-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: belgie-0.27.1-cp312-abi3-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 61.4 MB
  • Tags: CPython 3.12+, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for belgie-0.27.1-cp312-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7e319964c0d279715a6a334d3ca6f4106cef00129df73c523735199f7529658e
MD5 f67ef45db5ce1b294fc3c2bdeed6ee89
BLAKE2b-256 3d1987da6076af22214a7be1baeceb953a4ec95d174282eaa0aed5853b592e10

See more details on using hashes here.

File details

Details for the file belgie-0.27.1-cp312-abi3-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: belgie-0.27.1-cp312-abi3-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 63.1 MB
  • Tags: CPython 3.12+, manylinux: glibc 2.28+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for belgie-0.27.1-cp312-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a58ad555abf729edeeceabcdacff5ca508485576b8d1669ab1f3993bcb7b417d
MD5 a3b97dcc784bc36fb0e6e107cd106c55
BLAKE2b-256 9ce7cd8f190bdf1c0ec8edca58039931c0f7f061d74a70de78e58e2e92bbade2

See more details on using hashes here.

File details

Details for the file belgie-0.27.1-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: belgie-0.27.1-cp312-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 55.9 MB
  • Tags: CPython 3.12+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for belgie-0.27.1-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 990637868a06a44c925e91a7eb5111cbe82cee5f3147899ccd6b8819605423a2
MD5 be54451a54132032be92ecfb7065d6cd
BLAKE2b-256 49799c84f5c0dd5ac7218311c304c915ff4f574aadf2986e7c87b11abf581e5b

See more details on using hashes here.

File details

Details for the file belgie-0.27.1-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: belgie-0.27.1-cp312-abi3-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 57.8 MB
  • Tags: CPython 3.12+, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for belgie-0.27.1-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 476196c86136e45ef88af1a12d1763016f99f7d2f7c4e9a63f232fe02c1813b7
MD5 9ea905593bc7b6e5a7558a3394aeb71d
BLAKE2b-256 601da62585a7455e0739d16bebd38b4d695a337fafdd918354df4fce561ba944

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page