spark-parser
An Earley-Algorithm Context-free grammar Parser Toolkit
What it is and what it does
spark-parser provides a toolkit for building parsers using Jay Earley's algorithm, which handles context-free grammars efficiently, especially left-recursive ones. It includes utilities for constructing Abstract Syntax Trees and a scanner built from Python regular expressions. The package originated from academic work (Aycock's 1998 paper) and has been maintained for practical use in projects like decompilers and code analysis tools.
The package supports a wide range of Python versions from 2.4 through 3.12 via separate git branches and wheels. It offers specialized features like grammar rule profiling to identify unused rules, the ability to remove rules after addition, and callback checks before reduction rules—capabilities designed for dynamic grammar manipulation in decompilers and code analysis tools.
Use it for:
- Building a decompiler or bytecode analyzer that needs to parse and reconstruct code structures.
- Implementing a domain-specific language (DSL) parser where you control the grammar and need AST generation.
- Profiling and optimizing grammar rules by tracking which rules are actually used across many parses.
- Parsing configuration files or markup formats defined by context-free grammars.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements an Earley algorithm parser for context-free grammars with Abstract Syntax Tree support and a regex-based scanner.
Yes, if you need an Earley parser for context-free grammars and can tolerate dormant maintenance. The package is stable (Production/Stable status), has no known vulnerabilities, installs easily, and works across modern Python versions. Most suitable for specialized use cases like decompilation or DSL parsing where its grammar manipulation features add value. Not recommended if you need active maintenance or support.
Install
spark-parser on PyPI
pip
pip install spark-parseruv
uv add spark-parserpoetry
poetry add spark-parserInstalling spark-parser
Before you install
Low friction installation with wheels for Python 2.7 through 3.12. Maintenance is dormant (675 days since last release), though the repository remains active with a recent commit in December 2024.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions.
Quickstart
pip install spark-parser
from spark_parser import GenericParser, GenericScanner
class MyParser(GenericParser):
def __init__(self):
GenericParser.__init__(self)
# Define grammar rules here
parser = MyParser()
result = parser.parse(tokens)
Verify before relying
- Whether the package's dormant maintenance status affects compatibility with Python versions beyond those explicitly listed in classifiers.
- Performance characteristics when parsing large or deeply nested grammars compared to other Earley implementations.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 675 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 513,194/month — #6,249 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: spark_parser-1.9.0-py2-none-any.whl; spark_parser-1.9.0-py310-none-any.whl; spark_parser-1.9.0-py311-none-any.whl; spark_parser-1.9.0-py312-none-any.whl; spark_parser-1.9.0-py313-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
lark-parserLark is a parsing library that builds abstract…
permissive · top 5,000 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
lark-jsLark-js is a command-line tool that generates…
permissive · top 15,000 on PyPI
pygmarsPygmars builds lightweight lexers and parsers…
permissive · top 15,000 on PyPI
ParsleyParsley is a PEG-based parsing library that…
permissive · top 5,000 on PyPI
PyMeta3PyMeta3 compiles pattern-matching grammars…
permissive · top 15,000 on PyPI
textparserA fast text parser library that lets you define…
permissive · top 5,000 on PyPI
tree-sitter-typescriptProvides TypeScript and TSX language grammars…
permissive · top 5,000 on PyPI
parsimoniousParsimonious is a pure-Python PEG (parsing…
permissive · top 5,000 on PyPI
llguidanceEnforces structured output from large language…
permissive · top 5,000 on PyPI