{ "info": { "author": "Darius Bacon", "author_email": "darius@wry.me", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Education", "License :: OSI Approved :: GNU General Public License (GPL)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Software Development :: Interpreters", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing" ], "description": "Peglet\n======\n\nPeglet extends Python's regular expressions to handle recursive\ngrammars. For example, to parse a tiny subset of HTML:\n\n>>> from peglet import Parser\n>>> a_little_html = Parser(r\"\"\"\n... parts = part parts | \n... part = <(\\w+)> parts \\w+> group\n... | ([^<]+)\n... \"\"\", group=lambda *values: values)\n>>> a_little_html(\"Hello.
Nesting for the win.
\")\n('Hello. ', ('p', ('em', 'Nesting'), ' for ', ('i', 'the win'), '.'))\n\nThe goal was to make a parsing library\n\n1. pleasant enough to use;\n\n2. simple to adapt or rewrite from scratch if I'm faced with some new\n situation like a new programming language;\n\n3. with code easy enough to follow that it could introduce people to\n parsing.\n\nSo it came down to one page of clear code not using combinators. (And\nthen ballooned to 200+ lines from documentation and a few extras.)\nSome bits that couldn't fit the latter two constraints went into a\ncombinator library, `parson