{ "info": { "author": "aabbfive", "author_email": "diffyheart@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Text Processing" ], "description": "

\n
\n \n \"PPark\"\n \n
\n PPark\n
\n
\n

\n\n

The best lexing library available any python version confused (2.x, 3.x, PyPy...)

\n\n## 💾 Install\n\nDownload the latest version of PPark from\nthe [GitHub releases](https://github.com/aabbfive/PPark/releases) page.\n\n\n## 💬 How to Contribute\n\n### Get the code\n\n```\n$ git clone https://github.com/aabbfive/PPark.git\n$ cd PPark\n```\n\n### Install the library\n\n```\n$ pip install PPark\n```\n\n#### Or\n\n```\n$ pip install git+https://github.com/aabbfive/PPark\n```\n\n### Examples\n\n```\nfrom PPark import Lexer\nfrom PPark.constant import Keyword, Keywords\n\nlexer = Lexer()\nlexer.addRule('INTEGER', r'([0-9]+)')\nlexer.addRule('OP', Keywords([\n\tKeyword('}'), \n\tKeyword('{'),\n\tKeyword('^'),\n\tKeyword(']'),\n\tKeyword('['),\n\tKeyword('>'),\n\tKeyword('<'),\n\tKeyword('='),\n\tKeyword('.'),\n\tKeyword('-'),\n\tKeyword(','),\n\tKeyword('+'),\n\tKeyword('**'),\n\tKeyword('*'),\n\tKeyword('/'),\n\tKeyword('//'),\n\tKeyword('%'),\n\tKeyword(')'),\n\tKeyword('(')\n\t]))\n@lexer.on_match(r'\"([^\"\\n]|(\\\\\"))*\"')\ndef STRING(token):\n\ttoken.value = token.value[1:][:-1]\n@lexer.on_match(r'[a-zA-Z_$]\\w*')\ndef IDENTIFIER(token):\n\tif keywords.contains(token.value):\n\t\ttoken.type = token.value.upper()\n\t\treturn token\nlexer.input(\"\"\"\nt = 12*2\n\"\"\")\nfor token in lexer:\n\tprint(token)\n```\n\n## ©️ License\n\nMIT. Copyright (c) [Aabbfive](https://github.com/aabbfive).\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/aabbfive/PPark/releases", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/aabbfive/PPark", "keywords": "lexer", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "PPark", "package_url": "https://pypi.org/project/PPark/", "platform": "", "project_url": "https://pypi.org/project/PPark/", "project_urls": { "Download": "https://github.com/aabbfive/PPark/releases", "Homepage": "https://github.com/aabbfive/PPark" }, "release_url": "https://pypi.org/project/PPark/1.0.1/", "requires_dist": null, "requires_python": "", "summary": "Advanced Lexer", "version": "1.0.1" }, "last_serial": 3630649, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "856dde9a689615c51eb40b9a92cf0fce", "sha256": "6212fd47445c4b73274c26a91ac7b1481f76d91916dfbcdc6db4df570719cff9" }, "downloads": -1, "filename": "PPark-1.0.0.tar.gz", "has_sig": false, "md5_digest": "856dde9a689615c51eb40b9a92cf0fce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3305, "upload_time": "2018-03-01T12:42:56", "url": "https://files.pythonhosted.org/packages/6e/26/5cc3b742649d33b7d722c76f7ad87749eec2f12546fcddc04a88d90269dd/PPark-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "2fa3f32de99dfb551d456394f8915ce3", "sha256": "445744646f67593a67148465f2fa55ea3982aed91b6423e126fba20b6da56142" }, "downloads": -1, "filename": "PPark-1.0.1.tar.gz", "has_sig": false, "md5_digest": "2fa3f32de99dfb551d456394f8915ce3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3327, "upload_time": "2018-03-02T00:22:24", "url": "https://files.pythonhosted.org/packages/ea/de/d7367a328247aa26e6649138950657062484d205f6b83a5003be9a383c07/PPark-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2fa3f32de99dfb551d456394f8915ce3", "sha256": "445744646f67593a67148465f2fa55ea3982aed91b6423e126fba20b6da56142" }, "downloads": -1, "filename": "PPark-1.0.1.tar.gz", "has_sig": false, "md5_digest": "2fa3f32de99dfb551d456394f8915ce3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3327, "upload_time": "2018-03-02T00:22:24", "url": "https://files.pythonhosted.org/packages/ea/de/d7367a328247aa26e6649138950657062484d205f6b83a5003be9a383c07/PPark-1.0.1.tar.gz" } ] }