--- id: beaker version: "1.14.1" license: BSD license_treatment: permissive maintenance: active --- # Beaker — A Session and Caching library with WSGI Middleware License: permissive · Maintenance: active · Downloads: 269.6K/mo ## What it is and what it does Beaker is a session and caching library designed for WSGI web applications. It abstracts storage across multiple backends—memory, file, database (via SQLAlchemy), memcached, Redis, and MongoDB—allowing you to choose the right persistence layer for your use case without changing application code. It includes WSGI middleware for transparent session and cache integration, signed cookies to prevent session hijacking, and cookie-only sessions for clustered deployments that don't require a backend store. The library handles cache namespacing, key expiration, automatic cache regeneration via callbacks, and fine-grained backend toggling per cache object. It has been in production use since 2006 and is integrated into frameworks like Pylons and TurboGears. With zero runtime dependencies and support for Python 3.8–3.13, it is straightforward to install and integrate into existing WSGI applications. Use it for: - Store user sessions in memcached or Redis for horizontally scaled web services. - Cache expensive database queries or API responses with automatic expiration. - Use signed cookies for stateless session management in clustered environments. - Implement multi-tier caching (memory + persistent backend) with namespace isolation. - Integrate session middleware into a Pylons or TurboGears application with minimal configuration. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Beaker provides session management and caching for WSGI web applications, supporting multiple storage backends including memory, file, database, memcached, Redis, and MongoDB. Yes, with a security caveat. Beaker is production-stable, actively maintained, has zero install friction, and offers a mature, flexible caching and session abstraction for WSGI applications. However, verify whether PYSEC-2020-216 affects version 1.14.1 before deploying to production; if unpatched, assess the risk in your threat model. ## Install pip install beaker uv add beaker poetry add beaker ## Installing Beaker Before you install: Low install friction with no runtime dependencies. Actively maintained as of 76 days ago with production-stable status across Python 3.8–3.13. License in practice: BSD permissive license allows use in most projects without significant restrictions. Quickstart: pip install beaker from beaker.cache import CacheManager from beaker.session import SessionObject cache_opts = {'cache.type': 'memory'} cache = CacheManager(**cache_opts) Requires Python 3.8 or later; optional backends (Redis, memcached, MongoDB) require their respective client libraries. Verify before relying: - Whether PYSEC-2020-216 affects current version 1.14.1 or has been patched. - Performance characteristics and scalability limits for high-concurrency scenarios. - Current maintenance activity level beyond release date (last commit, recent PRs). ## Package facts - License: BSD (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 269.6K/month (top 15,000 on PyPI) - Known vulnerabilities: 1 ## Tags wsgi session middleware, web application caching, distributed session storage, memcached redis caching, cookie-based sessions, cache backend abstraction, web framework session management, session-management, caching-library, wsgi-middleware [View on SkillFed](https://skillfed.io/packages/beaker) · [View on PyPI](https://pypi.org/project/beaker/)