{ "info": { "author": "Graham Clendenning", "author_email": "graham.clendenning@uoit.net", "bugtrack_url": null, "classifiers": [], "description": "cyberspacy: cybersecurity datatypes for spaCy\n*********************************************\n\n`spaCy v2.0 `_ extension and pipeline component\nfor adding meta data about IPs, email addresses and URLs to ``Doc`` objects.\nHeavily inspired by `spacymoji `_.\n\nInstallation\n===============\n\n``cyberspacy`` requires ``spacy`` v2.0.0 or higher.\n\nPyPI release coming soon.\n\nUsage\n========\n\nImport the component and initialise it with the shared ``nlp`` object (i.e. an\ninstance of ``Language``), which is used to initialise the ``PhraseMatcher``\nwith the shared vocab, and create the match patterns. Then add the component\nanywhere in your pipeline.\n\n.. code:: python\n\n import spacy\n from spacy.lang.en import English\n from cyberspacy import IPDetector\n nlp = English()\n ip_detector = IPDetector(nlp)\n nlp.add_pipe(ip_detector, first=True)\n doc = nlp(u'This is a sentence which contains 2.3.4.5 as an IP address')\n assert doc._.has_ipv4 == True\n assert doc[0]._.is_ipv4 == False\n assert doc[6]._.is_ipv4 == True\n assert len(doc._.ipv4) == 1\n idx, ipv4_token = doc._.ipv4[0]\n assert idx == 6\n assert ipv4_token.text == '2.3.4.5'\n\n``cyberspacy`` only cares about the token text, so you can use it on a blank\n``Language`` instance (it should work for all\n`available languages `_!), or in\na pipeline with a loaded model. \n\nAvailable attributes\n--------------------\n\nThe extension sets attributes on the ``Doc``, ``Span`` and ``Token``. You can\nchange the attribute names on initialisation of the extension. For more details\non custom components and attributes, see the\n`processing pipelines documentation `_.\n\nThe attributes provided by the IPDetector class are:\n\n===================== ======= ===\n``Token._.is_ipv4`` bool Whether the token is an IPv4 address.\n``Doc._.has_ipv4`` bool Whether the document contains an IPv4 address.\n``Doc._.ipv4`` list ``(index, token)`` tuples of the document's IPv4 addresses.\n``Span._.has_ipv4`` bool Whether the span contains IPv4 addresses.\n``Span._.ipv4`` list ``(index, token)`` tuples of the span's IPv4 addresses.\n===================== ======= ===\n\nThe attributes provided by the URLDetector class are:\n\n==================== ======= ===\n``Token._.is_url`` bool Whether the token is a URL.\n``Doc._.has_url`` bool Whether the document contains a URL.\n``Doc._.url`` list ``(index, token)`` tuples of the document's URLs.\n``Span._.has_url`` bool Whether the span contains a URL.\n``Span._.url`` list ``(index, token)`` tuples of the span's URLs.\n==================== ======= ===\n\nThe attributes provided by the EmailDetector class are:\n\n========================= ======= ===\n``Token._.is_email_addr`` bool Whether the token is an email address.\n``Doc._.has_email_addr`` bool Whether the document contains an email address.\n``Doc._.email_addr`` list ``(index, token)`` tuples of the document's email addresses.\n``Span._.has_email_addr`` bool Whether the span contains an email address.\n``Span._.email_addr`` list ``(index, token)`` tuples of the span's email addresses.\n========================= ======= ===\n\n\n\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/gclen/cyberspacy", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "cyberspacy", "package_url": "https://pypi.org/project/cyberspacy/", "platform": "", "project_url": "https://pypi.org/project/cyberspacy/", "project_urls": { "Homepage": "https://github.com/gclen/cyberspacy" }, "release_url": "https://pypi.org/project/cyberspacy/1.0.0/", "requires_dist": [ "spacy (>=2.0.0,<3.0.0)" ], "requires_python": "", "summary": "spaCy pipeline component for adding cyber meta data to Doc, Token and Span objects.", "version": "1.0.0" }, "last_serial": 4885138, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "854ad030d972549f27b541e9ee3d496b", "sha256": "ccb19f95cd645dc5212fcf153b7102b635859961da98c55d72c590247e60883a" }, "downloads": -1, "filename": "cyberspacy-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "854ad030d972549f27b541e9ee3d496b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9165, "upload_time": "2019-03-01T14:55:32", "url": "https://files.pythonhosted.org/packages/73/69/35c01784bd4b1ee93d4b4cdc8a9fc91135bd4c71d911cc49319f1d86f8c6/cyberspacy-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6892b5b9d8c5f905e532d03df60ed8cb", "sha256": "d9c4e543942f9ee1037dbdfc440feb33ab145cd1b8f398e0770ea9ee3886be0b" }, "downloads": -1, "filename": "cyberspacy-1.0.0.tar.gz", "has_sig": false, "md5_digest": "6892b5b9d8c5f905e532d03df60ed8cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5809, "upload_time": "2019-03-01T14:55:35", "url": "https://files.pythonhosted.org/packages/95/36/b746a86b95193c7235b78c5225ac8641e6c32de0428de65b6603022dfde7/cyberspacy-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "854ad030d972549f27b541e9ee3d496b", "sha256": "ccb19f95cd645dc5212fcf153b7102b635859961da98c55d72c590247e60883a" }, "downloads": -1, "filename": "cyberspacy-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "854ad030d972549f27b541e9ee3d496b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9165, "upload_time": "2019-03-01T14:55:32", "url": "https://files.pythonhosted.org/packages/73/69/35c01784bd4b1ee93d4b4cdc8a9fc91135bd4c71d911cc49319f1d86f8c6/cyberspacy-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6892b5b9d8c5f905e532d03df60ed8cb", "sha256": "d9c4e543942f9ee1037dbdfc440feb33ab145cd1b8f398e0770ea9ee3886be0b" }, "downloads": -1, "filename": "cyberspacy-1.0.0.tar.gz", "has_sig": false, "md5_digest": "6892b5b9d8c5f905e532d03df60ed8cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5809, "upload_time": "2019-03-01T14:55:35", "url": "https://files.pythonhosted.org/packages/95/36/b746a86b95193c7235b78c5225ac8641e6c32de0428de65b6603022dfde7/cyberspacy-1.0.0.tar.gz" } ] }