{ "info": { "author": "Stian Soiland-Reyes", "author_email": "stain@apache.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Build Tools", "Topic :: System :: Archiving", "Topic :: System :: Archiving :: Packaging" ], "description": "arcp-py\n=======\n\nCreate/parse arcp_ (Archive and Package) URIs.\n\n.. image:: https://readthedocs.org/projects/arcp/badge/?version=latest\n :target: http://arcp.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1162749.svg\n :target: https://doi.org/10.5281/zenodo.1162749\n.. image:: https://travis-ci.org/stain/arcp-py.svg?branch=master\n :target: https://travis-ci.org/stain/arcp-py\n.. image:: https://img.shields.io/pypi/v/arcp.svg?maxAge=86400\n :target: https://pypi.org/project/arcp/\n.. image:: https://coveralls.io/repos/github/stain/arcp-py/badge.svg?branch=master\n :target: https://coveralls.io/github/stain/arcp-py?branch=master\n.. image:: https://codecov.io/gh/stain/arcp-py/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/stain/arcp-py\n\n\n\n\nIntroduction\n------------\n\n``arcp`` provides functions for creating arcp_ URIs, \nwhich can be used for identifying or parsing hypermedia \nfiles packaged in an archive or package, like a ZIP file.\n\narcp URIs can be used to consume or reference hypermedia resources \nbundled inside a file archive or an application package, as well as \nto resolve URIs for archive resources within a programmatic framework.\n\nThis URI scheme provides mechanisms to generate a unique base URI \nto represent the root of the archive, so that relative URI references \nin a bundled resource can be resolved within the archive without having to extract the archive content on the local file system.\n\nAn arcp URI can be used for purposes of isolation (e.g. when consuming \nmultiple archives), security constraints (avoiding \u201cclimb out\u201d from the\narchive), or for externally identiyfing sub-resources referenced by\nhypermedia formats.\n\nExamples:\n - ``arcp://uuid,32a423d6-52ab-47e3-a9cd-54f418a48571/doc.html``\n - ``arcp://uuid,b7749d0b-0e47-5fc4-999d-f154abe68065/pics/``\n - ``arcp://ni,sha-256;F-34D4TUeOfG0selz7REKRDo4XePkewPeQYtjL3vQs0/``\n - ``arcp://name,gallery.example.org/``\n\nThe different forms of URI authority_ in arcp URIs can be used depending\non which uniqueness constraints to apply when addressing an archive.\nSee the arcp_ specification (*draft-soilandreyes-arcp*) for details.\n\nNote that this library only provides mechanisms to \n*generate* and *parse* arcp URIs, and do *not* integrate with any \nparticular archive or URL handling modules like \n``zipfile`` or ``urllib.request``.\n\n\nLicense\n-------\n\n\u00a9 2018 Stian Soiland-Reyes , The University of Manchester, UK\n\nLicensed under the \nApache License, version 2.0 , \nsee the file LICENSE.txt for details.\n\nContribute\n----------\n\nSource code: \n\nFeel free to raise a pull request at \nor an issue at .\n\nSubmitted contributions are assumed to be covered by section 5 of the Apache License 2.0.\n\nInstalling\n----------\n\nYou will need Python 2.7, Python 3.4 or later (Recommended: 3.6).\n\nIf you have pip_, then the easiest is normally to install from using::\n\n pip install arcp\n\nIf you want to install manually from this code base, then try::\n\n python setup.py install\n\nUsage\n------\n\nFor full documentation, see or use ``help(arcp)``\n\nThis module provides functions for creating arcp_ URIs, \nwhich can be used for identifying or parsing hypermedia \nfiles packaged in an archive or package, like a ZIP file:: python\n\n >>> from arcp import *\n\n >>> arcp_random()\n 'arcp://uuid,dcd6b1e8-b3a2-43c9-930b-0119cf0dc538/'\n\n >>> arcp_random(\"/foaf.ttl\", fragment=\"me\")\n 'arcp://uuid,dcd6b1e8-b3a2-43c9-930b-0119cf0dc538/foaf.ttl#me'\n\n >>> arcp_hash(b\"Hello World!\", \"/folder/\")\n 'arcp://ni,sha-256;f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk/folder/'\n\n >>> arcp_location(\"http://example.com/data.zip\", \"/file.txt\")\n 'arcp://uuid,b7749d0b-0e47-5fc4-999d-f154abe68065/file.txt'\n\narcp URLs can be used with ``urllib.parse``, \nfor instance using ``urljoin`` to resolve relative references::\n\n >>> css = arcp.arcp_name(\"app.example.com\", \"css/style.css\")\n >>> urllib.parse.urljoin(css, \"../fonts/foo.woff\")\n 'arcp://name,app.example.com/fonts/foo.woff'\n\n\nIn addition this module provides functions that can be used\nto parse arcp URIs into its constituent fields:: python\n\n >>> is_arcp_uri(\"arcp://uuid,b7749d0b-0e47-5fc4-999d-f154abe68065/file.txt\")\n True\n\n >>> is_arcp_uri(\"http://example.com/t\")\n False\n\n >>> u = parse_arcp(\"arcp://uuid,b7749d0b-0e47-5fc4-999d-f154abe68065/file.txt\")\n ARCPSplitResult(scheme='arcp',prefix='uuid',name='b7749d0b-0e47-5fc4-999d-f154abe68065',\n uuid='b7749d0b-0e47-5fc4-999d-f154abe68065',path='/file.txt',query='',fragment='')\n\n >>> u.path\n '/file.txt'\n >>> u.prefix\n 'uuid'\n >>> u.uuid\n UUID('b7749d0b-0e47-5fc4-999d-f154abe68065')\n >>> u.uuid.version\n 5\n\n >>> parse_arcp(\"arcp://ni,sha-256;f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk/folder/\").hash\n ('sha-256', '7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069')\n\nThe object returned from ``parse_arcp`` is similar to \n``ParseResult`` from ``urlparse``, but contains additional properties \n``prefix``, ``uuid``, ``ni``, ``hash`` and ``name``, \nsome of which will be ``None`` depending on the arcp prefix.\n\nThe function ``arcp.parse.urlparse`` can be imported as an alternative \nto ``urllib.parse.urlparse``. If the scheme is ``arcp`` then the extra \narcp fields like `prefix`, `uuid`, `hash` and `name` are available\nas from `parse_arcp`, otherwise the output is the same as from \nregular `urlparse`:: python\n\n >>> from arcp.parse import urlparse\n >>> urlparse(\"arcp://ni,sha-256;f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk/folder/soup;sads\")\n ARCPParseResult(scheme='arcp',prefix='ni',\n name='sha-256;f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk',\n ni='sha-256;f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk',\n hash=('sha-256', '7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069',\n path='/folder/soup;sads',query='',fragment='')\n >>> urlparse(\"http://example.com/help?q=a\")\n ParseResult(scheme='http', netloc='example.com', path='/help', params='', \n query='q=a', fragment='')\n\n\n\n.. _arcp: https://tools.ietf.org/html/draft-soilandreyes-arcp-02\n.. _pip: https://docs.python.org/3/installing/\n.. _authority: https://tools.ietf.org/id/draft-soilandreyes-arcp-02.html#rfc.section.4.1\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/stain/arcp-py/archive/0.1.0.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://arcp.readthedocs.io/", "keywords": "arcp uri url iri archive package", "license": "Apache License, Version 2.0", "maintainer": "", "maintainer_email": "", "name": "arcp", "package_url": "https://pypi.org/project/arcp/", "platform": "", "project_url": "https://pypi.org/project/arcp/", "project_urls": { "Download": "https://github.com/stain/arcp-py/archive/0.1.0.tar.gz", "Homepage": "http://arcp.readthedocs.io/" }, "release_url": "https://pypi.org/project/arcp/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "arcp (Archive and Package) URI parser and generator", "version": "0.2.0" }, "last_serial": 3553487, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "0fd6a7326ba2be2892775f6c2b23b1fe", "sha256": "d4cb05a16d1ac0a328f5d9c1abdc4771b2f4f1fbf31e0892a5f589eb1a9437b1" }, "downloads": -1, "filename": "arcp-0.1.0-py3-none-any.whl", "has_sig": true, "md5_digest": "0fd6a7326ba2be2892775f6c2b23b1fe", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14532, "upload_time": "2018-01-30T14:26:57", "url": "https://files.pythonhosted.org/packages/c4/c7/da53c2025d616a19a93f39c3216ddb8cf9277d0c276e98dcf863889be577/arcp-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b1281691ec5607918aa7ec3ce6cef529", "sha256": "41a11f83e7dc1db91aeb6fc3b08cf3eb7f286937e484dc9aa46b35a776e395ed" }, "downloads": -1, "filename": "arcp-0.1.0.tar.gz", "has_sig": true, "md5_digest": "b1281691ec5607918aa7ec3ce6cef529", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7561, "upload_time": "2018-01-30T14:26:58", "url": "https://files.pythonhosted.org/packages/5e/d9/52c0992789f555137982a4d6d05c1b7483408400fdb595ad01679d2b3ea9/arcp-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "3985d589c7893177512b8304ff2eff5e", "sha256": "232c5d88490408dc97b0f9f753c9444cff95e473acb539606d3af0ac9eb532dc" }, "downloads": -1, "filename": "arcp-0.2.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "3985d589c7893177512b8304ff2eff5e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 15177, "upload_time": "2018-02-05T14:23:04", "url": "https://files.pythonhosted.org/packages/bb/62/93e9d0947aba625bf42e82237f505aa10fcb4078d4ed51e7bf8a85d8978b/arcp-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2d2f031d76a801ea40620401d1048825", "sha256": "ad9df671a6cacfb44e85cd2971eee87e663a5bbf84618b31476b9b452bb01a41" }, "downloads": -1, "filename": "arcp-0.2.0.tar.gz", "has_sig": true, "md5_digest": "2d2f031d76a801ea40620401d1048825", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10011, "upload_time": "2018-02-05T14:23:06", "url": "https://files.pythonhosted.org/packages/e3/7c/c55af9af92bf23617c32ad672d53291ed0822b100053996255d1f19e27f1/arcp-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3985d589c7893177512b8304ff2eff5e", "sha256": "232c5d88490408dc97b0f9f753c9444cff95e473acb539606d3af0ac9eb532dc" }, "downloads": -1, "filename": "arcp-0.2.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "3985d589c7893177512b8304ff2eff5e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 15177, "upload_time": "2018-02-05T14:23:04", "url": "https://files.pythonhosted.org/packages/bb/62/93e9d0947aba625bf42e82237f505aa10fcb4078d4ed51e7bf8a85d8978b/arcp-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2d2f031d76a801ea40620401d1048825", "sha256": "ad9df671a6cacfb44e85cd2971eee87e663a5bbf84618b31476b9b452bb01a41" }, "downloads": -1, "filename": "arcp-0.2.0.tar.gz", "has_sig": true, "md5_digest": "2d2f031d76a801ea40620401d1048825", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10011, "upload_time": "2018-02-05T14:23:06", "url": "https://files.pythonhosted.org/packages/e3/7c/c55af9af92bf23617c32ad672d53291ed0822b100053996255d1f19e27f1/arcp-0.2.0.tar.gz" } ] }