PyExecJS
Run JavaScript code from Python
What it is and what it does
PyExecJS is a Python wrapper that lets you run JavaScript code and call JavaScript functions from Python by automatically detecting and using whatever JavaScript runtime is available on your system. It abstracts away the details of which engine is present—Node.js, PhantomJS, Nashorn, or others—so you can write once and have it work across different environments. You compile JavaScript code into a context object, then call functions on that context and get back Python values.
The package is end-of-life and no longer maintained. The repository is archived, the last release was in January 2018, and the author explicitly states that bugs will not be fixed. It requires you to have a JavaScript runtime already installed separately; PyExecJS itself has no runtime dependencies but acts as a bridge to external engines. Performance is a known limitation because it communicates with the runtime via text serialization.
Use it for:
- Integrate JavaScript libraries or algorithms into a Python application without rewriting them in Python.
- Test JavaScript code or functions as part of a Python test suite.
- Evaluate or transform JavaScript expressions dynamically at runtime from within a Python program.
- Build tools that need to run JavaScript in environments where a separate process invocation is inconvenient.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Executes JavaScript code from Python by automatically selecting and delegating to an available JavaScript runtime such as Node.js, PhantomJS, or Nashorn.
No. The package is abandoned and explicitly marked end-of-life by its author. While it has no known security vulnerabilities, it receives no maintenance, no bug fixes, and no compatibility updates. Unless you are maintaining legacy code that already depends on it, you should use an actively maintained alternative or invoke a JavaScript runtime directly. The high install friction combined with zero maintenance makes it unsuitable for new projects.
Install
pyexecjs on PyPI
pip
pip install pyexecjsuv
uv add pyexecjspoetry
poetry add pyexecjsInstalling PyExecJS
Before you install
High install friction: the package is abandoned (last release January 2018, repository archived as of April 2020). No runtime dependencies are bundled; you must have a compatible JavaScript engine already installed on your system. Maintenance has ceased entirely.
License in practice
MIT License (permissive). You may use, modify, and distribute this package freely with minimal restrictions, but the lack of active maintenance means security patches and compatibility fixes will not be forthcoming.
Quickstart
pip install PyExecJS
import execjs
ctx = execjs.compile("function add(x, y) { return x + y; }")
result = ctx.call("add", 1, 2)
A JavaScript runtime (Node.js, PhantomJS, Nashorn, or equivalent) must be installed and available on your system; PyExecJS does not provide one.
Verify before relying
- Whether the package still works reliably with modern Python versions beyond 3.5.
- Compatibility with contemporary JavaScript runtimes and their recent major versions.
- Whether critical bugs discovered since 2018 affect your intended use case.
Package facts
| License | MIT License (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 3,130 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 311,090/month — #7,741 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: PyExecJS-1.5.1.tar.gz
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
stpyv8STPyV8 embeds Google V8 JavaScript engine into…
permissive · top 5,000 on PyPI
mini-racerEmbeds Google's V8 JavaScript engine in Python,…
permissive · top 5,000 on PyPI
py-mini-racerEmbeds a modern V8 JavaScript engine in Python,…
permissive · top 5,000 on PyPI
yt-dlp-ejsProvides external JavaScript execution support…
permissive · top 5,000 on PyPI
Js2PyJs2Py translates and executes JavaScript code…
permissive · top 5,000 on PyPI
quickjs-rsExecutes JavaScript code inside a WebAssembly…
permissive · top 15,000 on PyPI
Js2Py-3.13Js2Py translates and executes JavaScript code…
permissive · top 15,000 on PyPI
denoPackages and distributes Deno (a…
permissive · top 15,000 on PyPI
quickjsWraps the QuickJS C library to execute…
unclear · top 5,000 on PyPI
nodejs-wheelDistributes Node.js prebuilt binaries as Python…
unclear · top 15,000 on PyPI