skillfed

funcparserlib

Recursive descent parsing library based on functional combinators

funcparserlib v1.0.1 202.3K downloads/30d#9,649 on PyPI360
Permissive license MIT DORMANT released

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 funcparserlib

uv

uv add funcparserlib

poetry

poetry add funcparserlib

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

recursive descent parserparser combinators pythondsl parsing librarydomain specific language parserfunctional parsinglexer and parser generatorLL parser library
parsingdslcombinators

More Software Development packages