{ "info": { "author": "Frost Ming", "author_email": "mianghong@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: CPython" ], "description": "# GoRella\n[![Build Status](https://travis-ci.org/frostming/gorella.svg?branch=master)](https://travis-ci.org/frostming/gorella)\n\nMonkey patch regular expression methods to built-in string types\n\n## Introduction\nThis project is aiming at easing the use of regular expression,\nwhich is inspired by `RegExp` in JavaScript. The name comes from \"gorilla\" and \"re\". The sing-file module will monkey patch the following built-in methods of string types on its import:\n\n- `replace`\n- `split` and `rsplit`\n- `find` and `rfind`\n- `index` and `rindex`\n- `partition` and `rpartition`\n- `count`\n- `startswith` and `endswith`\n\nBesides, it extends the built-in string types with following methods of `re`\nmodule:\n\n- `match`\n- `search`\n- `findall`\n- `finditer`\n\n## Usage\nAll you need is to import gorella in one line, everything is done for you:\n```python\n>>> import gorella\n>>> 'I am 26 years old.'.search('\\d+').group()\n'26'\n```\nFor built-in methods, when pass a regular expression object, it will call the corresponding re function, else it falls back to built-in one:\n```python\n>>> pat = re.compile('\\d+')\n>>> 'I am 26 years old.'.find('am')\n2\n>>> 'I am 26 years old.'.find(pat)\n5\n>>> 'I am 26 years old.'.partition(pat)\n('I am ', '26', ' years old')\n```\n*Because it replaces the pure-C methods with python ones, the performance may be affected.*\n\n## Python 3 support\nThe monkey patching highly depends on the C-API of CPython, so it doesn't support other implementations than CPython. The test passes on Python 2.6, 2.7, 3.3, 3.4 and 3.5\n\n## License\nMIT", "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/frostming/gorella", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "gorella", "package_url": "https://pypi.org/project/gorella/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/gorella/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/frostming/gorella" }, "release_url": "https://pypi.org/project/gorella/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Monkey patch regular expressions", "version": "0.1.0" }, "last_serial": 2513341, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "eb1a47991cc32ebeeb3c262a2a137f02", "sha256": "40bed43c7d30ab5138873775b043440c1c7693afc0a5959225b4c4dee94ad66e" }, "downloads": -1, "filename": "gorella-0.1.0-revision.tar.gz", "has_sig": false, "md5_digest": "eb1a47991cc32ebeeb3c262a2a137f02", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6734, "upload_time": "2016-12-12T10:11:46", "url": "https://files.pythonhosted.org/packages/64/46/965e568037f16c224f05f2e3b88591dfa02fb96633e36beb7f8590b6ed01/gorella-0.1.0-revision.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "eb1a47991cc32ebeeb3c262a2a137f02", "sha256": "40bed43c7d30ab5138873775b043440c1c7693afc0a5959225b4c4dee94ad66e" }, "downloads": -1, "filename": "gorella-0.1.0-revision.tar.gz", "has_sig": false, "md5_digest": "eb1a47991cc32ebeeb3c262a2a137f02", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6734, "upload_time": "2016-12-12T10:11:46", "url": "https://files.pythonhosted.org/packages/64/46/965e568037f16c224f05f2e3b88591dfa02fb96633e36beb7f8590b6ed01/gorella-0.1.0-revision.tar.gz" } ] }