{ "info": { "author": "LAZR Developers", "author_email": "lazr-developers@lists.launchpad.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "..\n This file is part of lazr.uri.\n\n lazr.uri is free software: you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, version 3 of the License.\n\n lazr.uri is distributed in the hope that it will be useful, but\n WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public\n License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with lazr.uri. If not, see .\n\nlazr.uri\n********\n\nThe lazr.uri package includes code for parsing and dealing with URIs.\n\n >>> import lazr.uri\n >>> print('VERSION:', lazr.uri.__version__)\n VERSION: ...\n\n=============\nThe URI class\n=============\n\n >>> from lazr.uri import URI\n >>> uri1 = URI('http://localhost/foo/bar?123')\n >>> uri2 = URI('http://localhost/foo/bar/baz')\n >>> uri1.contains(uri2)\n True\n\nThese next two are equivalent, so the answer should be True, even through\nthe \"outside\" one is shorter than the \"inside\" one.\n\n >>> uri1 = URI('http://localhost/foo/bar/')\n >>> uri2 = URI('http://localhost/foo/bar')\n >>> uri1.contains(uri2)\n True\n\nThe next two are exactly the same. We consider a url to be inside itself.\n\n >>> uri1 = URI('http://localhost/foo/bar/')\n >>> uri2 = URI('http://localhost/foo/bar/')\n >>> uri1.contains(uri2)\n True\n\nIn the next case, the string of url2 starts with the string of url1. But,\nbecause url2 continues within the same path step, url2 is not inside url1.\n\n >>> uri1 = URI('http://localhost/foo/ba')\n >>> uri2 = URI('http://localhost/foo/bar')\n >>> uri1.contains(uri2)\n False\n\nHere, url2 is url1 plus an extra path step. So, url2 is inside url1.\n\n >>> uri1 = URI('http://localhost/foo/bar/')\n >>> uri2 = URI('http://localhost/foo/bar/baz')\n >>> uri1.contains(uri2)\n True\n\nOnce the URI is parsed, its parts are accessible.\n\n >>> uri = URI('https://fish.tree:8666/blee/blah')\n >>> uri.scheme\n 'https'\n >>> uri.host\n 'fish.tree'\n >>> uri.port\n '8666'\n >>> uri.authority\n 'fish.tree:8666'\n >>> uri.path\n '/blee/blah'\n\n >>> uri = URI('https://localhost/blee/blah')\n >>> uri.scheme\n 'https'\n >>> uri.host\n 'localhost'\n >>> uri.port is None\n True\n >>> uri.authority\n 'localhost'\n >>> uri.path\n '/blee/blah'\n\nThe grammar from RFC 3986 does not allow for square brackets in the\nquery component, but Section 3.4 does say how such delimeter\ncharacters should be handled if found in the component.\n\n >>> uri = URI('http://www.apple.com/store?delivery=[slow]#horse+cart')\n >>> uri.scheme\n 'http'\n >>> uri.host\n 'www.apple.com'\n >>> uri.port is None\n True\n >>> uri.path\n '/store'\n >>> uri.query\n 'delivery=[slow]'\n >>> uri.fragment\n 'horse+cart'\n\n====================\nFinding URIs in Text\n====================\n\nlazr.uri also knows how to retrieve a list of URIs from a block of\ntext. This is intended for uses like finding bug tracker URIs or\nsimilar.\n\nThe find_uris_in_text() function returns an iterator that yields URI\nobjects for each URI found in the text. Note that the returned URIs\nhave been canonicalised by the URI class:\n\n >>> from lazr.uri import find_uris_in_text\n >>> text = '''\n ... A list of URIs:\n ... * http://localhost/a/b\n ... * http://launchpad.net\n ... * MAILTO:joe@example.com\n ... * xmpp:fred@example.org\n ... * http://bazaar.launchpad.net/%7ename12/firefox/foo\n ... * http://somewhere.in/time?track=[02]#wasted-years\n ... '''\n\n >>> for uri in find_uris_in_text(text):\n ... print(uri)\n http://localhost/a/b\n http://launchpad.net/\n mailto:joe@example.com\n xmpp:fred@example.org\n http://bazaar.launchpad.net/~name12/firefox/foo\n http://somewhere.in/time?track=[02]#wasted-years\n\n===============\nOther Documents\n===============\n\n.. toctree::\n :glob:\n\n *\n docs/*\n\n=================\nNEWS for lazr.uri\n=================\n\n1.0.3 (2012-01-18)\n==================\n\n- Add compatibility with Python 3 (Thomas Kluyver).\n\n1.0.1 (2009-06-01)\n==================\n\n- Eliminate dependency on setuptools_bzr so sdists do not bring bzr ini, among\n others.\n\n1.0 (2009-03-23)\n================\n\n- Initial release on PyPI", "description_content_type": null, "docs_url": null, "download_url": "https://launchpad.net/lazr.uri/+download", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://launchpad.net/lazr.uri", "keywords": null, "license": "LGPL v3", "maintainer": null, "maintainer_email": null, "name": "lazr.uri", "package_url": "https://pypi.org/project/lazr.uri/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/lazr.uri/", "project_urls": { "Download": "https://launchpad.net/lazr.uri/+download", "Homepage": "https://launchpad.net/lazr.uri" }, "release_url": "https://pypi.org/project/lazr.uri/1.0.3/", "requires_dist": null, "requires_python": null, "summary": "A self-contained, easily reusable library for parsing, manipulating,", "version": "1.0.3" }, "last_serial": 1497529, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "b50d510b1aed435ed2a6a4c90dac5df1", "sha256": "99487ea618db9ae1b21c1f7cc1f26d10cacbee0f0fe88537db1dcbd48c2026f8" }, "downloads": -1, "filename": "lazr.uri-1.0.tar.gz", "has_sig": false, "md5_digest": "b50d510b1aed435ed2a6a4c90dac5df1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19774, "upload_time": "2009-03-23T23:38:25", "url": "https://files.pythonhosted.org/packages/5f/c7/3ad5dbff978bcd1c2d3df57c00417d2de46310b36f7a6a51a2eb84801027/lazr.uri-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "7ffdc036eec003107fc0f9be43d2af04", "sha256": "956515d5c44299c59be1f18ff0227e4c8c157350bf5f41f05b99a5d6fb836759" }, "downloads": -1, "filename": "lazr.uri-1.0.1.tar.gz", "has_sig": false, "md5_digest": "7ffdc036eec003107fc0f9be43d2af04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19296, "upload_time": "2009-06-01T17:43:47", "url": "https://files.pythonhosted.org/packages/22/e2/9c57d20dd513343fb16b2a16c3a7e83951566406daf8ff9f82cc084057eb/lazr.uri-1.0.1.tar.gz" } ], "1.0.2": [], "1.0.3": [ { "comment_text": "", "digests": { "md5": "1ae177e147092ae934b7edc3f8555665", "sha256": "5c620b5993c8c6a73084176bfc51de64972b8373620476ed841931a49752dc8b" }, "downloads": -1, "filename": "lazr.uri-1.0.3.tar.gz", "has_sig": false, "md5_digest": "1ae177e147092ae934b7edc3f8555665", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18601, "upload_time": "2012-01-18T15:17:58", "url": "https://files.pythonhosted.org/packages/ea/bf/71ad2f5eaf7885d36e3cbd0a87cf3812ad043cf99c9fa6cc6ab4c94ee862/lazr.uri-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1ae177e147092ae934b7edc3f8555665", "sha256": "5c620b5993c8c6a73084176bfc51de64972b8373620476ed841931a49752dc8b" }, "downloads": -1, "filename": "lazr.uri-1.0.3.tar.gz", "has_sig": false, "md5_digest": "1ae177e147092ae934b7edc3f8555665", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18601, "upload_time": "2012-01-18T15:17:58", "url": "https://files.pythonhosted.org/packages/ea/bf/71ad2f5eaf7885d36e3cbd0a87cf3812ad043cf99c9fa6cc6ab4c94ee862/lazr.uri-1.0.3.tar.gz" } ] }