====================================
PyParsing -- A Python Parsing Module
====================================
Introduction
============
The pyparsing module is an alternative approach to creating and executing
simple grammars, vs. the traditional lex/yacc approach, or the use of
regular expressions. The pyparsing module provides a library of classes
that client code uses to construct the grammar directly in Python code.
Here is a program to parse "Hello, World!" (or any greeting of the form
"<salutation>, <addressee>!"):
from pyparsing import Word, alphas
greet = Word( alphas ) + "," + Word( alphas ) + "!"
hello = "Hello, World!"
print hello, "->", greet.parseString( hello )
The program outputs the following:
Hello, World! -> ['Hello', ',', 'World', '!']
The Python representation of the grammar is quite readable, owing to the
self-explanatory class names, and the use of '+', '|' and '^' operator
definitions.
The parsed results returned from parseString() can be accessed as a
nested list, a dictionary, or an object with named attributes.
The pyparsing module handles some of the problems that are typically
vexing when writing text parsers:
- extra or missing whitespace (the above program will also handle
"Hello,World!", "Hello , World !", etc.)
- quoted strings
- embedded comments
The .zip file includes examples of a simple SQL parser, simple CORBA IDL
parser, a config file parser, a chemical formula parser, and a four-
function algebraic notation parser. It also includes a simple how-to
document, and a UML class diagram of the library's classes.
Installation
============
Do the usual:
python setup.py install
(pyparsing requires Python 2.6 or later.)
Or corresponding commands using pip, easy_install, or wheel:
pip install pyparsing
easy_install pyparsing
wheel install pyparsing
Documentation
=============
See:
HowToUsePyparsing.html
License
=======
MIT License. See header of pyparsing.py
History
=======
See CHANGES file.
PyParsing -- A Python Parsing Module
====================================
Introduction
============
The pyparsing module is an alternative approach to creating and executing
simple grammars, vs. the traditional lex/yacc approach, or the use of
regular expressions. The pyparsing module provides a library of classes
that client code uses to construct the grammar directly in Python code.
Here is a program to parse "Hello, World!" (or any greeting of the form
"<salutation>, <addressee>!"):
from pyparsing import Word, alphas
greet = Word( alphas ) + "," + Word( alphas ) + "!"
hello = "Hello, World!"
print hello, "->", greet.parseString( hello )
The program outputs the following:
Hello, World! -> ['Hello', ',', 'World', '!']
The Python representation of the grammar is quite readable, owing to the
self-explanatory class names, and the use of '+', '|' and '^' operator
definitions.
The parsed results returned from parseString() can be accessed as a
nested list, a dictionary, or an object with named attributes.
The pyparsing module handles some of the problems that are typically
vexing when writing text parsers:
- extra or missing whitespace (the above program will also handle
"Hello,World!", "Hello , World !", etc.)
- quoted strings
- embedded comments
The .zip file includes examples of a simple SQL parser, simple CORBA IDL
parser, a config file parser, a chemical formula parser, and a four-
function algebraic notation parser. It also includes a simple how-to
document, and a UML class diagram of the library's classes.
Installation
============
Do the usual:
python setup.py install
(pyparsing requires Python 2.6 or later.)
Or corresponding commands using pip, easy_install, or wheel:
pip install pyparsing
easy_install pyparsing
wheel install pyparsing
Documentation
=============
See:
HowToUsePyparsing.html
License
=======
MIT License. See header of pyparsing.py
History
=======
See CHANGES file.
Release files for pyparsing 2.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distributions (sdists)
| File | Size | Uploaded | |
|---|---|---|---|
| pyparsing-2.1.6.zip | 1.4 MB | Details | |
| pyparsing-2.1.6.tar.gz | 1.2 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| pyparsing-2.1.6.win32-py3.5.exe | Details | |||
| pyparsing-2.1.6.win32-py3.4.exe | Details | |||
| pyparsing-2.1.6.win32-py3.3.exe | Details | |||
| pyparsing-2.1.6.win32-py2.7.exe | Details | |||
| pyparsing-2.1.6.win32-py2.6.exe | Details | |||
| pyparsing-2.1.6-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size:4.2 MB
Release files / pyparsing-2.1.6.zip
| Download URL | pyparsing-2.1.6.zip |
|---|---|
| Size | 1.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10edd0cc2d1dd275bff4ce9bd852b8dcfb6f3b25eafff6e4e0d7e3dd06ffb67b
|
|
BLAKE2b-256 checksum How to use checksums |
cb646f82f2b126cdf7e4d081f3a025ba216b048bc13fa060e8c78ad2556eefc5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyparsing-2.1.6.tar.gz
| Download URL | pyparsing-2.1.6.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3bbdeb6ba83077136cebf642fb0ac526a4230f72944e7f6a240df2fdd83c6e66
|
|
BLAKE2b-256 checksum How to use checksums |
e885de26a00e3dc11062bd0794a365993c0e67550875592c86faad9802c05b83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyparsing-2.1.6.win32-py3.5.exe
| Download URL | pyparsing-2.1.6.win32-py3.5.exe |
|---|---|
| Size | 514.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b333729b0af946c804e6fa92f4d195669e773714acfc82270490a706a0a67908
|
|
BLAKE2b-256 checksum How to use checksums |
f706f18c830c4ea41eb020c5496e6942fd49e65678d4c5dc70ba0d0f50764605
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyparsing-2.1.6.win32-py3.4.exe
| Download URL | pyparsing-2.1.6.win32-py3.4.exe |
|---|---|
| Size | 245.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71c1b68be6673cde83dc51a7eb689119b2d48fbfa07f281de3987f54c332a400
|
|
BLAKE2b-256 checksum How to use checksums |
0eb21c51c02cbe7f158b038e51f114aac2c093143838e7ed3c12ab0c1b06c8f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyparsing-2.1.6.win32-py3.3.exe
| Download URL | pyparsing-2.1.6.win32-py3.3.exe |
|---|---|
| Size | 245.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b19719a54e8739018b3fbd76817b37e6b989398b37e237f26ed5fe9805cd1bb
|
|
BLAKE2b-256 checksum How to use checksums |
a8abc1309c9ec63f9115876cca63514546ad450fe6c2747fbe3e7deea53bf766
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyparsing-2.1.6.win32-py2.7.exe
| Download URL | pyparsing-2.1.6.win32-py2.7.exe |
|---|---|
| Size | 250.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5ee62fd9d796c9e289c0856b14189e01291c9a6c52070c13daa788b66196794d
|
|
BLAKE2b-256 checksum How to use checksums |
276153cfaa174b6f80b51e4d1dcdfb97fdf8cb77b8e055fe9c19a4740d86823f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyparsing-2.1.6.win32-py2.6.exe
| Download URL | pyparsing-2.1.6.win32-py2.6.exe |
|---|---|
| Size | 250.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d6a365d01510b59e21b85f00d0f66a722cd6399888d5818beaafc7ee3d886f8
|
|
BLAKE2b-256 checksum How to use checksums |
ecd1c055408d6a9c51402e73b3c248feb889aa52d224cdef990ea258d21b5840
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyparsing-2.1.6-py2.py3-none-any.whl
| Download URL | pyparsing-2.1.6-py2.py3-none-any.whl |
|---|---|
| Size | 53.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
5534719f4abaac4efd93c295f9aad9d10f516dd7d1a5cf7f0af7eed5fdad9524
|
|
BLAKE2b-256 checksum How to use checksums |
82e244fd113b9be057848a30cba3ed238a534814b5266ffc9402605f3a1707ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |