{ "info": { "author": "Sergey Tikhonov", "author_email": "srg.tikhonov@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Lexit\nLexit is an open source lexer generator written in Python3.6 using new features like `NamedTuple`, type hinting and `__init_subclass__` hook.\n\n### JSON lexer example \n```python\nfrom lexit import Lexer\n\n\nclass JsonLexer(Lexer):\n NUMBER = r'-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?'\n STRING = r'\"(\\\\\\\"|\\\\\\\\|[^\"\\n])*?\"i?'\n L_BRACE = r'{'\n R_BRACE = r'}'\n L_BRACKET = r'\\['\n R_BRACKET = r'\\]'\n TRUE = r'true'\n FALSE = r'false'\n NULL = r'null'\n COMMA = r','\n COLON = r':'\n\n ignore = r'\\s+'\n\n\ntokens = list(JsonLexer.lex('{\"hello\": \"world\"}'))\n``` \n\n### Requirements\n* The only requirement is Python3.6+\n* For testing the `pytest` library is used\n\n### Installation\n```bash\npip install lexit\n```\n\n### Error handling\n```\ntry:\n tokens = list(JsonLexer.lex('${\"hello\": \"world\"}'))\nexcept LexerError as e:\n print(e.pretty())\n exit(1)\n\n# Will produce the following output:\n\nNo match for character '$' in line 1 column 1\n${\"hello\": \"world\"}\n^\n```\n\n### Design decisions\n* Should be easy to use\n* Longest match priority (`++` always wins over `+` despite of the order in which the tokens are defined in the lexer class)\n* Self-describing errors for humans (it's should be obvious what happened and when)\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pypa/example-project", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "lexit", "package_url": "https://pypi.org/project/lexit/", "platform": "", "project_url": "https://pypi.org/project/lexit/", "project_urls": { "Homepage": "https://github.com/pypa/example-project" }, "release_url": "https://pypi.org/project/lexit/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "Lexer generation", "version": "0.0.1" }, "last_serial": 3997714, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "12fada084394153c16fece2f5d4f32ee", "sha256": "abf3eff2630d7a440cb222b4db4fd07e04aefb9ef3d7313cd44d7a1e912124df" }, "downloads": -1, "filename": "lexit-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "12fada084394153c16fece2f5d4f32ee", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3387, "upload_time": "2018-06-24T21:58:24", "url": "https://files.pythonhosted.org/packages/ea/f0/47d7c907918bac5e2882a2815130a62a447814476e093df412390c487ca0/lexit-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2d57120df102a8d106e8dcc21d7e47cf", "sha256": "400119d224e272fda8af809100de074f7d81bd292d5a2af3212d8f64b85ee4e7" }, "downloads": -1, "filename": "lexit-0.0.1.tar.gz", "has_sig": false, "md5_digest": "2d57120df102a8d106e8dcc21d7e47cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3265, "upload_time": "2018-06-24T21:58:25", "url": "https://files.pythonhosted.org/packages/77/2d/eeed45dd47b608d0c1f33b3a2b6f48376df96d100e7836d51b08884bf60f/lexit-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "12fada084394153c16fece2f5d4f32ee", "sha256": "abf3eff2630d7a440cb222b4db4fd07e04aefb9ef3d7313cd44d7a1e912124df" }, "downloads": -1, "filename": "lexit-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "12fada084394153c16fece2f5d4f32ee", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3387, "upload_time": "2018-06-24T21:58:24", "url": "https://files.pythonhosted.org/packages/ea/f0/47d7c907918bac5e2882a2815130a62a447814476e093df412390c487ca0/lexit-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2d57120df102a8d106e8dcc21d7e47cf", "sha256": "400119d224e272fda8af809100de074f7d81bd292d5a2af3212d8f64b85ee4e7" }, "downloads": -1, "filename": "lexit-0.0.1.tar.gz", "has_sig": false, "md5_digest": "2d57120df102a8d106e8dcc21d7e47cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3265, "upload_time": "2018-06-24T21:58:25", "url": "https://files.pythonhosted.org/packages/77/2d/eeed45dd47b608d0c1f33b3a2b6f48376df96d100e7836d51b08884bf60f/lexit-0.0.1.tar.gz" } ] }