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 cwd.
  • 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.23.2.tar.gz (137.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.23.2-cp312-abi3-win_amd64.whl (53.0 MB view details)

Uploaded CPython 3.12+Windows x86-64

belgie-0.23.2-cp312-abi3-manylinux_2_28_x86_64.whl (60.4 MB view details)

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

belgie-0.23.2-cp312-abi3-manylinux_2_28_aarch64.whl (62.1 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12+macOS 11.0+ ARM64

belgie-0.23.2-cp312-abi3-macosx_10_12_x86_64.whl (57.0 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: belgie-0.23.2.tar.gz
  • Upload date:
  • Size: 137.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.23.2.tar.gz
Algorithm Hash digest
SHA256 45fc166c5d172d1a51488f9619ee7a1d0085c7581a9b9df4dd3d06ff88cf4755
MD5 40ee4acba49129aadf2c8d78821cbc34
BLAKE2b-256 265bdf18647723b4f17c1d8d00f8ffc2255491813ee36ea2264ead3b380bc9b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.23.2-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 53.0 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.23.2-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 de186bd12810aaf4ce42af032ee41f35c43063c638b3d851db8b123f8f9cd861
MD5 ef9755667da1b4bba94b7f269d43e36a
BLAKE2b-256 c4997df716612f3b1879e710d9af2f41bc67831a33c206a7fca601dd7d2e5ded

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.23.2-cp312-abi3-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 60.4 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.23.2-cp312-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8e5036fe6a384dfd13aa2bb23647b6ba3f17508d518c9dcd4ddf5e8ee7844ce9
MD5 7124d0b166d00df348137a498e348e68
BLAKE2b-256 a4998c0b181d6546d97bd2f62b9772ccce67d5a654d839e06aa5e9965c905045

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.23.2-cp312-abi3-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 62.1 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.23.2-cp312-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 58b7c7725f4bb3ae701e869209df92e12e9d538db4de23c46fd0083752d69518
MD5 d0e55dd30e4b11f51b02a4984ed5a1b5
BLAKE2b-256 8f1e88432ab44314a6bfc525f16d1021cf7b88c61d10043034575a2c78d10e5f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.23.2-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.23.2-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 96aaa92fad392cf1e3bc0e35ecd803143784fa772e59fa709909c9a9a281b45f
MD5 6b2add6b0c72c1c474f2c4b35c6658e9
BLAKE2b-256 fd9310ef987749eedfd577a036aeca2c80b22a667b515abd90801f44ee284d0f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: belgie-0.23.2-cp312-abi3-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 57.0 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.23.2-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8beddd48be1a7f232ccc497929140029b327acd1c73c2271efa767faec455090
MD5 b2a80c7924beb569721a44b0828e3a49
BLAKE2b-256 cd658da97b4054cd4ab9d1d2f1771d443ba315b362760d69ad9dff449babe224

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