macaroonbakery
A Python library port for bakery, higher level operation to work with macaroons
What it is and what it does
Macaroonbakery is a Python library that implements higher-level operations for working with macaroons—cryptographic authorization tokens—in HTTP contexts. It provides a BakeryAuth handler that integrates with the requests library to transparently manage macaroon cookies across multiple HTTP requests to protected endpoints. The library handles the complexity of macaroon validation and cookie storage, allowing developers to authenticate to macaroon-protected services without manually managing the cryptographic handshake.
The package depends on a substantial cryptographic stack (PyNaCl, cryptography, pyOpenSSL, pymacaroons) and is designed primarily for systems that use macaroon-based authorization schemes. It was developed as a port of Go's macaroon-bakery library and is most useful in environments where macaroon authentication is already the standard—such as Juju, Canonical's orchestration platform, or other systems built around macaroon-based access control.
Use it for:
- Authenticate to Juju or other macaroon-bakery-protected services using Python HTTP clients.
- Manage macaroon cookies across multiple requests to the same protected API without re-authenticating.
- Integrate macaroon-based authorization into Python applications that need to call protected endpoints.
- Handle cryptographic cookie validation and refresh transparently in HTTP workflows.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Macaroonbakery provides HTTP authentication and cookie handling for macaroon-based access control, integrating with the requests library to manage macaroon cookies across protected API calls.
Yes, but with caution. Install if you need to authenticate to a macaroon-bakery-protected service and have no alternative. The low install friction and absence of known vulnerabilities are positives, but the dormant maintenance status (975 days since last release, no commits since May 2024) and outdated Python version support (classifiers only list up to 3.5) mean you should verify compatibility with your target Python version and dependencies before committing to production use.
Install
macaroonbakery on PyPI
pip
pip install macaroonbakeryuv
uv add macaroonbakerypoetry
poetry add macaroonbakeryInstalling macaroonbakery
Before you install
Low install friction with a pure-Python wheel, but maintenance is dormant—last release was 975 days ago and the repository shows no recent commits since 2024-05-23. The 11 runtime dependencies include cryptographic libraries (PyNaCl, cryptography, pyOpenSSL) that may require system libraries like libsodium on some platforms.
License in practice
Licensed under LGPLv3 (copyleft). Any derivative work or modification must be released under the same license; static linking or bundling may trigger copyleft obligations depending on how you distribute the software.
Quickstart
pip install macaroonbakery
from macaroonbakery import httpbakery
import requests
jar = requests.cookies.RequestsCookieJar()
resp = requests.get('https://example.com/protected',
cookies=jar,
auth=httpbakery.BakeryAuth(cookies=jar))
libsodium system library may be required on some platforms; see installation notes for Ubuntu/Debian setup.
Verify before relying
- Whether the package works reliably with modern Python versions (classifiers list only up to 3.5, released 2015).
- Current compatibility with recent versions of protobuf, PyNaCl, and cryptography dependencies.
- Whether dormant status indicates the package is still maintained or has been superseded.
Package facts
| License | LGPL3 (copyleft) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 11 — PyNaCl, protobuf, pyRFC3339, pymacaroons, requests, six, cryptography, ndg-httpsclient, pyOpenSSL, pyasn1, ipaddress |
| Maintenance | dormant — 975 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 830,025/month — #4,950 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: macaroonbakery-1.3.4-py2.py3-none-any.whl
Keywords: macaroon, cookie
Tags
More Cryptography packages
Certifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
PyNaClPyNaCl provides Python bindings to libsodium…
permissive · top 1,000 on PyPI
pymacaroonsPyMacaroons implements macaroons—bearer…
permissive · top 5,000 on PyPI
cookiesParses and renders HTTP Cookie and Set-Cookie…
permissive · top 15,000 on PyPI
django-cookie-consentA Django application that manages cookie…
permissive · top 15,000 on PyPI
browser-cookie3Extracts cookies from your browser's local…
copyleft · top 5,000 on PyPI
pycookiecheatExtracts and decrypts cookies from Chrome,…
permissive · top 15,000 on PyPI
quart-authQuart-Auth provides session-based…
permissive · top 15,000 on PyPI
streamlit-cookies-controllerProvides read, write, and delete operations on…
permissive · top 15,000 on PyPI
wafer-pyAn anti-detection HTTP client that handles TLS…
permissive · top 15,000 on PyPI
fontbakeryFont Bakery is a command-line tool that checks…
unclear · top 15,000 on PyPI
fastapi-sessionsAdds session authentication to FastAPI…
permissive · top 15,000 on PyPI