Buy this Book
PDF $9.99 Read it Now!
Reprint Licensing
Getting Started with Pyparsing

By Paul McGuire
October 2007 
Pages: 65
Series: Short Cut
Format: PDF
ISBN 10: 0-596-51423-9 | ISBN 13: 9780596514235
(Average of 0 Customer Reviews)

Buy 2 Get 1 Free Free ShippingGuarantee

PDF description

Need to extract data from a text file or a web page? Or do you want to make your application more flexible with user-defined commands or search strings? Do regular expressions and lex/yacc make your eyes blur and your brain hurt?

Pyparsing could be the solution. Pyparsing is a pure-Python class library that makes it easy to build recursive-descent parsers quickly. There is no need to handcraft your own parsing state machine. With pyparsing, you can quickly create HTML page scrapers, logfile data extractors, or complex data structure or command processors. This Short Cut shows you how!

Browse within this PDF

Cover



Featured customer reviews

Write a Review


thank god i only spent 5.99,  February 18 2008
Submitted by Anonymous Reader   [Respond | View]

I am sorry you had such a difficult experience with the examples in the book. The example of parsing data from a table is the first non-trivial example in the book of using pyparsing to combine smaller grammar expressions into larger, more complex expressions, and grouping and naming the returned results. If this example is difficult for you, you really should study it and understand it before moving on to the rest.

At the end of the book is a note box titled "For More Help". It lists a number of online resources for downloading pyparsing examples and discussions.

There is an online article at the O'Reilly OnLAMP Python section, titled "Building Recursive Descent Parsers with Python." (http://www.onlamp.com/pub/a/python/2006/01/26/pyparsing.html?CMP=AFC-ak_article&ATT=Building+Recursive+Descent+Parsers+with+Python) You can also find my pyparsing presentations from PyCon'06 in the pyparsing source and docs distributions in the docs directory. And I think other pyparsing users will agree that I am fairly accessible over the pyparsing mailing list and Wiki discussion forums, to get help on specific questions.

Writing parsers *can* be brain-bending at times. With pyparsing I try to simplify some of the mechanics so that developers can focus on defining and solving their data extraction problems.

(Oddly, before seeing your review I noticed your posting to pastebin.com http://pastebin.com/f1a175c7a, to retrieve data from the weather.com web site and extract it using pyparsing. From this script, I was under the impression that you *do* understand pyparsing, it seems to work well enough. Keep working at it!)

Read all reviews


Getting Started with Pyparsing
See larger cover