--- id: transaction version: "5.1" license: ZPL-2.1 license_treatment: unclear maintenance: active --- # transaction — Transaction management for Python License: unclear · Maintenance: active · Downloads: 852.2K/mo ## What it is and what it does Transaction is a generic transaction implementation for Python that manages the lifecycle of transactions—commit, abort, and rollback—along with coordination of multiple data managers. It is primarily used by ZODB (Zope Object Database) but can be used standalone for any application needing explicit transaction control. The package provides transaction managers, hooks for before-commit and abort operations, synchronizers for coordinating external resources, and APIs for storing transaction-scoped data. The package is mature (first release in 2007) and actively maintained. It has a single runtime dependency on zope.interface and installs with low friction. It supports modern Python versions (3.10 through 3.14) and runs on both CPython and PyPy. The API includes explicit transaction modes, retry logic for transient errors, and mechanisms to avoid cyclic references and memory leaks. Use it for: - Build a standalone application with explicit transaction control and multi-step commit/abort semantics without using ZODB. - Coordinate multiple data managers (databases, caches, message queues) within a single atomic transaction. - Implement before-commit hooks to validate or transform data before persistence, and abort hooks for cleanup. - Manage thread-local transaction state in multi-threaded applications using ThreadTransactionManager. - Retry transient errors automatically using the transaction manager's run method with configurable retry logic. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a generic transaction management system for Python, handling commit/abort cycles, data manager coordination, and transaction hooks. Yes, if you need explicit transaction management in Python. It is stable, actively maintained, has no known vulnerabilities, and installs cleanly. However, verify that ZPL-2.1 licensing is compatible with your project, and confirm that this package (primarily designed for ZODB) is the right fit for your use case rather than a database-specific transaction API. ## Install pip install transaction uv add transaction poetry add transaction ## Installing transaction Before you install: Low friction install with a single dependency (zope.interface). Actively maintained; last release 150 days ago with support for current Python versions including 3.14. No known vulnerabilities. License in practice: Licensed under ZPL-2.1 (Zope Public License). License treatment is marked unclear in the metadata, so verify compatibility with your project's licensing requirements before use. Quickstart: pip install transaction import transaction tx = transaction.get() tx.commit() Requires Python 3.10 or later; earlier versions are no longer supported. Verify before relying: - Whether ZPL-2.1 is compatible with your project's license (marked unclear in metadata). - Whether the package's role as primarily a ZODB dependency means it's the right choice for standalone transaction management. ## Package facts - License: ZPL-2.1 (unclear) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 852.2K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags transaction management python, commit abort lifecycle, ZODB transactions, data manager coordination, transaction hooks, python transaction control, atomic operations python, transaction-control, data-manager, zodb [View on SkillFed](https://skillfed.io/packages/transaction) · [View on PyPI](https://pypi.org/project/transaction/)