--- id: pyparsing version: "3.3.2" license: MIT license_treatment: permissive maintenance: active --- # pyparsing — pyparsing - Classes and methods to define and execute parsing grammars License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install pyparsing uv add pyparsing poetry add pyparsing ## Description PyParsing -- A Python Parsing Module ==================================== |Version| |Build Status| |Coverage| |License| |Python Versions| |Snyk Score| Introduction ============ The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions. The pyparsing module provides a library of classes that client code uses to construct the grammar directly in Python code. *[Since first writing this description of pyparsing in late 2003, this technique for developing parsers has become more widespread, under the name Parsing Expression Grammars - PEGs. See more information on PEGs* `here `__ *.]* Here is a program to parse ``"Hello, World!"`` (or any greeting of the form ``"salutation, addressee!"``): .. code:: python from pyparsing import Word, alphas greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print(hello, "->", greet.parse_string(hello)) The program outputs the following:: Hello, World! -> ['Hello', ',', 'World', '!'] The Python representation of the grammar is quite... ## AI interpretation — verify before relying pyparsing provides a Python library for building and executing text parsing grammars directly in code, handling common parsing challenges like whitespace variation, quoted strings, and comments without requiring traditional lex/yacc tools. Verdict: pyparsing is a mature, well-maintained parsing library with no known vulnerabilities, zero dependencies, and permissive licensing. It is suitable for production use across a wide range of text-parsing tasks from simple grammars to complex domain-specific languages. [View on SkillFed](https://skillfed.io/packages/pyparsing) · [View on PyPI](https://pypi.org/project/pyparsing/)