skillfed

py-mini-racer

Minimal, modern embedded V8 for Python.

py-mini-racer v0.6.0 1.3M downloads/30d#4,130 on PyPI768
Permissive license ISCL DORMANT released

What it is and what it does

py-mini-racer wraps the V8 JavaScript engine in a Python-accessible interface, letting you execute JavaScript code and WebAssembly modules directly from Python. It maintains isolated execution contexts where variables persist across calls, supports both simple eval operations (returning primitives) and function calls (returning JSON-serializable objects), and provides heap statistics for memory monitoring.

The package is commonly used in web frameworks like Django and Flask for asset minification, transpilation (e.g., running Babel), and executing WASM modules. It handles Unicode correctly, is thread-safe, and supports modern JavaScript (ES6+). Installation is straightforward via prebuilt wheels for common platforms, though building from source is resource-intensive.

Use it for:

  • Minify or transpile JavaScript assets in Django or Flask projects without spawning external Node.js processes.
  • Execute WebAssembly modules from Python with full V8 support.
  • Run JavaScript unit tests or code snippets as part of a Python test suite.
  • Evaluate dynamic JavaScript expressions with persistent state across multiple calls.
  • Serialize complex JavaScript objects back to Python as JSON-compatible dictionaries.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Embeds a modern V8 JavaScript engine in Python, allowing you to execute JavaScript code and call functions from Python with full ECMAScript and WebAssembly support.

Yes, if you need embedded JavaScript execution and can accept dormant maintenance. The package is stable (Production/Stable status), has no known vulnerabilities, and prebuilt wheels make installation straightforward on common platforms. However, the 1940-day gap since the last release and dormant repository status mean you should verify compatibility with your target Python and V8 versions before committing to production use, and be prepared to maintain a fork if critical issues arise.

Install

py-mini-racer on PyPI

pip

pip install py-mini-racer

uv

uv add py-mini-racer

poetry

poetry add py-mini-racer

Installing py-mini-racer

Before you install

Medium install friction due to binary wheel dependencies; prebuilt wheels available for macOS, Linux, and Windows x86_64, but source builds require several GB of disk space and ~60 minutes. Last release was 1940 days ago; repository is dormant but not archived, with no recent commits since 2024-06-15.

License in practice

ISC License (permissive) imposes minimal restrictions; you may use, modify, and distribute the package freely with minimal attribution requirements.

Quickstart

pip install py-mini-racer

from py_mini_racer import MiniRacer
ctx = MiniRacer()
result = ctx.eval("1+1")
print(result)  # 2

Requires prebuilt binary wheel for your platform (macOS ≥10.13, Ubuntu ≥16.04, Windows 10, or compatible Linux with libc ≥2.12); Alpine Linux may require manual installation of libgcc and libstdc++.

Verify before relying

  • Whether the dormant maintenance status (last release April 2021, last commit June 2024) poses a risk for future Python or V8 compatibility.
  • Performance characteristics and memory overhead compared to other embedded JavaScript solutions.
  • Whether the strict mode default (introduced in 0.6.0) affects compatibility with existing JavaScript code.

Package facts

License ISCL (permissive)
Python support not specified
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance dormant — 1,940 days since the last release
Last repo commit
First released
Downloads 1,269,718/month — #4,130 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: py_mini_racer-0.6.0-py2.py3-none-macosx_10_10_x86_64.whl; py_mini_racer-0.6.0-py2.py3-none-manylinux1_x86_64.whl; py_mini_racer-0.6.0-py2.py3-none-win_amd64.whl

Keywords: py_mini_racer

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: ISC License (ISCL)Natural Language :: EnglishProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3

Tags

javascript execution in pythonembed v8 enginerun javascript from pythonwasm support pythonjavascript eval pythones6 javascript runtimeminify assets python
javascript-runtimev8-enginewasm

More Software Development packages