textparser
A text parser library for python.
Decision gist · record as of 2026-08-14
Yes, if you need to parse structured text and performance matters. The library is actively maintained, has no dependencies, requires only Python 3.10+, and benchmarks show it substantially faster than comparable alternatives. MIT license is permissive. Install it if you're building a parser and speed is a priority; skip it if you need error recovery, detailed diagnostics, or support for older Python versions.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction—pure Python wheel with no runtime dependencies and active maintenance (last release 55 days ago).
License · maintenance · safety
MIT (permissive) — MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
last release 2026-06-20 (55 days) · last repo commit 2026-06-20 · 34 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 3,477,089 downloads/mo, #2,607 on PyPI
Alternatives
Verify before relying
pip install textparser
import textparser
from textparser import Sequence
class MyParser(textparser.Parser):
def token_specs(self):
return [('WORD', r'\w+'), ('SKIP', r'[ \t]+')]
def grammar(self):
return Sequence('WORD', 'WORD')
tree = MyParser().parse('hello world')- Whether the parser handles recursive grammars or has depth/complexity limits.
- Error recovery and reporting capabilities beyond the basic parse tree output.
- Memory footprint for large input files or deeply nested grammars.
What it is and what it does
textparser is a Python library for building fast text parsers by defining token specifications and grammar rules. You subclass textparser.Parser, specify how to tokenize input (using regex patterns), and define the grammar structure using combinators like Sequence. The parser then converts text into a parse tree. The library emphasizes speed—benchmarks show it parsing JSON significantly faster than alternatives like pyparsing, lark, and parsy—and takes design cues from PyParsing for a familiar interface.
It has no external runtime dependencies and installs as a pure Python wheel, making it lightweight and easy to integrate. The project is actively maintained and supports modern Python versions (3.10+). It's useful when you need to parse domain-specific languages, configuration files, or structured text formats where performance matters and you want direct control over tokenization and grammar rules.
Use it for
- Parse custom configuration or data file formats where you control both the syntax and the grammar rules.
- Build domain-specific language (DSL) parsers for internal tools or scripting systems.
- Extract structured data from text when regex alone is insufficient but you need faster parsing than general-purpose parser generators.
- Implement protocol or message parsers where performance and predictable behavior are important.
- Create educational or embedded parsers where you want minimal dependencies and direct control over the parsing process.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to parse structured text and performance matters.
The library is actively maintained, has no dependencies, requires only Python 3.10+, and benchmarks show it substantially faster than comparable alternatives. MIT license is permissive. Install it if you're building a parser and speed is a priority; skip it if you need error recovery, detailed diagnostics, or support for older Python versions.
Install
textparser on PyPI
Before you install
Low friction—pure Python wheel with no runtime dependencies and active maintenance (last release 55 days ago). Requires Python 3.10 or later.
Requires Python 3.10 or later.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install textparser
import textparser
from textparser import Sequence
class MyParser(textparser.Parser):
def token_specs(self):
return [('WORD', r'\w+'), ('SKIP', r'[ \t]+')]
def grammar(self):
return Sequence('WORD', 'WORD')
tree = MyParser().parse('hello world')
Verify before relying
- Whether the parser handles recursive grammars or has depth/complexity limits.
- Error recovery and reporting capabilities beyond the basic parse tree output.
- Memory footprint for large input files or deeply nested grammars.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 55 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,477,089 / month, #2,607 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: textparser-0.26.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “text parsing library”
- textparserA fast text parser library that lets you define grammars using token…
- ArpeggioArpeggio is a recursive descent parser with memoization that…
- parsimoniousParsimonious is a pure-Python PEG (parsing expression grammar) parser…
Give your agent the search over MCP, or paste the wish link into any chat.
More Text Processing packages
A drop-in replacement for Python's standard `re` module that adds advanced regex features like nested sets, fuzzy matching, lookaround in conditionals, and full Unicode case-folding while maintaining backward compatibility.
pyparsing provides a library for building text parsers directly in Python code using composable grammar classes, handling quoted strings, whitespace variation, and embedded comments without regex or lex/yacc.
Install it if you need to parse text or define grammars programmatically.
fonttools manipulates font files in multiple formats (TrueType, OpenType, AFM, Type 1, Mac-specific) and includes TTX, a tool to convert fonts to and from XML text format.
Install it if you need to read, write, or manipulate fonts programmatically or via the TTX command-line tool.
Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.
RapidFuzz provides fast fuzzy string matching using Levenshtein Distance and related metrics, implemented mostly in C++ with Python bindings for rapid similarity scoring and approximate string matching.
Install it if you need fuzzy string matching; it's a solid replacement for FuzzyWuzzy with better licensing and performance.
tinycss2 parses CSS strings into token and block objects, and generates CSS strings from those objects, following the CSS Syntax Level 3 specification without enforcing specific properties or values.
Install it if your project requires CSS tokenization or syntax manipulation.
See also pyleri · parsy · Arpeggio · pygmars · mo-parsing · lark-parser · textX · lark-js · lark