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

Uploaded CPython 3.12+Windows x86-64

belgie-0.27.0-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.0-cp312-abi3-manylinux_2_28_aarch64.whl (63.1 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12+macOS 11.0+ ARM64

belgie-0.27.0-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.0.tar.gz.

File metadata

  • Download URL: belgie-0.27.0.tar.gz
  • Upload date:
  • Size: 170.8 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.0.tar.gz
Algorithm Hash digest
SHA256 963cc6bb497d04ecf6aadbae299e600a486c06f454b35cb4625ce1aee9a3e53f
MD5 b595853756f8e0db7655a3d05c478d25
BLAKE2b-256 b8b1ca99bfe444f758b22b494526eb3396404f3636d3dbefb08a2ff5947a3b61

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.27.0-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.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 bca65b67768484507a5778eb041a63cc42369407818216df342378f079d3d8aa
MD5 3d236c529ae43b8a7c2a906e43d35fa2
BLAKE2b-256 7f16743f9280b22e66d41ecb1a95ce2e2ee63c5dbd6e5df76955b99d3002b19e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.27.0-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.0-cp312-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5505f03788cae5fd2bfc55566685a3421dda690999e43e3643ab3a3949575051
MD5 80273339650d31a81578c303fed569ee
BLAKE2b-256 8f2bc2b24afbbc953897050c8b1416cbf6d01ec1a249a2e507e2dcba34498779

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.27.0-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.0-cp312-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ebdbc6c56d64c4815500dec099b71fce286d05d9447af556baf07cb7585d6281
MD5 3e66ec6e1b21ba94fb870448b17bb10b
BLAKE2b-256 6ade888a5bb756f121218e04105b977ff5ddc29c3e2bf8ef92ce8fef179c3403

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.27.0-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.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e9ec179244812140b83588badbcd1d11c3b8e3f4982ba766a34bbece1ba046c7
MD5 1b8f14e8d595e0e1b2ed4332145d66bb
BLAKE2b-256 8c471aed039044d7334cb20be2de30ebe5c866dd5f590152d5e118be5cd5ed8e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.27.0-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.0-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 59e04c1fadfc59f2db604d78f0593c91c50498d1698f1bfc2c17ca4f501dd216
MD5 4625cda3cf1aab0d909595c33bbe022e
BLAKE2b-256 8f4021c87716c30044c89f4ddf4a7089f8af70ed91d0f05e51db4d30e662d059

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