0%

Book 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!

Table of Contents

  1. Getting Started with Pyparsing
    1. What Is Pyparsing?
    2. Basic Form of a Pyparsing Program
      1. Import Names from Pyparsing
      2. Define the Grammar
      3. Use the Grammar to Parse the Input Text
      4. Process the Results from Parsing the Input Text
    3. "Hello, World!" on Steroids!
    4. What Makes Pyparsing So Special?
    5. Parsing Data from a Table—Using Parse Actions and ParseResults
    6. Extracting Data from a Web Page
    7. A Simple S-Expression Parser
    8. A Complete S-Expression Parser
    9. Parsing a Search String
    10. Search Engine in 100 Lines of Code
    11. Conclusion
    12. Index
    13. About the Author
18.225.255.178