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.25.1.tar.gz (156.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.25.1-cp312-abi3-win_amd64.whl (53.1 MB view details)

Uploaded CPython 3.12+Windows x86-64

belgie-0.25.1-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.25.1-cp312-abi3-manylinux_2_28_aarch64.whl (62.2 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12+macOS 11.0+ ARM64

belgie-0.25.1-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.25.1.tar.gz.

File metadata

  • Download URL: belgie-0.25.1.tar.gz
  • Upload date:
  • Size: 156.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.25.1.tar.gz
Algorithm Hash digest
SHA256 700b1a1e755ccc0980083d8b537215bd6c6a506d12f3c3189d7d2205a8b7140f
MD5 668b01c85bfeaebfb3600cd83ca4ef3c
BLAKE2b-256 6433c10c4322061cbbc8925ae3da8e8212e1315d481d7f205b7dd4e562a93a9f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.25.1-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.25.1-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 22ded1e6058d51df6c7a1a20452f80fb05c645c8ef44d1ff9ca9c03a40b5b371
MD5 cddb8784fbee00d24f132c07b80a9c31
BLAKE2b-256 6f61f08c6c10b205162f5407d6a104dabc5b85d6e0d22bcd1ff41d380becb69f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.25.1-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.25.1-cp312-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 de8069d4fc1122516a7b36e4c2e94c93e909a6bcecc99d431e2d577021693d47
MD5 a76690adb0b75b49c9bdd295cd031b60
BLAKE2b-256 323777e58fbbbaf00ad2b1c1c9b201580717b4885d64077a16cb568b38c0d08c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.25.1-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.25.1-cp312-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 94ef638a3f0b590615117aacfdd9b0f5857b6dd3d625be441b3a79368a617df0
MD5 3ff660e4202fe7be79fd6a673a209926
BLAKE2b-256 713a07f6b46796a4b70bd20bf72f4f0aff91c7bb7cbd295cef8fd83272fd9e49

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.25.1-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.25.1-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4548dfeff0c1f8e517410ff888ee5bb7aa997bab27e9b4ae089ad31ce7d52283
MD5 b2a7380d838fc140f9a9e98fad102d88
BLAKE2b-256 3775127518cf29eaf201145972569511aef2bd7f9b4cc5c78ea2b8a89ec2109d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.25.1-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.25.1-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 43b1ed8061a773efd4251f17299dca7fbcc1e83e27d6e7eb77aa749359d28733
MD5 b1a8f5d6a31c0ca98b07f6e7256736c9
BLAKE2b-256 34585d620a6d653f50842f33b34224a27b759172b77c6d8d55cfd8e1bc9f0f28

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