METADATA 5.0 KB

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