pyjsparser
Fast javascript parser (based on esprima.js)
What it is and what it does
pyjsparser is a Python port of the esprima.js JavaScript parser that converts JavaScript source code into an abstract syntax tree. It was designed to be fast and comprehensible, translating esprima's logic directly to Python rather than wrapping a JavaScript engine.
The parser handles ECMAScript 5.1 fully and supports parts of ECMAScript 6. It produces AST output compatible with esprima's format, making it useful for static analysis, code transformation, or tooling that needs to understand JavaScript structure without executing it. However, the package has not been maintained since 2019, so it will not evolve with newer JavaScript standards or receive compatibility updates for recent Python versions.
Use it for:
- Static analysis of JavaScript code to extract variable names, function definitions, or code structure
- Building linters or code quality tools that need to understand JavaScript syntax without running it
- Transforming or transpiling JavaScript code by manipulating its AST representation
- Analyzing third-party JavaScript libraries to understand their API surface or dependencies
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses JavaScript source code into an abstract syntax tree (AST) compatible with esprima.js, supporting ECMAScript 5.1 and parts of ECMAScript 6.
Yes, if you need to parse ECMAScript 5.1 code and can accept an unmaintained package. The parser has no dependencies, installs easily, and carries no known vulnerabilities. However, avoid it for modern JavaScript projects that rely on ES6+ features, and be aware that bugs or Python compatibility issues will not be fixed. Consider whether a maintained alternative better suits your timeline.
Install
pyjsparser on PyPI
pip
pip install pyjsparseruv
uv add pyjsparserpoetry
poetry add pyjsparserInstalling pyjsparser
Before you install
Installation is straightforward with no runtime dependencies. However, the package is abandoned—last release was 2019-04-21 and last commit 2022-04-20—so it will not receive bug fixes or updates for newer JavaScript features or Python versions.
License in practice
Licensed under MIT (permissive), so you may use, modify, and distribute it freely with minimal restrictions, though you must include the license notice.
Quickstart
pip install pyjsparser
from pyjsparser import parse
ast = parse('var $ = "Hello!"')
print(ast)
Verify before relying
- Whether the parser correctly handles all ECMAScript 6 features it claims to support, or only a subset
- Compatibility with modern Python versions given the package's abandonment since 2019
- Performance claim of '100k characters per second' on current hardware and Python versions
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,672 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 694,728/month — #5,313 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyjsparser-2.7.1-py2-none-any.whl
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
esprimaEsprima parses ECMAScript (JavaScript) source…
permissive · top 15,000 on PyPI
esprima2Parses and tokenizes JavaScript code up to ECMA…
permissive · top 15,000 on PyPI
Js2PyJs2Py translates and executes JavaScript code…
permissive · top 5,000 on PyPI
Js2Py-3.13Js2Py translates and executes JavaScript code…
permissive · top 15,000 on PyPI
tree-sitter-javascriptProvides a JavaScript and JSX parser grammar…
permissive · top 5,000 on PyPI
pscriptPScript compiles a Python subset to JavaScript,…
unclear · top 15,000 on PyPI
rjsminrjsmin minifies JavaScript code by removing…
permissive · top 5,000 on PyPI
jsminMinifies JavaScript code by removing…
permissive · top 5,000 on PyPI
py-mini-racerEmbeds a modern V8 JavaScript engine in Python,…
permissive · top 5,000 on PyPI
quickjs-rsExecutes JavaScript code inside a WebAssembly…
permissive · top 15,000 on PyPI