METADATA 5.0 KB

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