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

Uploaded CPython 3.12+Windows x86-64

belgie-0.26.0-cp312-abi3-manylinux_2_28_x86_64.whl (60.6 MB view details)

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

belgie-0.26.0-cp312-abi3-manylinux_2_28_aarch64.whl (62.3 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12+macOS 11.0+ ARM64

belgie-0.26.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.26.0.tar.gz.

File metadata

  • Download URL: belgie-0.26.0.tar.gz
  • Upload date:
  • Size: 168.9 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.26.0.tar.gz
Algorithm Hash digest
SHA256 ba447a49684655068f09a20eddcb2273a91d997c1b96a88a30e049b99808c9ff
MD5 366b517fa6edb3b0287d250dac3562bf
BLAKE2b-256 ee6df70e776200954c68fe9f4810610c57e65d3db6b8aa04e26f466fc88fc46d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.26.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.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.26.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b5b3b91557998b9f49a83e441eef1204656dd34941ef726befd32dbbefc0b457
MD5 a6432fe4151dd2567dd3f5dd1f8392b7
BLAKE2b-256 3b31693ba42907272fa504c17177917398400a2ab028f3e2e8683122b1584007

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.26.0-cp312-abi3-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 60.6 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.26.0-cp312-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 608e4d5b1bc3622163b9bb47948fe706df7fc02c5182a01874cd8ddcd015f521
MD5 11cc337329fb3e2a5747fc12d0db186d
BLAKE2b-256 18d68ba9e881a165cd2f6706feb12da9741d732659d9ba87ba1d56c86eb6cfad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.26.0-cp312-abi3-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 62.3 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.26.0-cp312-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 bfed31b3871f41f3282e74631ff8d178cbd4439922712e56013b418fe2fbdb99
MD5 b291145bcac4024eb7fc90abf08f33c5
BLAKE2b-256 e445540ee3c0a177e4b4c027bb643072b22f2d6a0ba74129383aa7d3c862f852

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.26.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.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.26.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a355147b1d88385298ccf93ffa379627fe2d1d92e4b73da58e43abeb2b0814f7
MD5 a667bc0d2d01861c12b97f3d19a07b62
BLAKE2b-256 bc09ef6cac3c2ad00e5ee195b044fdf355075878e48ebe11fe1f3a2c3df691ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.26.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.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.26.0-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9934073a0e2a8139478af474bbd1439df9449ef65fa0c9eee12d93fe25c9efbe
MD5 91b04fbeebf36087676486655fd2e37f
BLAKE2b-256 92ea8941fb5cadc32c61a65f98f7984f48f35aaf3ed0f6e132ecda8f7ad14a57

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