{"id":13460254,"url":"https://github.com/pyparsing/pyparsing","last_synced_at":"2025-10-08T18:25:02.024Z","repository":{"id":37484605,"uuid":"91262163","full_name":"pyparsing/pyparsing","owner":"pyparsing","description":"Python library for creating PEG parsers","archived":false,"fork":false,"pushed_at":"2025-05-07T14:47:19.000Z","size":9017,"stargazers_count":2319,"open_issues_count":35,"forks_count":290,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-05-11T23:52:51.536Z","etag":null,"topics":["parser-combinators","parsing","parsing-expression-grammar","parsing-library","peg-parsers","python","python-2","python-3","python2","python3","text-processing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyparsing.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.rst","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":"pypi/pyparsing","community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2017-05-14T18:07:01.000Z","updated_at":"2025-05-09T17:09:52.000Z","dependencies_parsed_at":"2022-07-18T04:00:33.426Z","dependency_job_id":"70080c9d-df58-4903-af1a-216c34fedbfe","html_url":"https://github.com/pyparsing/pyparsing","commit_stats":{"total_commits":1307,"total_committers":72,"mean_commits":18.15277777777778,"dds":0.1660290742157613,"last_synced_commit":"dc98e0c0509595a3a0a0cde70b35a6fc7e6a0e24"},"previous_names":[],"tags_count":71,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyparsing%2Fpyparsing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyparsing%2Fpyparsing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyparsing%2Fpyparsing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyparsing%2Fpyparsing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyparsing","download_url":"https://codeload.github.com/pyparsing/pyparsing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253650975,"owners_count":21942235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["parser-combinators","parsing","parsing-expression-grammar","parsing-library","peg-parsers","python","python-2","python-3","python2","python3","text-processing"],"created_at":"2024-07-31T10:00:38.133Z","updated_at":"2025-10-08T18:24:57.002Z","avatar_url":"https://github.com/pyparsing.png","language":"Python","funding_links":["https://tidelift.com/funding/github/pypi/pyparsing"],"categories":["Python","Text Processing","文本处理","Tools","Others","语言资源库","Text Processing [🔝](#readme)"],"sub_categories":["python"],"readme":"PyParsing -- A Python Parsing Module\n====================================\n\n|Version| |Build Status| |Coverage| |License| |Python Versions| |Snyk Score|\n\nIntroduction\n============\n\nThe pyparsing module is an alternative approach to creating and\nexecuting simple grammars, vs. the traditional lex/yacc approach, or the\nuse of regular expressions. The pyparsing module provides a library of\nclasses that client code uses to construct the grammar directly in\nPython code.\n\n*[Since first writing this description of pyparsing in late 2003, this\ntechnique for developing parsers has become more widespread, under the\nname Parsing Expression Grammars - PEGs. See more information on PEGs*\n`here \u003chttps://en.wikipedia.org/wiki/Parsing_expression_grammar\u003e`__\n*.]*\n\nHere is a program to parse ``\"Hello, World!\"`` (or any greeting of the form\n``\"salutation, addressee!\"``):\n\n.. code:: python\n\n    from pyparsing import Word, alphas\n    greet = Word(alphas) + \",\" + Word(alphas) + \"!\"\n    hello = \"Hello, World!\"\n    print(hello, \"-\u003e\", greet.parse_string(hello))\n\nThe program outputs the following::\n\n    Hello, World! -\u003e ['Hello', ',', 'World', '!']\n\nThe Python representation of the grammar is quite readable, owing to the\nself-explanatory class names, and the use of '+', '|' and '^' operator\ndefinitions.\n\nThe parsed results returned from ``parse_string()`` is a collection of type\n``ParseResults``, which can be accessed as a\nnested list, a dictionary, or an object with named attributes.\n\nThe pyparsing module handles some of the problems that are typically\nvexing when writing text parsers:\n\n- extra or missing whitespace (the above program will also handle ``\"Hello,World!\"``, ``\"Hello , World !\"``, etc.)\n- quoted strings\n- embedded comments\n\nThe examples directory includes a simple SQL parser, simple CORBA IDL\nparser, a config file parser, a chemical formula parser, and a four-\nfunction algebraic notation parser, among many others.\n\nDocumentation\n=============\n\nThere are many examples in the online docstrings of the classes\nand methods in pyparsing. You can find them compiled into `online docs \u003chttps://pyparsing-docs.readthedocs.io/en/latest/\u003e`__. Additional\ndocumentation resources and project info are listed in the online\n`GitHub wiki \u003chttps://github.com/pyparsing/pyparsing/wiki\u003e`__. An\nentire directory of examples can be found `here \u003chttps://github.com/pyparsing/pyparsing/tree/master/examples\u003e`__.\n\nLicense\n=======\n\nMIT License. See header of the `pyparsing __init__.py \u003chttps://github.com/pyparsing/pyparsing/blob/master/pyparsing/__init__.py#L1-L23\u003e`__ file.\n\nHistory\n=======\n\nSee `CHANGES \u003chttps://github.com/pyparsing/pyparsing/blob/master/CHANGES\u003e`__ file.\n\n.. |Build Status| image:: https://github.com/pyparsing/pyparsing/actions/workflows/ci.yml/badge.svg\n   :target: https://github.com/pyparsing/pyparsing/actions/workflows/ci.yml\n\n.. |Coverage| image:: https://codecov.io/gh/pyparsing/pyparsing/branch/master/graph/badge.svg\n  :target: https://codecov.io/gh/pyparsing/pyparsing\n\n.. |Version| image:: https://img.shields.io/pypi/v/pyparsing?style=flat-square\n    :target: https://pypi.org/project/pyparsing/\n    :alt: Version\n\n.. |License| image:: https://img.shields.io/pypi/l/pyparsing.svg?style=flat-square\n    :target: https://pypi.org/project/pyparsing/\n    :alt: License\n\n.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/pyparsing.svg?style=flat-square\n    :target: https://pypi.org/project/python-liquid/\n    :alt: Python versions\n\n.. |Snyk Score| image:: https://snyk.io//advisor/python/pyparsing/badge.svg\n   :target: https://snyk.io//advisor/python/pyparsing\n   :alt: pyparsing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyparsing%2Fpyparsing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyparsing%2Fpyparsing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyparsing%2Fpyparsing/lists"}