dukpy
Simple JavaScript interpreter for Python
Decision gist · record as of 2026-08-14
Yes, if you need to run JavaScript or transpile TypeScript/JSX/LESS from Python without external dependencies. The package is actively maintained, has no known vulnerabilities, and supports current Python versions. Install friction is moderate but manageable. Not recommended if you need high-performance JavaScript execution or have complex npm ecosystem dependencies beyond what DukPy's loader can resolve.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Medium install friction due to compiled wheels for multiple platforms and Python versions (3.9–3.14).
- The package is actively maintained with a recent release (22 days old) and no external runtime dependencies, making it straightforward to deploy once installed.
License · maintenance · safety
MIT (permissive) — Licensed under MIT, a permissive license that allows commercial and private use with minimal restrictions.
last release 2026-07-23 (22 days) · last repo commit 2026-07-23 · 532 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 610,562 downloads/mo, #5,765 on PyPI
Alternatives
Verify before relying
pip install dukpy
import dukpy
# Evaluate JavaScript
result = dukpy.evaljs("var o = {'value': 5}; o['value'] += 3; o")
print(result) # {'value': 8}
# Transpile TypeScript
ts_code = "class Greeter { constructor(public greeting: string) {} }"
js_code = dukpy.typescript_compile(ts_code)
# Transpile JSX
jsx_result = dukpy.jsx_compile('var react_hello = Hello, world!;')
# Compile LESS
less_result = dukpy.less_compile('.class { width: (1 + 1) }')- Whether the package's performance is suitable for production workloads involving large or frequent JavaScript evaluations.
- Compatibility and integration details with WebAssets pipelines beyond the documented examples.
- Whether npm package installation via dukpy.install_jspackage is fully functional (description excerpt cuts off mid-sentence).
What it is and what it does
DukPy embeds a JavaScript interpreter in Python, allowing you to execute JavaScript code directly from Python and get results back as JSON-serializable objects. It also includes built-in transpilers for TypeScript, JSX, and LESS, making it useful for asset pipelines and build workflows that need to run on the server side without spawning external processes.
The package supports both one-off code evaluation via `evaljs()` and persistent interpreter instances via `JSInterpreter` for scenarios where bootstrap cost matters. It can load JavaScript modules via `require()` and run ES modules or CommonJS files. Since version 0.6.0, it has no external runtime dependencies—the interpreter is bundled—and supports Python 3.9 through 3.14 across multiple platforms.
Use it for
- Transpile TypeScript or JSX on the server during build or request time without invoking external tools.
- Evaluate dynamic JavaScript expressions passed as configuration or user input and return results to Python.
- Compile LESS stylesheets as part of a Python-based asset pipeline or web framework.
- Run JavaScript unit tests or validation logic from within a Python test suite or CI workflow.
- Load and execute npm modules in a Python application without a separate Node.js process.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to run JavaScript or transpile TypeScript/JSX/LESS from Python without external dependencies.
The package is actively maintained, has no known vulnerabilities, and supports current Python versions. Install friction is moderate but manageable. Not recommended if you need high-performance JavaScript execution or have complex npm ecosystem dependencies beyond what DukPy's loader can resolve.
Install
dukpy on PyPI
Before you install
Medium install friction due to compiled wheels for multiple platforms and Python versions (3.9–3.14). The package is actively maintained with a recent release (22 days old) and no external runtime dependencies, making it straightforward to deploy once installed.
License in practice
Licensed under MIT, a permissive license that allows commercial and private use with minimal restrictions.
Quickstart
pip install dukpy
import dukpy
# Evaluate JavaScript
result = dukpy.evaljs("var o = {'value': 5}; o['value'] += 3; o")
print(result) # {'value': 8}
# Transpile TypeScript
ts_code = "class Greeter { constructor(public greeting: string) {} }"
js_code = dukpy.typescript_compile(ts_code)
# Transpile JSX
jsx_result = dukpy.jsx_compile('var react_hello = Hello, world!;')
# Compile LESS
less_result = dukpy.less_compile('.class { width: (1 + 1) }')
Verify before relying
- Whether the package's performance is suitable for production workloads involving large or frequent JavaScript evaluations.
- Compatibility and integration details with WebAssets pipelines beyond the documented examples.
- Whether npm package installation via dukpy.install_jspackage is fully functional (description excerpt cuts off mid-sentence).
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 22 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 610,562 / month, #5,765 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaProgramming Language :: JavaScriptProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9 |
Evidence: dukpy-0.6.0-cp310-cp310-macosx_10_9_x86_64.whl; dukpy-0.6.0-cp310-cp310-macosx_11_0_arm64.whl; dukpy-0.6.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; dukpy-0.6.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; dukpy-0.6.0-cp310-cp310-musllinux_1_2_aarch64.whl; dukpy-0.6.0-cp310-cp310-musllinux_1_2_x86_64.whl; dukpy-0.6.0-cp310-cp310-win32.whl; dukpy-0.6.0-cp310-cp310-win_amd64.whl; dukpy-0.6.0-cp311-cp311-macosx_10_9_x86_64.whl; dukpy-0.6.0-cp311-cp311-macosx_11_0_arm64.whl; dukpy-0.6.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; dukpy-0.6.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; dukpy-0.6.0-cp311-cp311-musllinux_1_2_aarch64.whl; dukpy-0.6.0-cp311-cp311-musllinux_1_2_x86_64.whl; dukpy-0.6.0-cp311-cp311-win32.whl; dukpy-0.6.0-cp311-cp311-win_amd64.whl; dukpy-0.6.0-cp312-cp312-macosx_10_13_x86_64.whl; dukpy-0.6.0-cp312-cp312-macosx_11_0_arm64.whl; dukpy-0.6.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; dukpy-0.6.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “javascript interpreter python”
- dukpyDukPy is a JavaScript interpreter for Python that runs JavaScript…
- Js2Py-3.13Js2Py translates and executes JavaScript code (ECMAScript 5.1, with…
- quickjsWraps the QuickJS C library to execute JavaScript code from Python,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Build Tools packages
Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.
Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.
Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.
pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.
Install it if your team needs consistent, automated validation at commit time.
See also jsii · pscript · quickjs-rs · Js2Py · quickjs · Js2Py-3.13 · mini-racer · deno · lesscpy · bfi