Registry / serialization / js2py-3-13

js2py-3-13

JSON →
library0.74.1pypypi✓ verified 79d ago

JavaScript to Python translator and JavaScript interpreter written in pure Python. Converts JavaScript code to Python (execjs) or executes it directly. Version 0.74.1, maintenance mode with no new features.

pip install js2py-3-13
INSTALL
IMPORT
SIG · JS2PY-3-13
J
js2py-3-13
serializationpythonv0.74.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

EvalJs
from js2py_ import EvalJs
from js2py import EvalJs

Create a JavaScript execution context, run JS code, and access variables.

from js2py import EvalJs context = EvalJs() context.execute("var x = 10; var y = 20;") result = context.x + context.y print(result) # 30
Debug
Known issues
deprecatedJs2Py is in maintenance mode; no new features or major fixes. Consider alternatives like pyexecjs or Node.js subprocess for modern JavaScript.
fix
Use pyexecjs or call Node.js directly.
affects: >=0.74.0
gotchaES6+ features (e.g., arrow functions, const/let, classes) are not fully supported. May throw SyntaxError.
fix
Transpile modern JS to ES5 (using Babel) before passing to Js2Py.
affects: all
deprecatedThe top-level `require()` function is experimental and may not work with CommonJS modules.
fix
Prefer `EvalJs` with manual script loading.
affects: all
Upgrade
Version history
0.74.1latest on PyPI · released Feb 7, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
4
Resources
js2py-3-13 — pip install js2py-3-13 · libregistry