{ "info": { "author": "David Blewett", "author_email": "david@dawninglight.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Text Processing :: Indexing" ], "description": "Python API for RUst's REgex engine\n==================================\nrure is the Python binding Rust's regex library, which guarantees linear time\nsearching using finite automata. In exchange, it must give up some common\nregex features such as backreferences and arbitrary lookaround. It does\nhowever include capturing groups, lazy matching, Unicode support and word\nboundary assertions. Its matching semantics generally correspond to Perl's,\nor \"leftmost first.\" Namely, the match locations reported correspond to the\nfirst match that would be found by a backtracking engine.\n\nThe syntax and possibly other useful things are documented in the Rust\nAPI documentation: http://doc.rust-lang.org/regex/regex/index.html\n\n\nExamples\n--------\n\nThis package presents 2 entry points to the regex engine: ``Rure``,\nan OO wrapper of the underlying Rust API, and a drop-in replacement for the\nstdlib ``re`` module (``compile``, ``search``, ``match``, ``findall``, ``finditer``,\n``RegexObject`` and ``MatchObject``).\n\nThe ``Rure`` interface exposes the \"pay for what you use\" API, enabling\nyou to request the minimum computation you need: does the text match (``is_match``),\nwhere does it match (``find``, ``find_iter``), and where are the submatches\n(``captures``, ``captures_iter``).\n\nThe drop-in replacement should be as simple as ``import rure as re``,\nand using the API as documented in the Python documentation\n( https://docs.python.org/3/library/re.html , https://docs.python.org/2/library/re.html).\nThe flags supported by ``re`` are automatically translated to those\nsupported by ``rure``. Note that the ``rure`` engine is more strict than ``re``,\nand will reject expressions that contain unnecessary escapes, or use features not\nsupported by the engine.\n\nOne important note regarding this shim: the Rust engine operates on\nbyte offsets in the given search text, while Python operates on Unicode\ncode points. The Rust engine guarantees returning offsets that correspond\nto valid UTF8 segments. By default, the ``MatchObject`` that is returned by\nthis library will decode the captured text. The offsets returned by ``start``,\n``end``, and ``span``, however, are byte offsets and not character offsets.\nUsing them with the ``string`` attribute is safe, so you can do:\n\n>>> email = u\"tony@tiremove_thisger.net\"\n>>> m = re.search(u\"remove_this\", email)\n>>> m.string[:m.start()] + m.string[m.end():].decode('utf8')\nu'tony@tiger.net'\n\nThis package also includes an ``is_match(pattern, string, flags=0)`` function\n(and corresponding method on ``RegexObject``), that only returns a boolean.\n\n\nPerformance\n-----------\nIt's fast. Its core matching engine is a lazy DFA, which is what GNU grep\nand RE2 use. Like GNU grep, this regex engine can detect multi byte literals\nin the regex and will use fast literal string searching to quickly skip\nthrough the input to find possible match locations.\n\nAll memory usage is bounded and all searching takes linear time with respect\nto the input string.\n\nFor more details, see the PERFORMANCE guide:\nhttps://github.com/rust-lang-nursery/regex/blob/master/PERFORMANCE.md\n\n\nMissing\n-------\nThere are a few things missing from this package that are present in the Rust API.\nThere's no particular (known) reason why they don't, they just haven't been\nimplemented yet.\n\n* Splitting a string by a regex.\n* Replacing regex matches in a string with some other text.\n\n\nInstall\n-------\nBinary wheels are provided for MacOS. The specific versions of the Rust\ncompiler, `rure` and `regex` crates will be available in the changelog.\n\nInstalling from a source tarball requires manually building the Rust `rure` crate and\npointing at the built directory. If you are wanting to take advantage of a modern CPU,\nit's likely that you'll want to build the `regex` crate with SSE3 and SIMD. To do so,\nyou will need to update the `regex/regex-capi/Cargo.toml` to include the `simd-accel`\nfeature: `regex = { version = \"0.2.2\", path = \"..\", features=[\"simd-accel\"] }`.\n\n* git clone https://github.com/rust-lang-nursery/regex\n* `cargo build --release --manifest-path /path/to/regex/regex-capi/Cargo.toml`\n\n * To build with SSE3: `RUSTFLAGS=\"-C target-feature=+ssse3\" cargo build --release --features simd-accel`\n\n* `RURE_DIR=/path/to/regex/regex-capi python setup.py bdist_wheel`\n* `pip install rure --no-index -f ./dist`\n\n\n=======\nHistory\n=======\n\n0.2.1 (2019-04-07)\n------------------\n\n* Update build pipeline to support multiple Python versions\n* Binary wheels compiled against:\n\n * Rust: 1.33.0\n * regex: 1.0\n * rure (regex-capi): 0.2.1\n\n0.2.0 (2018-03-04)\n------------------\n\n* Add support for RegexSet\n\n0.1.2 (2017-10-09)\n------------------\n\n* First release on PyPI\n* Binary wheels compiled against:\n\n * Rust: 1.20.0\n * regex: 0.2.2\n * rure (regex-capi): 0.2.0\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/davidblewett/rure-python", "keywords": "regex,rust,dfa,automata,data_structures", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "rure", "package_url": "https://pypi.org/project/rure/", "platform": "", "project_url": "https://pypi.org/project/rure/", "project_urls": { "Homepage": "https://github.com/davidblewett/rure-python" }, "release_url": "https://pypi.org/project/rure/0.2.2/", "requires_dist": [ "milksnake", "cffi (>=1.5.0)", "six" ], "requires_python": "", "summary": "Python bindings for the Rust `regex` crate. This implementation uses finite automata and guarantees linear time matching on all inputs.", "version": "0.2.2", "yanked": false, "yanked_reason": null }, "last_serial": 6052835, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "69b5635e032e6a2d0000a7fda264fee5", "sha256": "595ccccd716acfb283cd27020916d6da07c57fed4616f10de1f0b9012c79e39a" }, "downloads": -1, "filename": "rure-0.1.2-cp27-cp27m-macosx_10_11_x86_64.whl", "has_sig": false, "md5_digest": "69b5635e032e6a2d0000a7fda264fee5", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 354780, "upload_time": "2017-10-10T23:06:44", "upload_time_iso_8601": "2017-10-10T23:06:44.967315Z", "url": "https://files.pythonhosted.org/packages/ad/be/f9aea3d451a3e140380513b05b6fbf05140eca261736ae0c13aa3e89d3d1/rure-0.1.2-cp27-cp27m-macosx_10_11_x86_64.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "9191c58490552f551d21ff0f273fc42a", "sha256": "fb631f7ed48156962bb8a918fece7fb215cce45dc66d3f32d791ed3f1f26dfb7" }, "downloads": -1, "filename": "rure-0.1.2-cp27-none-macosx_10_12_x86_64.whl", "has_sig": false, "md5_digest": "9191c58490552f551d21ff0f273fc42a", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 357416, "upload_time": "2017-10-10T23:11:01", "upload_time_iso_8601": "2017-10-10T23:11:01.816631Z", "url": "https://files.pythonhosted.org/packages/a1/c2/10035bf6291a213ffefc2bce51395cc609b9d83e98fe8195468a58d3e538/rure-0.1.2-cp27-none-macosx_10_12_x86_64.whl", "yanked": false, "yanked_reason": null } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "1b7667623654d8cac6cabb5e265017ca", "sha256": "45cf26f694d3b6759f1e2e0d5bbbc7a5ce17c7c2a77c81dcece7476f2f3cdc2d" }, "downloads": -1, "filename": "rure-0.2.1-py2.py3-none-macosx_10_14_x86_64.whl", "has_sig": false, "md5_digest": "1b7667623654d8cac6cabb5e265017ca", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 588343, "upload_time": "2019-04-07T22:51:10", "upload_time_iso_8601": "2019-04-07T22:51:10.785025Z", "url": "https://files.pythonhosted.org/packages/12/5e/d9935ec722dd4ca7a9ce6a6385dd2ce8b26f9b0b8311f5d9ed3fc0b4f6b4/rure-0.2.1-py2.py3-none-macosx_10_14_x86_64.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "0fa17d1638fabd9d778b9a8b27a50976", "sha256": "10b073798c3b8464dbf8e5c7bcc255a68ff00dbadc1fab542b0fd79aeddada53" }, "downloads": -1, "filename": "rure-0.2.1-py2.py3-none-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "0fa17d1638fabd9d778b9a8b27a50976", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3734370, "upload_time": "2019-04-07T22:51:20", "upload_time_iso_8601": "2019-04-07T22:51:20.874159Z", "url": "https://files.pythonhosted.org/packages/71/ce/41294c00539ed8f3c7eb7497925746e23b7a2c4f0c847959873540aea7a9/rure-0.2.1-py2.py3-none-manylinux1_x86_64.whl", "yanked": false, "yanked_reason": null } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "33141a5c5c471e70bc3801f1a895c9bd", "sha256": "f8ccec9bea1651ba2334029b12e1665f0f076fadf6ea66402f0554506c30de6c" }, "downloads": -1, "filename": "rure-0.2.2-py2.py3-none-macosx_10_14_x86_64.whl", "has_sig": false, "md5_digest": "33141a5c5c471e70bc3801f1a895c9bd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 573820, "upload_time": "2019-10-30T14:14:11", "upload_time_iso_8601": "2019-10-30T14:14:11.691526Z", "url": "https://files.pythonhosted.org/packages/d1/75/9474d8b212dca29a2543f6b92ae80dec17f9da4ca8f6be8cfef5d459b0a6/rure-0.2.2-py2.py3-none-macosx_10_14_x86_64.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "ee5a40d6620e053377e45e4c9440ad0c", "sha256": "c99524e4000b105ed0c4a6f51f58139758652f4fb2fba4862eff775f84de1733" }, "downloads": -1, "filename": "rure-0.2.2-py2.py3-none-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "ee5a40d6620e053377e45e4c9440ad0c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3734433, "upload_time": "2019-10-30T14:14:24", "upload_time_iso_8601": "2019-10-30T14:14:24.092294Z", "url": "https://files.pythonhosted.org/packages/4f/fd/71c6edde95b174abc4c3bbb295d9df7add605aa32413300db85126bf0339/rure-0.2.2-py2.py3-none-manylinux1_x86_64.whl", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "33141a5c5c471e70bc3801f1a895c9bd", "sha256": "f8ccec9bea1651ba2334029b12e1665f0f076fadf6ea66402f0554506c30de6c" }, "downloads": -1, "filename": "rure-0.2.2-py2.py3-none-macosx_10_14_x86_64.whl", "has_sig": false, "md5_digest": "33141a5c5c471e70bc3801f1a895c9bd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 573820, "upload_time": "2019-10-30T14:14:11", "upload_time_iso_8601": "2019-10-30T14:14:11.691526Z", "url": "https://files.pythonhosted.org/packages/d1/75/9474d8b212dca29a2543f6b92ae80dec17f9da4ca8f6be8cfef5d459b0a6/rure-0.2.2-py2.py3-none-macosx_10_14_x86_64.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "ee5a40d6620e053377e45e4c9440ad0c", "sha256": "c99524e4000b105ed0c4a6f51f58139758652f4fb2fba4862eff775f84de1733" }, "downloads": -1, "filename": "rure-0.2.2-py2.py3-none-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "ee5a40d6620e053377e45e4c9440ad0c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3734433, "upload_time": "2019-10-30T14:14:24", "upload_time_iso_8601": "2019-10-30T14:14:24.092294Z", "url": "https://files.pythonhosted.org/packages/4f/fd/71c6edde95b174abc4c3bbb295d9df7add605aa32413300db85126bf0339/rure-0.2.2-py2.py3-none-manylinux1_x86_64.whl", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }