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 point | Use it for | Status |
|---|---|---|
elide app.py | Running a Python file directly from its extension. | Shipped |
elide run app.py | Running a Python file through the generic runtime command. | Shipped |
elide python app.py | CPython-style Python command. | Shipped |
elide python -c "..." | Running Python source passed on the command line. | Shipped |
elide python -m module | Running a module as __main__. | Shipped |
elide python hello.py
elide python -c 'print("Hello from Python")'
elide python -m json.tool input.jsonWhen 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
| Capability | Notes |
|---|---|
| Python scripts | .py files run directly with elide, elide run, or the elide python command. |
| Standard library | Elide 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 arguments | Script arguments are delivered through sys.argv in CPython style. |
| Python and JavaScript interop | The built-in elide Python module exposes js, bind, and poly helpers for cross-language calls. |
| Virtual environments | If 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:
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
- Python Tooling —
uv, PyPI dependencies, virtual environments, and Python availability - Compatibility — latest reported compliance results from
elide-dev/testsuite - Elide + Web — running JavaScript and TypeScript applications in Elide
- JavaScript & TypeScript Tooling — JavaScript and TypeScript toolchain features