--- id: js2py-3-13 version: "0.74.1" license: MIT license_treatment: permissive maintenance: dormant --- # Js2Py-3.13 — JavaScript to Python Translator & JavaScript interpreter written in 100% pure Python. License: permissive · Maintenance: dormant · Downloads: 179.0K/mo ## What it is and what it does Js2Py is a pure-Python JavaScript interpreter and translator that lets you execute JavaScript code from within Python applications. It translates ECMAScript 5.1 code to Python and can execute it, or evaluate JavaScript expressions directly. The package supports importing npm modules as if they were Python libraries, converting JavaScript objects to Python types automatically, and even provides experimental ES6 support by internally using Babel to downgrade ES6 to ES5 before translation. The package is useful when you need to run untrusted or third-party JavaScript logic without spawning a Node.js process, integrate JavaScript libraries into Python workflows, or parse and analyze JavaScript code. It has three runtime dependencies (tzlocal, six, pyjsparser) and installs with low friction. However, maintenance is dormant—the last commit was in May 2024—so active development has stalled and edge cases in the translator may not be addressed. Use it for: - Execute JavaScript functions from Python without a Node.js dependency, such as running crypto-js for encryption/decryption workflows - Import and use npm packages directly in Python code by translating them on the fly with js2py.require() - Parse JavaScript files to an AST for analysis or transformation using js2py.parse_js() - Translate standalone JavaScript files to Python modules for offline use with js2py.translate_file() - Test JavaScript logic in a Python test suite without spawning external processes ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Js2Py translates and executes JavaScript code (ECMAScript 5.1, with experimental ES6 support) directly in Python, enabling you to run JS functions, evaluate expressions, and import npm packages without a JavaScript runtime. Yes, if you need lightweight JavaScript execution in Python and can tolerate dormant maintenance. The package is stable for ECMAScript 5.1 code, has no known vulnerabilities, and installs easily. However, avoid it if you rely on active bug fixes, ES6 features beyond experimental status, or performance-critical JavaScript translation—consider a Node.js subprocess or headless browser for those cases. ## Install pip install js2py-3-13 uv add js2py-3-13 poetry add js2py-3-13 ## Installing Js2Py-3.13 Before you install: Low friction: pure Python package with only three runtime dependencies (tzlocal, six, pyjsparser). Maintenance is dormant—last commit was 2024-05-06 and no release activity since 2025-02-07—so expect no active bug fixes or feature updates. License in practice: MIT license is permissive, allowing use in commercial and proprietary projects with minimal restrictions; you must include a copy of the license and acknowledge the original author. Quickstart: import js2py # Evaluate a simple expression result = js2py.eval_js('2 + 3') print(result) # 5 # Define and call a JavaScript function add = js2py.eval_js('function add(a, b) {return a + b}') print(add(1, 2)) # 3 Verify before relying: - Whether Python 2 support (mentioned in description) is still functional or tested in version 0.74.1 - Performance characteristics when translating or executing large JavaScript files (description mentions 50k+ line files) - Stability of ES6 support beyond the experimental label—what edge cases remain unsupported - Whether the 15-second Babel import overhead (mentioned in description) is acceptable for typical use cases ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 179.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags javascript interpreter python, run js code in python, javascript to python translator, execute javascript from python, npm packages in python, ecmascript 5 python, javascript evaluation python, javascript-interop, code-translation, interpreter [View on SkillFed](https://skillfed.io/packages/js2py-3-13) · [View on PyPI](https://pypi.org/project/js2py-3-13/)