skillfed

PyExecJS

Run JavaScript code from Python

pyexecjs v1.5.1 311.1K downloads/30d#7,741 on PyPI709
Permissive license MIT License Abandoned released

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 pyexecjs

uv

uv add pyexecjs

poetry

poetry add pyexecjs

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: JavaScriptProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5

Tags

run javascript from pythonexecute js code pythonjavascript runtime wrapperpython js bridgecall javascript functions pythonembed javascript python
eoljavascript-interop

More Software Development packages