METADATA 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. Metadata-Version: 2.1
  2. Name: pyparsing
  3. Version: 2.4.7
  4. Summary: Python parsing module
  5. Home-page: https://github.com/pyparsing/pyparsing/
  6. Author: Paul McGuire
  7. Author-email: ptmcg@users.sourceforge.net
  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 :: 2
  18. Classifier: Programming Language :: Python :: 2.6
  19. Classifier: Programming Language :: Python :: 2.7
  20. Classifier: Programming Language :: Python :: 3
  21. Classifier: Programming Language :: Python :: 3.3
  22. Classifier: Programming Language :: Python :: 3.4
  23. Classifier: Programming Language :: Python :: 3.5
  24. Classifier: Programming Language :: Python :: 3.6
  25. Classifier: Programming Language :: Python :: 3.7
  26. Classifier: Programming Language :: Python :: 3.8
  27. Requires-Python: >=2.6, !=3.0.*, !=3.1.*, !=3.2.*
  28. PyParsing -- A Python Parsing Module
  29. ====================================
  30. |Build Status|
  31. Introduction
  32. ============
  33. The pyparsing module is an alternative approach to creating and
  34. executing simple grammars, vs. the traditional lex/yacc approach, or the
  35. use of regular expressions. The pyparsing module provides a library of
  36. classes that client code uses to construct the grammar directly in
  37. Python code.
  38. *[Since first writing this description of pyparsing in late 2003, this
  39. technique for developing parsers has become more widespread, under the
  40. name Parsing Expression Grammars - PEGs. See more information on PEGs at*
  41. https://en.wikipedia.org/wiki/Parsing_expression_grammar *.]*
  42. Here is a program to parse ``"Hello, World!"`` (or any greeting of the form
  43. ``"salutation, addressee!"``):
  44. .. code:: python
  45. from pyparsing import Word, alphas
  46. greet = Word(alphas) + "," + Word(alphas) + "!"
  47. hello = "Hello, World!"
  48. print(hello, "->", greet.parseString(hello))
  49. The program outputs the following::
  50. Hello, World! -> ['Hello', ',', 'World', '!']
  51. The Python representation of the grammar is quite readable, owing to the
  52. self-explanatory class names, and the use of '+', '|' and '^' operator
  53. definitions.
  54. The parsed results returned from ``parseString()`` can be accessed as a
  55. nested list, a dictionary, or an object with named attributes.
  56. The pyparsing module handles some of the problems that are typically
  57. vexing when writing text parsers:
  58. - extra or missing whitespace (the above program will also handle ``"Hello,World!"``, ``"Hello , World !"``, etc.)
  59. - quoted strings
  60. - embedded comments
  61. The examples directory includes a simple SQL parser, simple CORBA IDL
  62. parser, a config file parser, a chemical formula parser, and a four-
  63. function algebraic notation parser, among many others.
  64. Documentation
  65. =============
  66. There are many examples in the online docstrings of the classes
  67. and methods in pyparsing. You can find them compiled into online docs
  68. at https://pyparsing-docs.readthedocs.io/en/latest/. Additional
  69. documentation resources and project info are listed in the online
  70. GitHub wiki, at https://github.com/pyparsing/pyparsing/wiki. An
  71. entire directory of examples is at
  72. https://github.com/pyparsing/pyparsing/tree/master/examples.
  73. License
  74. =======
  75. MIT License. See header of pyparsing.py
  76. History
  77. =======
  78. See CHANGES file.
  79. .. |Build Status| image:: https://travis-ci.org/pyparsing/pyparsing.svg?branch=master
  80. :target: https://travis-ci.org/pyparsing/pyparsing