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

Uploaded CPython 3.12+Windows x86-64

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

Uploaded CPython 3.12+manylinux: glibc 2.28+ ARM64

belgie-0.25.0-cp312-abi3-macosx_11_0_arm64.whl (55.1 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

belgie-0.25.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.25.0.tar.gz.

File metadata

  • Download URL: belgie-0.25.0.tar.gz
  • Upload date:
  • Size: 155.9 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.0.tar.gz
Algorithm Hash digest
SHA256 b0f8b19e58c29898cd24c1ff8bfe704e81ababf99bea698977ec9bc0b3b874b6
MD5 de9241961c3d414acd2dc13a29d299ab
BLAKE2b-256 af129dd05ff4655f2cab2ce9fdba66e4eb03cf9d6b8af229c1ac74732beaa248

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.25.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.25.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8342056c4ab52aa70bb7606d175927612cbae11918c629904ca50ef6c29c12f4
MD5 24be4a5a6eb189f771897f45deafed7c
BLAKE2b-256 b9e509f99dcadebd00156b180c4089a434121f12df8460810c21bdef59121d25

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.25.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.25.0-cp312-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 08f27536b2cb24dd03b99bbcfe0bf9fe1a1a874a8edfe8e17bd9d043ff304d8c
MD5 ba7ab87ac795b1ae2396593ed29864e2
BLAKE2b-256 0b51e1a2777709aa76ead0bb4dc172dafd4a2090e7c871f8bc3474f282ddfad8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.25.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.25.0-cp312-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 924991984a782bfa19acac037dda47b9e34bd31d0cffcab0b95791998d9a4b2e
MD5 8502dc91d3a6e7a53bc6d8cfd441b756
BLAKE2b-256 b7d4114c2556699f4a448be0996e7a99fdd4e1192e2bfad48394f005de9f18d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.25.0-cp312-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 55.1 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.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c82e131ce1e042ac4a80284b9f5495e57c9020c0755a114da845968d45005e2c
MD5 9c7f086781075e0d7b1695177559588d
BLAKE2b-256 b31aa15f3d923e00cf7bcc685bd3d6540c3005542038e7fb3f6d1ee6d222fccf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.25.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.25.0-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 51755b461e8e977a630e4ccd10556bd73aaafac5ab7b114bb42bef849da83d40
MD5 dba6b15f6ca45b1c8926664a0a762ba4
BLAKE2b-256 0f992b035d1625d9ba8de70b2231a6782916063d873ad227209d86f76f9be309

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