PKG-INFO 4.1 KB

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