====================================
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.3.2 or later.)
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.3.2 or later.)
Documentation
=============
See:
HowToUsePyparsing.html
License
=======
MIT License. See header of pyparsing.py
History
=======
See CHANGES file.
Release files for pyparsing 2.0.2
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.0.2.zip | 1.3 MB | Details | |
| pyparsing-2.0.2.tar.gz | 1.1 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| pyparsing-2.0.2.win32-py3.4.exe | Details | |||
| pyparsing-2.0.2.win32-py3.3.exe | Details | |||
| pyparsing-2.0.2.win32-py3.2.exe | Details | |||
| pyparsing-2.0.2.win32-py3.1.exe | Details | |||
| pyparsing-2.0.2.win32-py3.0.exe | Details | |||
| pyparsing-2.0.2.win32-py2.7.exe | Details | |||
| pyparsing-2.0.2.win32-py2.6.exe | Details |
Total release size: 4.1 MB
Release files / pyparsing-2.0.2.zip
| Download URL | pyparsing-2.0.2.zip |
|---|---|
| Size | 1.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d61cce2ef4bc4eb27d99bc5130e30be1bfbe59fe41e804255f06061cbec0388f
|
|
BLAKE2b-256 checksum How to use checksums |
ca15f11ad041560a392ffa16638a2b500f6cdf4ba873609318187184919f9453
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyparsing-2.0.2.tar.gz
| Download URL | pyparsing-2.0.2.tar.gz |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
17e43d6b17588ed5968735575b3983a952133ec4082596d214d7090b56d48a06
|
|
BLAKE2b-256 checksum How to use checksums |
518671f91a7eb610a925a7b94ac3153c36e72cec85d29d572fc4fd4929d7b255
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyparsing-2.0.2.win32-py3.4.exe
| Download URL | pyparsing-2.0.2.win32-py3.4.exe |
|---|---|
| Size | 232.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7145b41ff85f2428e365f2b9bd16b69bd68f1150c3f8d05528273505ede15abe
|
|
BLAKE2b-256 checksum How to use checksums |
08e8ce1e2d195c0f80565bf48a0fbab49a703acdbda837e15bb64d32153bb541
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyparsing-2.0.2.win32-py3.3.exe
| Download URL | pyparsing-2.0.2.win32-py3.3.exe |
|---|---|
| Size | 232.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1584a093537c6f0add04a514b91b55fda93e2331de7e5140f835d7d8662ea291
|
|
BLAKE2b-256 checksum How to use checksums |
427eb4f6c3ba34a7a1230897697d1f25c5ab4646bb62a1d2b65f006bb8a2d4a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyparsing-2.0.2.win32-py3.2.exe
| Download URL | pyparsing-2.0.2.win32-py3.2.exe |
|---|---|
| Size | 232.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a203a88fc0f0b3c21909de3367ade6b51b2f32abb4e6932bcbf197273593f72
|
|
BLAKE2b-256 checksum How to use checksums |
ed66b1499cfbab6dbadb8893e0df432772ecafbff5540bbc8ed444506d2e9d22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyparsing-2.0.2.win32-py3.1.exe
| Download URL | pyparsing-2.0.2.win32-py3.1.exe |
|---|---|
| Size | 232.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4dda9208817b3a1fe7d500408e4d5ebbb8e4549ba377e6a259ab2552e1275b0b
|
|
BLAKE2b-256 checksum How to use checksums |
bd01dbb7bfd17b480160400661d78501a2621719e3054a55d4372d6e4d5a72be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyparsing-2.0.2.win32-py3.0.exe
| Download URL | pyparsing-2.0.2.win32-py3.0.exe |
|---|---|
| Size | 232.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1039385c4702ba1834f1d5d6a832c3acdb499c7a8ffdd460ba6d381df3c30cda
|
|
BLAKE2b-256 checksum How to use checksums |
b6c7cb021d3fc6769f249a1b7e192f241143a3a7458607cfb9dd55c352af47b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyparsing-2.0.2.win32-py2.7.exe
| Download URL | pyparsing-2.0.2.win32-py2.7.exe |
|---|---|
| Size | 232.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4c2134b09d85dc250422cdd1ab1c4bc4603dd5016f881c2a987c472778a9a14
|
|
BLAKE2b-256 checksum How to use checksums |
5f198027f10c38e03fa09bf976cf38444d90daf7998cbaf99cd54cbaa3abd920
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyparsing-2.0.2.win32-py2.6.exe
| Download URL | pyparsing-2.0.2.win32-py2.6.exe |
|---|---|
| Size | 232.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8e395e5c5c7d95e62b4a6a5311afbf8644b6d5f8280e033aebfca38d1f637486
|
|
BLAKE2b-256 checksum How to use checksums |
afb4d455cddef1ef474f350f900116b3ee51f660ad9a58a23b5ce6543eb9bc4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |