Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 7d3d6e5bed16fe556d7983604bb8c690 > files > 11

python-parsing-1.4.2-8mdv2010.0.noarch.rpm

<HTML>
<title>pyparsing Examples</title>
<body>
<h1>pyparsing Examples</h1>
<p>
This directory contains a number of Python scripts that can get you started in learning to use pyparsing.

<ul>
<li><a href="greeting.py">greeting.py</a><br>
Parse "Hello, World!".
</li>
<p>

<li><a href="greetingInKorean.py">greetingInKorean.py</a> <i>~ submission by June Kim</i><br>
Unicode example to parse "Hello, World!" in Korean.
</li>
<p>

<li><a href="greetingInGreek.py">greetingInGreek.py</a> <i>~ submission by ???</i><br>
Unicode example to parse "Hello, World!" in Greek.
</li>
<p>

<li><a href="chemicalFormulas.py">chemicalFormulas.py</a><br>
Simple example to demonstrate the use of ParseResults returned from parseString().  
Parses a chemical formula (such as "H2O" or "C6H5OH"), and walks the returned list of tokens to calculate the molecular weight.
</li>
<p>

<li><a href="wordsToNum.py">wordsToNum.py</a><br>
A sample program that reads a number in words (such as "fifteen hundred and sixty four"), and returns the actual number (1564).
Also demonstrates some processing of ParseExceptions, including marking where the parse failure was found.
</li>
<p>

<li><a href="pythonGrammarparser.py">pythonGrammarparser.py</a> <i>~ suggested by JH Stovall</i>
<br><b>New in version 1.4.2</b><br>
A sample program that parses the EBNF used in the Python source code to define the Python grammar.  From this parser,
one can generate Python grammar documentation tools, such as railroad track diagrams.  Also demonstrates use of
Dict class.
</li>
<p>

<li><a href="commasep.py">commasep.py</a><br>
Demonstration of the use of the commaSeparatedList helper.  Shows examples of
proper handling of commas within quotes, trimming of whitespace around delimited entries, and handling of consecutive commas (null arguments).  Includes comparison with simple string.split(',').
</li>
<p>

<li><a href="dictExample.py">dictExample.py</a><br>
A demonstration of using the Dict class, to parse a table of ASCII tabulated data.
</li>
<p>

<li><a href="dictExample2.py">dictExample2.py</a> <i>~ submission by Mike Kelly</i><br>
An extended version of dictExample.py, in which Mike Kelly also parses the column headers, and generates a transposed version of the original table!
</li>
<p>

<li><a href="scanExamples.py">scanExamples.py</a><br>
Some examples of using scanString and transformString, as alternative parsing methods to parseString, to do macro substitution, and selection and/or removal of matching strings within a source file.
</li>
<p>

<li><a href="urlExtractor.py">urlExtractor.py</a><br>
Another example using scanString, this time to extract all HREF references found on Yahoo!'s home page, and return them as a dictionary.
</li>
<p>

<li><a href="makeHTMLTagExample.py">makeHTMLTagExample.py</a><br>
A sample program showing sample definitions and applications of HTML tag expressions
created using makeHTMLTags helper function.  Very useful for scraping data from HTML pages.
</li>
<p>

<li><a href="urlExtractorNew.py">urlExtractorNew.py</a><br>
Another updated version of urlExtractor.py, using the new makeHTMLTags() method.
</li>
<p>

<li><a href="fourFn.py">fourFn.py</a><br>
A simple algebraic expression parser, that performs +,-,*,/, and ^ arithmetic operations.  (With suggestions and bug-fixes graciously offered by Andrea Griffini.)
</li>
<p>

<li><a href="SimpleCalc.py">SimpleCalc.py</a> <i>~ submission by Steven Siew</i><br>
An interactive version of fourFn.py, with support for variables.
</li>
<p>

<li><a href="LAParser.py">LAParser.py</a> <i>~ submission by Mike Ellis</i><br>
An interactive Linear Algebra Parser, an extension of SimpleCalc.py.  Supports linear algebra (LA) notation for vectors, matrices, and scalars,
including matrix operations such as inversion and determinants.  Converts LA expressions to C code - uses a separate C library for runtime
evaluation of results.
</li>
<p>

<li><a href="configParse.py">configParse.py</a><br>
A simple alternative to Python's ConfigParse module, demonstrating the use of the Dict class to return nested dictionary access to configuration values.
</li>
<p>

<li><a href="getNTPservers.py">getNTPservers.py</a><br>
Yet another scanString example, to read/extract the list of NTP servers from NIST's web site.
</li>
<p>

<li><a href="getNTPserversNew.py">getNTPserversNew.py</a><br>
An updated version of getNTPservers.py, using the new makeHTMLTags() method.
</li>
<p>

<li><a href="httpServerLogParser.py">httpServerLogParser.py</a><br>
Parser for Apache server log files.
</li>
<p>

<li><a href="idlParse.py">idlParse.py</a><br>
Parser for CORBA IDL files.
</li>
<p>

<li><a href="mozillaCalendarParser.py">mozillaCalendarParser.py</a> 
<i>~ submission by Petri Savolainen</i><br>
Parser for Mozilla calendar (*.ics) files.
</li>
<p>

<li><a href="pgn.py">pgn.py</a> <i>~ submission by Alberto Santini</i><br>
Parser for PGN (Portable Game Notation) files, the standard form for documenting the moves in chess games.
</li>
<p>

<li><a href="simpleSQL.py">simpleSQL.py</a><br>
A simple parser that will extract table and column names from SQL SELECT statements..
</li>
<p>

<li><a href="dfmparse.py">dfmparse.py</a> <i>~ submission by Dan Griffith</i><br>
Parser for Delphi forms.
</li>
<p>

<li><a href="ebnf.py">ebnf.py / ebnftest.py</a> <i>~ submission by Seo Sanghyeon</i><br>
An EBNF-compiler that reads EBNF and generates a pyparsing grammar!  Including a test that compiles... EBNF itself!
</li>
<p>

<li><a href="searchparser.py">searchparser.py</a> <i>~ submission by Steven Mooij and Rudolph Froger
</i><br><b>New in version 1.4.2</b><br>
An expression parser that parses search strings, with special keyword and expression operations using (), not, and, or, and quoted strings.
</li>
<p>

<li><a href="sparser.py">sparser.py</a> <i>~ submission by Tim Cera
</i><br><b>New in version 1.4.2</b><br>
A configurable parser module that can be configured with a list of tuples, giving a high-level definition for parsing common sets
of water table data files.  Tim had to contend with several different styles of data file formats, each with slight variations of its own.
Tim created a configurable parser (or "SPECIFIED parser" - hence the name "sparser"), that simply works from a config variable listing
the field names and data types, and implicitly, their order in the source data file.
<p>
See <a href="mayport_florida_8720220_data_def.txt">mayport_florida_8720220_data_def.txt</a> for an
example configuration file.
</li>
<p>

<li><a href="romanNumerals.py">romanNumerals.py</a>
<br><b>New in version 1.4.2</b><br>
A Roman numeral generator and parser example, showing the power of parse actions 
to compile Roman numerals into their integer values.
</li>
<p>



</ul>

</body></html>