--- id: spark-parser version: "1.9.0" license: MIT license_treatment: permissive maintenance: dormant --- # spark-parser — An Earley-Algorithm Context-free grammar Parser Toolkit License: permissive · Maintenance: dormant · Downloads: 513.2K/mo ## 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 above — 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 pip install spark-parser uv add spark-parser poetry add spark-parser ## Installing 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: unspecified - Install friction: low - Maintenance: dormant - Downloads: 513.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags earley algorithm parser, context-free grammar parsing, python parser toolkit, ast generation, grammar-based parsing, parsing, grammar, earley-algorithm [View on SkillFed](https://skillfed.io/packages/spark-parser) · [View on PyPI](https://pypi.org/project/spark-parser/)