METADATA 4.1 KB

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