Discussion:
[Pyparsing] pyparsing quick reference now available
John W. Shipman
2013-03-07 22:53:11 UTC
Permalink
Here is a new resource for pyparsing users:

http://www.nmt.edu/tcc/help/pubs/pyparsing
pyparsing quick reference: A Python text processing tool

This is a supplement to, not a replacement for, the online
reference documentation. There are lots of short conversational
examples showing how the various features work. It should not be
construed as the official word on any pyparsing feature, although
we will of course strive to make it match how the software works
and speedily evaluate any corrections or suggestions.

This document is available as a 48-page PDF as well as a fully
chunked HTML version. I wrote it in part because I'm a
paper-oriented dinosaur and the online docs are unprintable.

There is a section on how to structure large complex ParseResults
instances, based on principles I worked out in my latest
pyparsing project.

Not every feature is covered. I left out a few features because
I couldn't understand what they were for or how they worked.
Also omitted were all the SGML/XML-family features because in my
personal opinion the lxml module is vastly superior for reading
or writing such documents.

Also linked within this document are two extended examples.

1. http://www.nmt.edu/~shipman/aba/raw/doc/ims
abaraw internal maintenance specification

This script parses a free-field data format and writes XML.
There are about 30 productions in the grammar. It implements
the grammar described in the accommpanying spec:

http://www.nmt.edu/~shipman/aba/raw/doc
abaraw: A shorthand notation for bird records

2. http://www.nmt.edu/tcc/help/lang/python/examples/icalparse/

A parser for the "old ical", a Unix calendar program.
The grammar has about a dozen productions. Includes an
example of the Forward pattern.

Best regards,
John Shipman (***@nmt.edu), Applications Specialist
New Mexico Tech Computer Center, Speare 146, Socorro, NM 87801
(575) 835-5735, http://www.nmt.edu/~john
``Let's go outside and commiserate with nature.'' --Dave Farber

Loading...