{"library":"macaroonbakery","title":"Macaroon Bakery","description":"macaroonbakery is a Python library that provides higher-level operations for working with macaroons, building upon the core `pymacaroons` library. It implements the httpbakery conventions, allowing for automatic gathering of discharge macaroons for third-party caveats. The library is currently at version 1.3.4 and, while listed as '2 - Pre-Alpha' on PyPI, shows recent activity on its GitHub repository, suggesting active maintenance.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install macaroonbakery"],"cli":null},"imports":["from macaroonbakery import httpbakery","from macaroonbakery.httpbakery import BakeryAuth"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import requests\nfrom macaroonbakery import httpbakery\nimport os\n\n# A placeholder for a URL protected by a macaroon bakery service.\n# In a real application, this would be a URL to your service.\nPROTECTED_URL = os.environ.get('MACAROON_PROTECTED_URL', 'http://localhost:8080/protected')\n\n# Initialize a RequestsCookieJar to store macaroons\njar = requests.cookies.RequestsCookieJar()\n\ntry:\n    # Make a request using BakeryAuth. It will handle macaroon acquisition.\n    # For the first request, it might redirect to an authentication service.\n    resp = requests.get(\n        PROTECTED_URL,\n        cookies=jar,\n        auth=httpbakery.BakeryAuth(cookies=jar)\n    )\n    resp.raise_for_status() # Raise an exception for HTTP errors\n\n    print(f\"Successfully accessed {PROTECTED_URL}. Response: {resp.text[:100]}...\")\n    # Subsequent requests will reuse the macaroons in the jar\n\nexcept requests.exceptions.HTTPError as e:\n    print(f\"HTTP Error: {e.response.status_code} - {e.response.text}\")\nexcept requests.exceptions.RequestException as e:\n    print(f\"Request failed: {e}\")","lang":"python","description":"This quickstart demonstrates how to use `macaroonbakery.httpbakery.BakeryAuth` to interact with a protected URL. It automatically manages the acquisition and storage of macaroons using a `RequestsCookieJar`. The `PROTECTED_URL` should be replaced with an actual endpoint that uses macaroon-based authentication. The first request might trigger a redirection to an authentication provider, which `BakeryAuth` is designed to handle.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":"1.3.4","pypi_latest":"1.3.4","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":3.3,"avg_import_s":0.84,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"macaroonbakery","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.84,"mem_mb":13.6,"disk_size":"32.5M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"macaroonbakery","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.5,"import_time_s":0.54,"mem_mb":12.6,"disk_size":"33M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"macaroonbakery","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.22,"mem_mb":14.9,"disk_size":"35.7M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"macaroonbakery","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.4,"import_time_s":0.77,"mem_mb":14.1,"disk_size":"37M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"macaroonbakery","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.14,"mem_mb":15.3,"disk_size":"27.4M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"macaroonbakery","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.9,"import_time_s":0.8,"mem_mb":14.4,"disk_size":"28M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"macaroonbakery","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.06,"mem_mb":16.2,"disk_size":"27.1M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"macaroonbakery","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.9,"import_time_s":0.76,"mem_mb":15.3,"disk_size":"28M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"macaroonbakery","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.68,"mem_mb":13.2,"disk_size":"32.5M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"macaroonbakery","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4,"import_time_s":0.61,"mem_mb":12.3,"disk_size":"33M"}]}}