--- id: pyramid-tm version: "2.6" license: BSD-derived (Repoze) license_treatment: permissive maintenance: active --- # pyramid-tm — A package which allows Pyramid requests to join the active transaction License: permissive · Maintenance: active · Downloads: 437.9K/mo ## What it is and what it does pyramid_tm is a Pyramid web framework extension that automatically binds each HTTP request to a transaction managed by the transaction package. When you include it in your Pyramid application, every request gets its own transaction context that commits on success or aborts on exception, eliminating manual transaction boilerplate in request handlers. The package runs as a Pyramid tween (middleware layer) positioned to wrap exception views, meaning the transaction remains active even when handling errors. It supports customization through hooks like commit_veto to override commit/abort decisions, and tm.annotate_user to track authenticated users in transaction logs. It integrates with pyramid_retry for automatic transaction retry on transient errors. Use it for: - Automatically commit database changes at the end of a successful HTTP request without explicit transaction calls in view code. - Abort database transactions when an exception occurs, rolling back partial changes and returning an error response. - Track which user performed a transaction by annotating the transaction log with authenticated user identity. - Implement custom commit/abort logic via commit_veto hooks to decide whether to persist changes based on response status or headers. - Coordinate multi-step database operations across a single request lifecycle with automatic rollback on failure. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Integrates Pyramid web requests with the transaction package to manage database transactions declaratively across request lifecycles. Yes. pyramid_tm is a mature, actively maintained package (last release November 2024) with no known vulnerabilities, low install friction, and a permissive license. It solves a common problem in Pyramid applications—declarative transaction management per request—cleanly and with minimal configuration. Install it if you are building a Pyramid web application that uses a database. ## Install pip install pyramid-tm uv add pyramid-tm poetry add pyramid-tm ## Installing pyramid-tm Before you install: Low friction install with only two runtime dependencies (pyramid and transaction). Actively maintained with recent releases supporting Python 3.9–3.13; last commit in 2026. License in practice: Licensed under a permissive BSD-derived (Repoze) license, allowing commercial and private use without restriction. Quickstart: pip install pyramid-tm from pyramid.config import Configurator config = Configurator() config.include('pyramid_tm') app = config.make_wsgi_app() Requires Python 3.9 or later; pyramid_tm must be included in the Configurator to activate transaction management for requests. Verify before relying: - Whether pyramid_retry is required or optional for retry behavior after version 2.0. - Performance impact of transaction annotation when tm.annotate_user is enabled. - Compatibility details with specific versions of pyramid and transaction beyond the stated support range. ## Package facts - License: BSD-derived (Repoze) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 437.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pyramid transaction management, wsgi request transaction handling, pyramid database transaction integration, automatic transaction commit abort, pyramid request lifecycle transactions, transaction manager pyramid tween, declarative transaction control, pyramid-integration, transaction-management, wsgi-middleware [View on SkillFed](https://skillfed.io/packages/pyramid-tm) · [View on PyPI](https://pypi.org/project/pyramid-tm/)