pyparsing is a 100% pure Python parsing package for creating readable parse
engines, using a
library of Python classes with easy-to-understand class names, such as
Literal, Word, Group, OneOrMore, Optional, and so on, combined with
operators such as '+' (for 'and' or 'sequence'), '^' (for 'or' or
'alternation'), '|' (for 'greedy or', selecting first matching alternate),
etc. No separate grammar source file is required, and there is no
The package also includes a growing library of examples, illustrating the
implementation of such parsing tasks as:
- extracting URL's from a web page
- parsing and performing arithmetic expressions
- extracting values from SQL statements
- processing Apache server log files
- interpreting chemical formulas and calculating molecular weight
- parsing and implementing EBNF grammars
Version 1.2.2 - September 27, 2004
- Modified delimitedList to accept an expression as the delimiter, instead
of only accepting strings.
- Modified ParseResults, to convert integer field keys string (to avoid
confusion with list access).
- Modified Combine, to convert all embedded tokens to strings before
- Fixed bug in MatchFirst in which parse actions would be called for
expressions that only partially match. (Thanks, John Hunter!)
- Fixed bug in fourFn.py example that fixes right-associativity of ^
operator. (Thanks, Andrea Griffini!)
- Added class FollowedBy(expression), to look ahead in the input string
without consuming tokens.
- Added class NoMatch that never matches any input. Can be useful in
debugging, and in very specialized grammars.
- Added example pgn.py, for parsing chess game files stored in Portable
Game Notation. (Thanks, Alberto Santini!)