funcparserlib
Recursive descent parsing library based on functional combinators
What it is and what it does
Funcparserlib is a pure-Python parsing library built around functional combinators—small, composable parsing functions that you chain together to build larger parsers. It is designed for parsing little languages and external DSLs (domain-specific languages) where you need to tokenize input and then parse it into a structured form. The library includes both a lexer generator (for tokenization with position tracking) and a parser combinator framework, and it emphasizes ease of use over raw performance, making it practical for cases where you need to parse custom syntax without the complexity of traditional parser generators.
The package has no external dependencies, supports Python 2.7 through 3.11, and is fully type-hinted. It is mature and dormant—last released in November 2022 with a final commit in May 2024—indicating stability rather than active development. Real-world use includes projects like Hy (a Lisp dialect embedded in Python), Splash (a JavaScript rendering service), and blockdiag (a diagram generator), all of which rely on funcparserlib to parse their respective DSLs.
Use it for:
- Build a custom configuration file parser that reads a domain-specific syntax and converts it into Python objects.
- Implement a simple expression evaluator or calculator that parses and evaluates mathematical expressions with operator precedence.
- Parse a custom query language or filter syntax for a data processing tool.
- Create a code generator or transpiler that reads a custom language and outputs Python or another target language.
- Build a JSON or data-format parser as an alternative to hand-written recursive descent code.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Funcparserlib is a recursive descent parsing library that lets you build LL(*) parsers for little languages and domain-specific languages using functional combinators, with a built-in lexer generator for token tracking.
Yes, if you need to parse a custom language or DSL and want a lightweight, dependency-free solution. The library is mature, well-documented, and proven in production use. Its dormant status is not a concern—it is feature-complete and stable. Install it only if you are comfortable with recursive descent parsing's performance characteristics (adequate for small to medium grammars but slower than LR/LALR parsers for large ones).
Install
funcparserlib on PyPI
pip
pip install funcparserlibuv
uv add funcparserlibpoetry
poetry add funcparserlibInstalling funcparserlib
Before you install
Installation is straightforward with no external dependencies. The package is dormant (last release 2022-11-03, last commit 2024-05-04) but marked Production/Stable and has been in use since 2009, suggesting it is mature and unlikely to require frequent updates.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions—you may use, modify, and distribute funcparserlib freely as long as you include the license notice.
Quickstart
from funcparserlib.lexer import make_tokenizer, TokenSpec
from funcparserlib.parser import tok, many, forward_decl
specs = [TokenSpec("int", r"\d+")]
tokenizer = make_tokenizer(specs)
tokens = tokenizer("test")
int_num = tok("int") >> int
result = int_num.parse(tokens)
Verify before relying
- Whether the package's claimed performance advantage over PyParsing (at least twice faster) has been independently verified.
- Whether the 1.2K lines of code metric is current as of version 1.0.1.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 1,380 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 202,314/month — #9,649 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: funcparserlib-1.0.1-py2.py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
slySLY is a pure-Python implementation of lex and…
permissive · top 5,000 on PyPI
plyPLY is a lexer and parser generator for Python…
permissive · top 1,000 on PyPI
javalangjavalang is a pure Python lexer and parser for…
permissive · top 15,000 on PyPI
parsyParsy is a parser combinator library that lets…
permissive · top 5,000 on PyPI
ArpeggioArpeggio is a recursive descent parser with…
permissive · top 5,000 on PyPI
mo-parsingmo-parsing is a PEG parser generator that lets…
permissive · top 15,000 on PyPI
rplyRPLY is a pure Python parser generator that…
permissive · top 15,000 on PyPI
textparserA fast text parser library that lets you define…
permissive · top 5,000 on PyPI
ParsleyParsley is a PEG-based parsing library that…
permissive · top 5,000 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI