skillfed

pyjsparser

Fast javascript parser (based on esprima.js)

pyjsparser v2.7.1 694.7K downloads/30d#5,313 on PyPI255
Permissive license MIT Abandoned released

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 pyjsparser

uv

uv add pyjsparser

poetry

poetry add pyjsparser

Installing 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

javascript parser pythonparse javascript code astecmascript parserjs to ast conversionesprima pythonjavascript syntax tree
ast-parsingjavascript-analysis

More Text Processing packages