{"id":27082,"library":"js2py-3-13","title":"Js2Py","description":"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.","status":"maintenance","version":"0.74.1","language":"python","source_language":"en","source_url":"https://github.com/PiotrDabkowski/Js2Py","tags":["javascript","translator","interpreter","es5"],"install":[{"cmd":"pip install js2py-3-13","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Common correct import for creating a JavaScript execution context.","symbol":"EvalJs","correct":"from js2py import EvalJs"},{"note":"Translates JavaScript to Python code.","symbol":"translate_js","correct":"from js2py import translate_js"},{"note":"To load external JavaScript modules.","symbol":"require","correct":"from js2py import require"}],"quickstart":{"code":"from js2py import EvalJs\ncontext = EvalJs()\ncontext.execute(\"var x = 10; var y = 20;\")\nresult = context.x + context.y\nprint(result)  # 30","lang":"python","description":"Create a JavaScript execution context, run JS code, and access variables."},"warnings":[{"fix":"Use pyexecjs or call Node.js directly.","message":"Js2Py is in maintenance mode; no new features or major fixes. Consider alternatives like pyexecjs or Node.js subprocess for modern JavaScript.","severity":"deprecated","affected_versions":">=0.74.0"},{"fix":"Transpile modern JS to ES5 (using Babel) before passing to Js2Py.","message":"ES6+ features (e.g., arrow functions, const/let, classes) are not fully supported. May throw SyntaxError.","severity":"gotcha","affected_versions":"all"},{"fix":"Prefer `EvalJs` with manual script loading.","message":"The top-level `require()` function is experimental and may not work with CommonJS modules.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Rewrite arrow functions as regular functions or use a transpiler like Babel.","cause":"Arrow functions are ES6 and not supported.","error":"SyntaxError: Unexpected token '=>'"},{"fix":"Use `from js2py import PyJsException` or catch general exceptions.","cause":"Old import path from js2py.translators.","error":"ImportError: cannot import name 'PyJsImportError'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}