{ "info": { "author": "JanFan", "author_email": "guangyizhang.jan@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "===============================\npy-aho-corasick\n===============================\n\n\n.. image:: https://img.shields.io/pypi/v/py_aho_corasick.svg\n :target: https://pypi.python.org/pypi/py_aho_corasick\n\n.. image:: https://img.shields.io/travis/JanFan/py_aho_corasick.svg\n :target: https://travis-ci.org/JanFan/py_aho_corasick\n\n.. image:: https://readthedocs.org/projects/py-aho-corasick/badge/?version=latest\n :target: https://py-aho-corasick.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://pyup.io/repos/github/JanFan/py_aho_corasick/shield.svg\n :target: https://pyup.io/repos/github/JanFan/py_aho_corasick/\n :alt: Updates\n\n\npy-aho-corasick\n\n\n* Free software: MIT license\n* The prototype is inspired by and borrowed from `Carolyn Shen `_\n\nFeatures\n--------\n\n* Pure Python implementation\n* Python2 && Python3 support\n* Unicode && UTF-8 encoding support\n* Pickle-able serialization\n\nUsage\n--------\n\nInstall::\n\n pip install py_aho_corasick\n\nUsage::\n\n from py_aho_corasick import py_aho_corasick\n\n # keywords only\n A = py_aho_corasick.Automaton(['cash', 'shew', 'ew'])\n text = \"cashew\"\n for idx,k,v in A.get_keywords_found(text):\n assert text[idx:idx+len(k)] == k\n\n # keywords and values\n kv = [('cash',1), ('shew',2), ('ew',3)]\n A = py_aho_corasick.Automaton(kv)\n text = \"cashew\"\n for idx,k,v in A.get_keywords_found(text):\n assert text[idx:idx+len(k)] == k\n assert v == dict(kv)[k]\n\n\nPerformance\n--------\n\nCompared with `pyahocorasick (C extention) `_\n\nYou can run the testing script to get this::\n\n # Requirements:\n # pip install pyahocorasick\n python cmp.py\n\n* pyahocorasick: text of 1000000 length, 1000 keywords, building time 0.026426076889038086 and searching time cost 0.047805070877075195\n* py_aho_corasick: text of 1000000 length, 1000 keywords, building time 0.47435593605041504 and searching time cost 4.24287486076355\n\nSorry about the poor performance :-(\n\nDevelopment\n--------\n\nRun tests::\n\n # testing against py2 and py3\n tox\n\n\nTODO\n--------\n\n* Performance optimization\n\n\n=======\nHistory\n=======\n\n0.1.0 (2017-04-17)\n------------------\n\n* First release on PyPI.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/JanFan/py_aho_corasick", "keywords": "py_aho_corasick", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "py_aho_corasick", "package_url": "https://pypi.org/project/py_aho_corasick/", "platform": "", "project_url": "https://pypi.org/project/py_aho_corasick/", "project_urls": { "Homepage": "https://github.com/JanFan/py_aho_corasick" }, "release_url": "https://pypi.org/project/py_aho_corasick/1.1.0/", "requires_dist": null, "requires_python": "", "summary": "py-aho-corasick", "version": "1.1.0" }, "last_serial": 2810789, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "d2788bdf556201d773435a9b8acdeccb", "sha256": "963370c1d3337693d4a999e7ed926bf97357d4d0372b9702d5643c3e04f5731d" }, "downloads": -1, "filename": "py_aho_corasick-1.0.0.tar.gz", "has_sig": false, "md5_digest": "d2788bdf556201d773435a9b8acdeccb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15644, "upload_time": "2017-04-18T05:17:24", "url": "https://files.pythonhosted.org/packages/e9/74/11e05b1e2a12bae9fa7e7affec3a8d764e692b78495f63ba8d0d6cd286ca/py_aho_corasick-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "5825aa7253d00ce7e877aef3322fbab5", "sha256": "8ab37ad323fa42982012a98a529ee2465ea2e4b382508c0aff86b2aaa5c45ca6" }, "downloads": -1, "filename": "py_aho_corasick-1.1.0.tar.gz", "has_sig": false, "md5_digest": "5825aa7253d00ce7e877aef3322fbab5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15766, "upload_time": "2017-04-18T09:41:03", "url": "https://files.pythonhosted.org/packages/44/b0/5c78df4c57dd87e0a96ef363eacd6bf6dba60457e5c51b4b54176a89ca20/py_aho_corasick-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5825aa7253d00ce7e877aef3322fbab5", "sha256": "8ab37ad323fa42982012a98a529ee2465ea2e4b382508c0aff86b2aaa5c45ca6" }, "downloads": -1, "filename": "py_aho_corasick-1.1.0.tar.gz", "has_sig": false, "md5_digest": "5825aa7253d00ce7e877aef3322fbab5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15766, "upload_time": "2017-04-18T09:41:03", "url": "https://files.pythonhosted.org/packages/44/b0/5c78df4c57dd87e0a96ef363eacd6bf6dba60457e5c51b4b54176a89ca20/py_aho_corasick-1.1.0.tar.gz" } ] }