{ "info": { "author": "Alex Willmer", "author_email": "alex@moreati.org.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2 :: Only", "Topic :: Text Processing :: General" ], "description": "====\nPPeg\n====\n\n*PPeg* is a pattern matching library for Python, based on\n`Parsing Expression Grammars`_ (PEGs).\nIt's a port of the `LPeg`_ library from Lua.\n\n.. warning::\n PPeg is still experimental. The API and semantics are not stable.\n\n.. _Parsing Expression Grammars: https://en.wikipedia.org/wiki/Parsing_expression_grammar\n.. _LPeg: http://www.inf.puc-rio.br/~roberto/lpeg/\n\nUsage\n=====\n\nUnlike the ``re`` module [#]_, PPeg patterns can handle balanced sequences\n\n.. code:: python\n\n >>> from _ppeg import Pattern as P\n >>> pattern = P.Grammar('(' + ( (P(1)-P.Set('()')) | P.Var(0) )**0 + ')')\n >>> pattern('(foo(bar()baz))').pos\n 15\n >>> pattern('(foo(bar(baz)').pos\n -1\n >>> capture = P.Cap(pattern)\n >>> capture('(foo(bar()baz))').captures\n ['(foo(bar()baz))']\n\nThis example corresponds roughly to the following LPeg example\n\n.. code:: lua\n\n > lpeg = require \"lpeg\"\n > pattern = lpeg.P{ \"(\" * ((1 - lpeg.S\"()\") + lpeg.V(1))^0 * \")\" }\n > pattern:match(\"(foo(bar()baz))\") -- Lua indexes begin at 1\n 16\n > pattern:match(\"(foo(bar(baz)\")\n nil\n > capture = lpeg.C(pattern)\n > capture:match(\"(foo(bar()baz))\")\n \"(foo(bar()baz))\"\n\n.. [#] Some regular expression implementations (e.g. PCRE_, regex_)\n support `recursive patterns`_, which can match balanced sequences.\n\n.. _pcre: http://www.pcre.org/\n.. _regex: https://pypi.python.org/pypi/regex\n.. _recursive patterns: http://www.regular-expressions.info/recurse.html\n\nModules\n=======\n- _cpeg.c\n- _ppeg.c\n - includes lpeg.c", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/moreati/ppeg", "keywords": "parsing peg grammar regex", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "PPeg", "package_url": "https://pypi.org/project/PPeg/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/PPeg/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/moreati/ppeg" }, "release_url": "https://pypi.org/project/PPeg/0.9.4/", "requires_dist": null, "requires_python": null, "summary": "A Python port of Lua's LPeg pattern matching library", "version": "0.9.4" }, "last_serial": 1817819, "releases": { "0.9": [ { "comment_text": "", "digests": { "md5": "953aa36d2989ffea677354abcebd6489", "sha256": "ba8003b1f3a9529b081d18cc75763dbb24dc09ef3428736771a05f7ae87c9984" }, "downloads": -1, "filename": "PPeg-0.9.tar.gz", "has_sig": false, "md5_digest": "953aa36d2989ffea677354abcebd6489", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48023, "upload_time": "2015-10-27T15:36:51", "url": "https://files.pythonhosted.org/packages/68/c5/fceb1197fd7f9ffdd53e4458c7d7bddc73cdc68b73227172c3e31c7d9710/PPeg-0.9.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "0bcf5280f30c7322209df1d1e571a0b4", "sha256": "4ea3b1c2c2d2e36e5bd136a10b7e687b437ef23f42c34315e732a21bc717bc7c" }, "downloads": -1, "filename": "PPeg-0.9.1.tar.gz", "has_sig": false, "md5_digest": "0bcf5280f30c7322209df1d1e571a0b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 49735, "upload_time": "2015-10-27T17:02:06", "url": "https://files.pythonhosted.org/packages/fb/94/974ac38b18855aa35df3ca63a6d9beaab88e94d3744ccca9507462739e90/PPeg-0.9.1.tar.gz" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "9c1542eeed3e169ef33d7ea0d78edf03", "sha256": "b4b9c0c49f6d724fb06a3cec734db645e1ab0ede598b48d8abd8cef19b464b8e" }, "downloads": -1, "filename": "PPeg-0.9.2.tar.gz", "has_sig": false, "md5_digest": "9c1542eeed3e169ef33d7ea0d78edf03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 51304, "upload_time": "2015-10-28T16:20:16", "url": "https://files.pythonhosted.org/packages/2d/80/22e2dc5169a2635ed0db0b8def2c1091be69ddac35986128df1deb43a4e4/PPeg-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "e46766a39ae570414201b680d2f6e4bb", "sha256": "9c7bccbbb7023c1f5e105b10c8eeacfc268096dc0ff7c5d133fe4ced4c8ed642" }, "downloads": -1, "filename": "PPeg-0.9.3.tar.gz", "has_sig": false, "md5_digest": "e46766a39ae570414201b680d2f6e4bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 45688, "upload_time": "2015-11-05T16:42:13", "url": "https://files.pythonhosted.org/packages/2a/01/7ea4b10478922941d5294289870895af83284c3a97eedb2beb8efab47712/PPeg-0.9.3.tar.gz" } ], "0.9.4": [ { "comment_text": "", "digests": { "md5": "2733e89831a0835e17294577c3fca1d7", "sha256": "674632f08c4a1f2f9515a1080c7d5814dae5f3d44c2522df469345e9374c11f0" }, "downloads": -1, "filename": "PPeg-0.9.4.tar.gz", "has_sig": false, "md5_digest": "2733e89831a0835e17294577c3fca1d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 46638, "upload_time": "2015-11-15T21:04:18", "url": "https://files.pythonhosted.org/packages/4d/5d/be7be7c5219051df1f4afdbdbf48bd4ed90a87cbcfd39942e02f1f82a307/PPeg-0.9.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2733e89831a0835e17294577c3fca1d7", "sha256": "674632f08c4a1f2f9515a1080c7d5814dae5f3d44c2522df469345e9374c11f0" }, "downloads": -1, "filename": "PPeg-0.9.4.tar.gz", "has_sig": false, "md5_digest": "2733e89831a0835e17294577c3fca1d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 46638, "upload_time": "2015-11-15T21:04:18", "url": "https://files.pythonhosted.org/packages/4d/5d/be7be7c5219051df1f4afdbdbf48bd4ed90a87cbcfd39942e02f1f82a307/PPeg-0.9.4.tar.gz" } ] }