src/pyparsing-3.3.2.dist-info/METADATA
1Metadata-Version: 2.4
2Name: pyparsing
3Version: 3.3.2
4Summary: pyparsing - Classes and methods to define and execute parsing grammars
5Author-email: Paul McGuire <ptmcg.gm+pyparsing@gmail.com>
6Requires-Python: >=3.9
7Description-Content-Type: text/x-rst
8License-Expression: MIT
9Classifier: Development Status :: 5 - Production/Stable
10Classifier: Intended Audience :: Developers
11Classifier: Intended Audience :: Information Technology
12Classifier: Operating System :: OS Independent
13Classifier: Programming Language :: Python
14Classifier: Programming Language :: Python :: 3
15Classifier: Programming Language :: Python :: 3.9
16Classifier: Programming Language :: Python :: 3.10
17Classifier: Programming Language :: Python :: 3.11
18Classifier: Programming Language :: Python :: 3.12
19Classifier: Programming Language :: Python :: 3.13
20Classifier: Programming Language :: Python :: 3.14
21Classifier: Programming Language :: Python :: 3 :: Only
22Classifier: Programming Language :: Python :: Implementation :: CPython
23Classifier: Programming Language :: Python :: Implementation :: PyPy
24Classifier: Topic :: Software Development :: Compilers
25Classifier: Topic :: Text Processing
26Classifier: Typing :: Typed
27License-File: LICENSE
28Requires-Dist: railroad-diagrams ; extra == "diagrams"
29Requires-Dist: jinja2 ; extra == "diagrams"
30Project-URL: Documentation, https://pyparsing-docs.readthedocs.io/en/latest/
31Project-URL: Homepage, https://github.com/pyparsing/pyparsing/
32Project-URL: Source, https://github.com/pyparsing/pyparsing.git
33Provides-Extra: diagrams
34
35PyParsing -- A Python Parsing Module
36====================================
37
38|Version| |Build Status| |Coverage| |License| |Python Versions| |Snyk Score|
39
40Introduction
41============
42
43The pyparsing module is an alternative approach to creating and
44executing simple grammars, vs. the traditional lex/yacc approach, or the
45use of regular expressions. The pyparsing module provides a library of
46classes that client code uses to construct the grammar directly in
47Python code.
48
49*[Since first writing this description of pyparsing in late 2003, this
50technique for developing parsers has become more widespread, under the
51name Parsing Expression Grammars - PEGs. See more information on PEGs*
52`here <https://en.wikipedia.org/wiki/Parsing_expression_grammar>`__
53*.]*
54
55Here is a program to parse ``"Hello, World!"`` (or any greeting of the form
56``"salutation, addressee!"``):
57
58.. code:: python
59
60 from pyparsing import Word, alphas
61 greet = Word(alphas) + "," + Word(alphas) + "!"
62 hello = "Hello, World!"
63 print(hello, "->", greet.parse_string(hello))
64
65The program outputs the following::
66
67 Hello, World! -> ['Hello', ',', 'World', '!']
68
69The Python representation of the grammar is quite readable, owing to the
70self-explanatory class names, and the use of '+', '|' and '^' operator
71definitions.
72
73The parsed results returned from ``parse_string()`` is a collection of type
74``ParseResults``, which can be accessed as a
75nested list, a dictionary, or an object with named attributes.
76
77The pyparsing module handles some of the problems that are typically
78vexing when writing text parsers:
79
80- extra or missing whitespace (the above program will also handle ``"Hello,World!"``, ``"Hello , World !"``, etc.)
81- quoted strings
82- embedded comments
83
84The examples directory includes a simple SQL parser, simple CORBA IDL
85parser, a config file parser, a chemical formula parser, and a four-
86function algebraic notation parser, among many others.
87
88Documentation
89=============
90
91There are many examples in the online docstrings of the classes
92and methods in pyparsing. You can find them compiled into `online docs <https://pyparsing-docs.readthedocs.io/en/latest/>`__. Additional
93documentation resources and project info are listed in the online
94`GitHub wiki <https://github.com/pyparsing/pyparsing/wiki>`__. An
95entire directory of examples can be found `here <https://github.com/pyparsing/pyparsing/tree/master/examples>`__.
96
97AI Instructions
98===============
99
100There are also instructions for AI agents to use when helping you to create your parser. They can
101be pulled from the GitHub project repository, at pyparsing/ai/best_practices.md. You can also tell
102the AI to access them programmatically after installing pyparsing, either from the CLI with
103``python -m pyparsing.ai.show_best_practices`` or within python with
104``import pyparsing; pyparsing.show_best_practices()``.
105
106
107License
108=======
109
110MIT License. See header of the `pyparsing __init__.py <https://github.com/pyparsing/pyparsing/blob/master/pyparsing/__init__.py#L1-L23>`__ file.
111
112History
113=======
114
115See `CHANGES <https://github.com/pyparsing/pyparsing/blob/master/CHANGES>`__ file.
116
117
118Performance benchmarks
119======================
120
121For usage instructions and details on the performance benchmark suite, see
122``tests/README.md`` in this repository.
123
124.. |Build Status| image:: https://github.com/pyparsing/pyparsing/actions/workflows/ci.yml/badge.svg
125 :target: https://github.com/pyparsing/pyparsing/actions/workflows/ci.yml
126
127.. |Coverage| image:: https://codecov.io/gh/pyparsing/pyparsing/branch/master/graph/badge.svg
128 :target: https://codecov.io/gh/pyparsing/pyparsing
129
130.. |Version| image:: https://img.shields.io/pypi/v/pyparsing?style=flat-square
131 :target: https://pypi.org/project/pyparsing/
132 :alt: Version
133
134.. |License| image:: https://img.shields.io/pypi/l/pyparsing.svg?style=flat-square
135 :target: https://pypi.org/project/pyparsing/
136 :alt: License
137
138.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/pyparsing.svg?style=flat-square
139 :target: https://pypi.org/project/python-liquid/
140 :alt: Python versions
141
142.. |Snyk Score| image:: https://snyk.io//advisor/python/pyparsing/badge.svg
143 :target: https://snyk.io//advisor/python/pyparsing
144 :alt: pyparsing
145