Python with Elide

Elide runs Python programs with an embedded Python runtime and a bundled Python standard library. You do not need to install CPython separately to run .py files with Elide.

Python runtime support is shipped in Elide today. Python package installation is documented separately because Elide's embedded uv integration is still experimental.

Entry points

Elide accepts Python through two entrypoint styles:
Entry pointUse it forStatus
elide app.pyRunning a Python file directly from its extension.Shipped
elide run app.pyRunning a Python file through the generic runtime command.Shipped
elide python app.pyCPython-style Python command.Shipped
elide python -c "..."Running Python source passed on the command line.Shipped
elide python -m moduleRunning a module as __main__.Shipped
bash
 elide python hello.py
 elide python -c 'print("Hello from Python")'
 elide python -m json.tool input.json

When you run a script, Elide follows CPython's sys.argv convention: sys.argv[0] is the script path, and trailing tokens are script arguments.

What works today

CapabilityNotes
Python scripts.py files run directly with elide, elide run, or the elide python command.
Standard libraryElide ships a Python standard library with the binary. Modules such as json, os, sys, pathlib, argparse, dataclasses, and string.Template are covered by smoke tests.
CLI argumentsScript arguments are delivered through sys.argv in CPython style.
Python and JavaScript interopThe built-in elide Python module exposes js, bind, and poly helpers for cross-language calls.
Virtual environmentsIf VIRTUAL_ENV is set, Elide appends the virtual environment's site-packages directory to Python's module search path.

Python runtime

Elide targets Python 3.12 era standard-library behavior. The exact runtime version and compatibility profile are tied to the Elide binary you run; use the Compatibility Matrix for reported results from the external testsuite.

Python and JavaScript interop

Python can call JavaScript and expose Python functions through Elide's built-in elide module:

python
from elide import js, bind, poly

total = js("[1, 2, 3, 4].reduce((a, b) => a + b, 0)")

@bind
def add(a, b):
  return a + b

@poly(name="multiply")
def multiply(a, b):
  return a * b

print(total)

Package installation

Elide embeds uv for PyPI dependency installation. That integration is shipped, but still considered experimental: it is available on macOS and Linux, while Windows support is in progress.

Read Python Tooling for uv, PyPI dependency declarations, requirements.txt, pyproject.toml, and virtual-environment behavior.

Current limits

  • Native Python extensions can behave differently from CPython; prefer pure-Python packages unless the package is validated with Elide.
  • Cross-language imports from JavaScript or TypeScript into Python modules are not yet documented as stable.

Additional Resources