skillfed

mini-racer

Minimal, modern embedded V8 for Python.

mini-racer v0.14.1 1.6M downloads/30d#3,770 on PyPI217
Permissive license ISC AGING released

What it is and what it does

mini-racer is a Python binding to Google's V8 JavaScript engine that lets you run JavaScript code directly from Python. It supports modern ECMAScript, WebAssembly, and Unicode, and handles data marshalling between Python and JavaScript transparently—JavaScript objects become Python dicts, arrays become lists, and functions can be called from either side. The package is thread-safe and allows you to create reusable execution contexts.

You can evaluate expressions synchronously with timeout protection, call JavaScript functions from Python, handle promises asynchronously, and integrate with asyncio. It's commonly used in web projects for asset minification, transpilation, and running WebAssembly modules. The package manages its own event loop internally or integrates with existing asyncio loops, making it suitable for both sync and async Python code.

Use it for:

  • Minify or transpile JavaScript assets in web applications without Node.js
  • Run Babel or other JavaScript build tools directly from Python for server-side asset processing
  • Execute WebAssembly modules from Python with JavaScript glue code
  • Evaluate dynamic JavaScript expressions or user-supplied scripts with timeout protection
  • Call JavaScript utility functions or libraries from Python without subprocess overhead

Worth the install?

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

Embeds Google's V8 JavaScript engine in Python, allowing you to execute JavaScript code, evaluate expressions, and call functions with full ES6+ and WebAssembly support.

Yes, if you need to run JavaScript in Python without external dependencies like Node.js. The ISC license is permissive, install friction is moderate but manageable with prebuilt wheels, and there are no known vulnerabilities. Maintenance is aging (194 days since last release) but the repository is active. Best suited for projects that already depend on Python >= 3.10 and can tolerate platform-specific wheel installation.

Install

mini-racer on PyPI

pip

pip install mini-racer

uv

uv add mini-racer

poetry

poetry add mini-racer

Installing mini-racer

Before you install

Medium install friction due to compiled wheels for multiple platforms (macOS x86_64 and arm64, Linux x86_64 and aarch64, Windows x86_64 and arm64, musl variants). No runtime dependencies. Maintenance status is aging—last release 194 days ago, but repository is active and not archived.

License in practice

Licensed under ISC (permissive), allowing commercial and private use with minimal restrictions; suitable for most projects.

Quickstart

pip install mini-racer

from mini_racer import MiniRacer
ctx = MiniRacer()
result = ctx.eval("1 + 1")
print(result)

Requires Python >= 3.10. Platform-specific compiled wheels; installation may fail on unsupported architectures.

Verify before relying

  • Performance characteristics compared to other V8 bindings or JavaScript runtimes in Python
  • Memory overhead and heap management behavior under sustained or high-volume evaluation
  • Thread safety guarantees and concurrent evaluation limits across multiple contexts
  • Whether timeout_sec parameter is available in all evaluation modes

Package facts

License ISC (permissive)
Python support supports the current Python release (>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance aging — 194 days since the last release
Last repo commit
First released
Downloads 1,554,509/month — #3,770 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mini_racer-0.14.1-py3-none-macosx_10_9_x86_64.whl; mini_racer-0.14.1-py3-none-macosx_11_0_arm64.whl; mini_racer-0.14.1-py3-none-manylinux_2_27_aarch64.whl; mini_racer-0.14.1-py3-none-manylinux_2_27_x86_64.whl; mini_racer-0.14.1-py3-none-musllinux_1_2_aarch64.whl; mini_racer-0.14.1-py3-none-musllinux_1_2_x86_64.whl; mini_racer-0.14.1-py3-none-win_amd64.whl; mini_racer-0.14.1-py3-none-win_arm64.whl

Keywords: py_mini_racer

Development Status :: 5 - Production/StableIntended Audience :: DevelopersNatural Language :: EnglishProgramming Language :: Python :: 3

Tags

javascript execution in pythonv8 engine python bindingrun javascript from pythonembedded javascript interpreterpython javascript bridgeexecute es6 code pythonwasm support python
javascript-runtimev8-bindingasync-capable

More Software Development packages