{"id":5076,"library":"taskcluster-urls","title":"Taskcluster URLs","description":"Taskcluster-urls is a Python library that provides a standardized way to generate URLs for various Taskcluster resources, such as tasks, artifacts, and releases. It helps integrate with the Taskcluster ecosystem by providing a consistent API for URL construction. As of version 13.0.2, it's actively maintained, with releases often tied to a monorepo that includes JavaScript and Go implementations, so not all version bumps directly imply Python-specific changes.","status":"active","version":"13.0.2","language":"en","source_language":"en","source_url":"https://github.com/taskcluster/taskcluster-lib-urls","tags":["taskcluster","urls","links","generator","mozilla"],"install":[{"cmd":"pip install taskcluster-urls","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"TaskclusterUrls","correct":"from taskcluster_urls import TaskclusterUrls"}],"quickstart":{"code":"import os\nfrom taskcluster_urls import TaskclusterUrls\n\n# Replace with your Taskcluster root URL or set as an environment variable\nroot_url = os.environ.get('TASKCLUSTER_ROOT_URL', 'https://taskcluster.net')\n\ntry:\n    urls = TaskclusterUrls(root_url)\n\n    # Example 1: Get a URL for a specific task in the queue\n    task_id = 'my-task-id'\n    run_id = 'my-run-id'\n    queue_task_url = urls.queue.task(task_id, run_id)\n    print(f\"Queue Task URL: {queue_task_url}\")\n\n    # Example 2: Get a URL for a specific artifact of a task\n    artifact_path = 'public/logs/live_logs.txt'\n    artifact_url = urls.queue.artifact(task_id, run_id, artifact_path)\n    print(f\"Artifact URL: {artifact_url}\")\n\n    # Example 3: Get a URL related to a release\n    release_id = 'my-release-id'\n    release_task_url = urls.release(release_id).task(task_id, run_id)\n    print(f\"Release Task URL: {release_task_url}\")\n\nexcept ValueError as e:\n    print(f\"Error initializing TaskclusterUrls: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize `TaskclusterUrls` with a root URL and generate common Taskcluster resource URLs like tasks, artifacts, and release-specific links. It uses an environment variable for the root URL for flexibility."},"warnings":[{"fix":"Replace `urls.servicesManifest()` with `urls.apiManifest()`.","message":"In v12.0.0, the `servicesManifest` method was renamed to `apiManifest`. Calls to the old method will fail.","severity":"breaking","affected_versions":">=12.0.0"},{"fix":"If you relied on the old `testRootUrl`, update your configuration or test expectations to reflect the new default, or explicitly set your desired root URL.","message":"In v11.0.0, the default `testRootUrl` used within the library changed from `https://tc-tests.localhost` to `https://tc-tests.example.com`. This primarily affects internal testing or any consumer relying on this specific default for test environments.","severity":"breaking","affected_versions":">=11.0.0"},{"fix":"Always provide a non-empty string as the `rootUrl` when initializing `TaskclusterUrls`, e.g., `TaskclusterUrls('https://taskcluster.net')`.","message":"The `TaskclusterUrls` constructor requires a valid `rootUrl`. Passing an empty or `None` value will raise a `ValueError`.","severity":"gotcha","affected_versions":">=10.1.1"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}