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.
  • Isolated packages: Add npm or JSR deps in Environment; installs live in temp storage, not your repo.
  • 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 Environment, Runtime, Script

script = Script(
    """
import camelcase from "camelcase";

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

async def main() -> None:
    async with Environment({"camelcase": "npm:camelcase@8.0.0"}) as env:
        await env.install()
        async with Runtime(env=env) as run:
            print(await run(script)("foo-bar"))  # prints: fooBar

asyncio.run(main())

Examples

  • simple: Async Runtime with a TypeScript file on disk.
  • jsr-deps: JSR packages declared inline in 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.24.0.tar.gz (151.6 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.24.0-cp312-abi3-win_amd64.whl (53.1 MB view details)

Uploaded CPython 3.12+Windows x86-64

belgie-0.24.0-cp312-abi3-manylinux_2_28_x86_64.whl (60.5 MB view details)

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

belgie-0.24.0-cp312-abi3-manylinux_2_28_aarch64.whl (62.2 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.28+ ARM64

belgie-0.24.0-cp312-abi3-macosx_11_0_arm64.whl (55.2 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

belgie-0.24.0-cp312-abi3-macosx_10_12_x86_64.whl (57.1 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: belgie-0.24.0.tar.gz
  • Upload date:
  • Size: 151.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.24.0.tar.gz
Algorithm Hash digest
SHA256 9119bd3920d8bd293e2711496a2da3e2a71519fa33eb8111a8fcf8328963a4d8
MD5 d59c60f7051ddf0e32e15955f832a473
BLAKE2b-256 bed1bb35b9f496db0761458488e88cfe4c583dd3eb1b415771334d3c53f0d485

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.24.0-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 53.1 MB
  • Tags: CPython 3.12+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.24.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 39bc551569882c82b0cecff7d055d93798b93db60bffa89d35b6266f26feaddf
MD5 0a61c5fc137dc412680c96fcd1eea5f9
BLAKE2b-256 15ff587dbf82e675bcd6ca26e61cc171f5a4f03f8c02e5f23dc6453f894aeb9b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.24.0-cp312-abi3-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 60.5 MB
  • Tags: CPython 3.12+, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.24.0-cp312-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3681528c929a21153596ebbbe701895534657fc2fb5fbbedc6477b06a1d37a82
MD5 cb6cabae5d6401c73892956b2b318ed5
BLAKE2b-256 088ed7dde3b26b8c2fe5ac6b898cb31ce627608e040f4c610b1898fddd0d65d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.24.0-cp312-abi3-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 62.2 MB
  • Tags: CPython 3.12+, manylinux: glibc 2.28+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.24.0-cp312-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e7780d56f26bec873415f86fdddf99c926c8f2c32edd4f67423cc7963f537fce
MD5 4aadb6d6caadad81412e7b65759e2667
BLAKE2b-256 e213c979bb1ea3ec7fa3e1b0c3e7106b96412b6241c91d6b4b289b274014a910

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.24.0-cp312-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 55.2 MB
  • Tags: CPython 3.12+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.24.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 47ad1ba5397d9b5e5b713856dfe180140c47973f8f3f233a6068ea1c887a43e8
MD5 e30bc1130f60c88092432db4c90c5739
BLAKE2b-256 0fcacba1ac11cf0eb7a2f01709b452e915c1a38222978867bb3b0423cb0e396e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.24.0-cp312-abi3-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 57.1 MB
  • Tags: CPython 3.12+, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.24.0-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2369d4157fed9d55f1059ba1fd5d729c4bf7ab8faea68c8d7dc6f75dbc2247c5
MD5 1d389395c17bf6592d14d337debab8e1
BLAKE2b-256 9c4a9ae51d725f0713233c8119c9f8707eaa80afa891f86005b8aeb32466e0cc

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