METADATA 4.9 KB

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