{ "info": { "author": "Brian Stack", "author_email": "bstack@mozilla.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "# Taskcluster URL Building Library\n\n[![License](https://img.shields.io/badge/license-MPL%202.0-orange.svg)](http://mozilla.org/MPL/2.0)\n\nA simple library to generate URLs for various Taskcluster resources across our various deployment methods.\n\nThis serves as both a simple shim for projects that use JavaScript but also is the reference implementation for\nhow we define these paths.\n\nURLs are defined in the 'Taskcluster URL Format' document.\n\nChangelog\n---------\nView the changelog on the [releases page](https://github.com/taskcluster/taskcluster-lib-urls/releases).\n\nRequirements\n------------\n\nThis is tested on and should run on any of Node.js `{8, 10}`.\n\nJS Usage\n--------\n[![Node.js Build Status](https://travis-ci.org/taskcluster/taskcluster-lib-urls.svg?branch=master)](https://travis-ci.org/taskcluster/taskcluster-lib-urls)\n[![npm](https://img.shields.io/npm/v/taskcluster-lib-urls.svg?maxAge=2592000)](https://www.npmjs.com/package/taskcluster-lib-urls)\n\nThis package exports several methods for generating URLs conditionally based on\na root URL, as well as a few helper classes for generating URLs for a pre-determined\nroot URL:\n\n* `api(rootUrl, service, version, path)` -> `String`\n* `apiReference(rootUrl, service, version)` -> `String`\n* `docs(rootUrl, path)` -> `String`\n* `exchangeReference(rootUrl, service, version)` -> `String`\n* `schema(rootUrl, service, schema)` -> `String`\n* `ui(rootUrl, path)` -> `String`\n* `servicesManifest(rootUrl)` -> `String`\n* `testRootUrl()` -> `String`\n* `withRootUrl(rootUrl)` -> `Class` instance for above methods\n\nWhen the `rootUrl` is `https://taskcluster.net`, the generated URLs will be to the Heroku cluster. Otherwise they will follow the\n[spec defined in this project](https://github.com/taskcluster/taskcluster-lib-urls/tree/master/docs/urls-spec.md).\n\n`testRootUrl()` is used to share a common fake `rootUrl` between various Taskcluster mocks in testing.\nThe URL does not resolve.\n\n```js\n// Specifying root URL every time:\nconst libUrls = require('taskcluster-lib-urls');\n\nlibUrls.api(rootUrl, 'auth', 'v1', 'foo/bar');\nlibUrls.schema(rootUrl, 'auth', 'v1/foo.yml'); // Note that schema names have versions in them\nlibUrls.apiReference(rootUrl, 'auth', 'v1');\nlibUrls.exchangeReference(rootUrl, 'auth', 'v1');\nlibUrls.ui(rootUrl, 'foo/bar');\nlibUrls.servicesManifest(rootUrl);\nlibUrls.docs(rootUrl, 'foo/bar');\n```\n\n```js\n// Specifying root URL in advance:\nconst libUrls = require('taskcluster-lib-urls');\n\nconst urls = libUrls.withRoot(rootUrl);\n\nurls.api('auth', 'v1', 'foo/bar');\nurls.schema('auth', 'v1/foo.yml');\nurls.apiReference('auth', 'v1');\nurls.exchangeReference('auth', 'v1');\nurls.ui('foo/bar');\nurls.servicesManifest();\nurls.docs('foo/bar');\n```\n\nIf you would like, you can set this up via [taskcluster-lib-loader](https://github.com/taskcluster/taskcluster-lib-loader) as follows:\n\n```js\n{\n libUrlss: {\n require: ['cfg'],\n setup: ({cfg}) => withRootUrl(cfg.rootURl),\n },\n}\n```\n\nTest with:\n\n```\nyarn install\nyarn test\n```\n\n\nGo Usage\n--------\n\n[![GoDoc](https://godoc.org/github.com/taskcluster/taskcluster-lib-urls?status.svg)](https://godoc.org/github.com/taskcluster/taskcluster-lib-urls)\n\nThe go package exports the following functions:\n\n```go\nfunc API(rootURL string, service string, version string, path string) string\nfunc APIReference(rootURL string, service string, version string) string\nfunc Docs(rootURL string, path string) string\nfunc ExchangeReference(rootURL string, service string, version string) string\nfunc Schema(rootURL string, service string, name string) string\nfunc UI(rootURL string, path string) string\nfunc ServicesManifest(rootURL string) string\n```\n\nInstall with:\n\n```\ngo install ./..\n```\n\nTest with:\n\n```\ngo test -v ./...\n```\n\nPython Usage\n------------\n\nYou can install the python client with `pip install taskcluster-urls`;\n\n```python\nimport taskcluster_urls\n\ntaskcluster_urls.api(root_url, 'auth', 'v1', 'foo/bar')\ntaskcluster_urls.schema(root_url, 'auth', 'v1/foo.yml') # Note that schema names have versions in them\ntaskcluster_urls.api_reference(root_url, 'auth', 'v1')\ntaskcluster_urls.exchange_reference(root_url, 'auth', 'v1')\ntaskcluster_urls.ui(root_url, 'foo/bar')\ntaskcluster_urls.servicesManifest(root_url)\ntaskcluster_urls.docs(root_url, 'foo/bar')\n\nAnd for testing,\n```python\ntaskcluster_urls.test_root_url()\n```\n\nTest with:\n\n```\ntox\n```\n\nJava Usage\n----------\n\n[![JavaDoc](https://img.shields.io/badge/javadoc-reference-blue.svg)](http://taskcluster.github.io/taskcluster-lib-urls/apidocs)\n\nIn order to use this library from your maven project, simply include it as a project dependency:\n\n```\n\n ...\n \n ...\n \n org.mozilla.taskcluster\n taskcluster-lib-urls\n 1.0.0\n \n \n\n```\n\nThe taskcluster-lib-urls artifacts are now available from the [maven central repository](http://central.sonatype.org/):\n\n* [Search Results](http://search.maven.org/#search|gav|1|g%3A%22org.mozilla.taskcluster%22%20AND%20a%3A%22taskcluster-lib-urls%22)\n* [Directory Listing](https://repo1.maven.org/maven2/org/mozilla/taskcluster/taskcluster-lib-urls/)\n\nTo use the library, do as follows:\n\n```java\nimport org.mozilla.taskcluster.urls.*;\n\n...\n\n URLProvider urlProvider = URLs.provider(\"https://mytaskcluster.acme.org\");\n\n String fooBarAPI = urlProvider.api(\"auth\", \"v1\", \"foo/bar\");\n String fooSchema = urlProvider.schema(\"auth\", \"v1/foo.yml\"); // Note that schema names have versions in them\n String authAPIRef = urlProvider.apiReference(\"auth\", \"v1\");\n String authExchangesRef = urlProvider.exchangeReference(\"auth\", \"v1\");\n String uiFooBar = urlProvider.ui(\"foo/bar\");\n String servicesManifest = urlProvider.servicesManifest();\n String docsFooBar = urlProvider.docs(\"foo/bar\");\n\n...\n```\n\nInstall with:\n\n```\nmvn install\n```\n\nTest with:\n\n```\nmvn test\n```\n\n\nReleasing\n---------\n\nNew releases should be tested on Travis and Taskcluster to allow for all supported versions of various languages to be tested. Once satisfied that it works, new versions should be created with\n`npm version` rather than by manually editing `package.json` and tags should be pushed to Github. \n\nMake the Node release first, as Python's version depends on its `package.json`. This follows the typical tag-and-push-to-publish approach:\n\n```sh\n$ npm version minor # or patch, or major\n$ git push upstream\n```\n\nOnce that's done, build the Python sdists (only possible by the [maintainers on pypi](https://pypi.org/project/taskcluster-urls/#files)):\n\n```sh\nrm -rf dist/*\npython setup.py sdist bdist_wheel\npython3 setup.py bdist_wheel\npip install twine\ntwine upload dist/*\n```\n\nMake sure to update [the changelog](https://github.com/taskcluster/taskcluster-lib-urls/releases)!\n\nLicense\n-------\n\n[Mozilla Public License Version 2.0](https://github.com/taskcluster/taskcluster-lib-urls/blob/master/LICENSE)\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/taskcluster/taskcluster-lib-urls", "keywords": "", "license": "MPL2", "maintainer": "", "maintainer_email": "", "name": "taskcluster-urls", "package_url": "https://pypi.org/project/taskcluster-urls/", "platform": "", "project_url": "https://pypi.org/project/taskcluster-urls/", "project_urls": { "Homepage": "https://github.com/taskcluster/taskcluster-lib-urls" }, "release_url": "https://pypi.org/project/taskcluster-urls/11.0.0/", "requires_dist": null, "requires_python": "", "summary": "Standardized url generator for taskcluster resources.", "version": "11.0.0" }, "last_serial": 4364735, "releases": { "1.1.0": [ { "comment_text": "", "digests": { "md5": "ac401c8c5a6101420ae995d2be2a87ed", "sha256": "f400b0aaffc646c91f563ef9f8ddeca7a57d63d07d33597ecc471ed7e25b906d" }, "downloads": -1, "filename": "taskcluster_urls-1.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "ac401c8c5a6101420ae995d2be2a87ed", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 5563, "upload_time": "2018-05-24T03:57:41", "url": "https://files.pythonhosted.org/packages/b6/c7/ffc53d3b4d4a50bb7933973bb82aa3970fa1b81eefe481ba8e6fb8497343/taskcluster_urls-1.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2f2624c3c4dfb541101fb524006d9e8e", "sha256": "249de6565777c767494927806dfe01a331b0d64eacfba25ddb2409ac8e932f71" }, "downloads": -1, "filename": "taskcluster_urls-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "2f2624c3c4dfb541101fb524006d9e8e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3240, "upload_time": "2018-05-24T03:57:44", "url": "https://files.pythonhosted.org/packages/94/1d/d7c356b90376f79de5296f466a1332d92ff8e58332ac34df05d322c2be0c/taskcluster_urls-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "63ce494605f080140b0ea266bd2cced5", "sha256": "4d847c27c0067e099890b606315866d53c0e3b80214f876cf1b44cb0b72b2fa2" }, "downloads": -1, "filename": "taskcluster-urls-1.1.0.tar.gz", "has_sig": false, "md5_digest": "63ce494605f080140b0ea266bd2cced5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9386, "upload_time": "2018-05-24T03:57:46", "url": "https://files.pythonhosted.org/packages/c5/ff/4d25c5f47b8e1ad763fb1a633e988cf71abdf9d5b3499889a2ae7417b134/taskcluster-urls-1.1.0.tar.gz" } ], "10.1.0": [ { "comment_text": "", "digests": { "md5": "6988b5451cf1e02102eb369cb507bcab", "sha256": "c15459df52813c21312b8dc608df8f5069cb47a7114946738d953c3d383f4a0b" }, "downloads": -1, "filename": "taskcluster_urls-10.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "6988b5451cf1e02102eb369cb507bcab", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 3363, "upload_time": "2018-09-07T18:59:39", "url": "https://files.pythonhosted.org/packages/c2/73/b455053b1cf83dbbbad757e787241a36e174ea56b4a0757187055ae9a0ba/taskcluster_urls-10.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5647f17d8a29e1810bc23505f6fa838b", "sha256": "2a26f33f948c8c1820f9b7992d9964a10462729b4bd223565a5f19df828c09ce" }, "downloads": -1, "filename": "taskcluster_urls-10.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5647f17d8a29e1810bc23505f6fa838b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3364, "upload_time": "2018-09-07T18:59:40", "url": "https://files.pythonhosted.org/packages/80/68/37c490004278adcc0cb06740a7371ed6fdb147df3f5b03ab989474e614d5/taskcluster_urls-10.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8e5edd3358e3d8dcd6bdbd7d44f6a179", "sha256": "a572a8a5f2db1cef3d36d1b2b7d7bdba97d66c1f9b61e45bd2dce32e41d03e34" }, "downloads": -1, "filename": "taskcluster-urls-10.1.0.tar.gz", "has_sig": false, "md5_digest": "8e5edd3358e3d8dcd6bdbd7d44f6a179", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9543, "upload_time": "2018-09-07T18:59:42", "url": "https://files.pythonhosted.org/packages/30/e7/dec333d28f7a34dace5bcb7cd78deeb97e5efa61f75309ae230d8881f401/taskcluster-urls-10.1.0.tar.gz" } ], "11.0.0": [ { "comment_text": "", "digests": { "md5": "a759a01386936b56c7ded279809a2bce", "sha256": "74bd2110b5daaebcec5e1d287bf137b61cb8cf6b2d8f5f2b74183e32bc4e7c87" }, "downloads": -1, "filename": "taskcluster_urls-11.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "a759a01386936b56c7ded279809a2bce", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 4306, "upload_time": "2018-10-11T14:52:37", "url": "https://files.pythonhosted.org/packages/76/f1/a7eb3ec130b19eccb41e2dab84514f963e50e4a435d93d1c51607a334b2b/taskcluster_urls-11.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "97954dae2dfa7d4c73f8269494827fca", "sha256": "2aceab7cf5b1948bc197f2e5e50c371aa48181ccd490b8bada00f1e3baf0c5cc" }, "downloads": -1, "filename": "taskcluster_urls-11.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "97954dae2dfa7d4c73f8269494827fca", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4306, "upload_time": "2018-10-11T14:52:39", "url": "https://files.pythonhosted.org/packages/cf/24/ae4f15fec931d7cba98c8ff6ec93353c12c7fb07ef91b256113b3431f834/taskcluster_urls-11.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "49842b62433d7c6b4c4c48cc3563bf58", "sha256": "18dcaa9c2412d34ff6c78faca33f0dd8f2384e3f00a98d5832c62d6d664741f0" }, "downloads": -1, "filename": "taskcluster-urls-11.0.0.tar.gz", "has_sig": false, "md5_digest": "49842b62433d7c6b4c4c48cc3563bf58", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10216, "upload_time": "2018-10-11T14:52:40", "url": "https://files.pythonhosted.org/packages/69/c1/1f0efd104c7bd6dbb42a7d0c7f1f5f4be05c108e873add8f466e6de9f387/taskcluster-urls-11.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a759a01386936b56c7ded279809a2bce", "sha256": "74bd2110b5daaebcec5e1d287bf137b61cb8cf6b2d8f5f2b74183e32bc4e7c87" }, "downloads": -1, "filename": "taskcluster_urls-11.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "a759a01386936b56c7ded279809a2bce", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 4306, "upload_time": "2018-10-11T14:52:37", "url": "https://files.pythonhosted.org/packages/76/f1/a7eb3ec130b19eccb41e2dab84514f963e50e4a435d93d1c51607a334b2b/taskcluster_urls-11.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "97954dae2dfa7d4c73f8269494827fca", "sha256": "2aceab7cf5b1948bc197f2e5e50c371aa48181ccd490b8bada00f1e3baf0c5cc" }, "downloads": -1, "filename": "taskcluster_urls-11.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "97954dae2dfa7d4c73f8269494827fca", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4306, "upload_time": "2018-10-11T14:52:39", "url": "https://files.pythonhosted.org/packages/cf/24/ae4f15fec931d7cba98c8ff6ec93353c12c7fb07ef91b256113b3431f834/taskcluster_urls-11.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "49842b62433d7c6b4c4c48cc3563bf58", "sha256": "18dcaa9c2412d34ff6c78faca33f0dd8f2384e3f00a98d5832c62d6d664741f0" }, "downloads": -1, "filename": "taskcluster-urls-11.0.0.tar.gz", "has_sig": false, "md5_digest": "49842b62433d7c6b4c4c48cc3563bf58", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10216, "upload_time": "2018-10-11T14:52:40", "url": "https://files.pythonhosted.org/packages/69/c1/1f0efd104c7bd6dbb42a7d0c7f1f5f4be05c108e873add8f466e6de9f387/taskcluster-urls-11.0.0.tar.gz" } ] }