transaction
Transaction management for Python
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 on this page — 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
transaction on PyPI
pip
pip install transactionuv
uv add transactionpoetry
poetry add transactionInstalling 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 the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — zope.interface |
| Maintenance | actively maintained — 150 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 852,246/month — #4,900 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: transaction-5.1-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pyramid-tmIntegrates Pyramid web requests with the…
permissive · top 15,000 on PyPI
zope.sqlalchemyIntegrates SQLAlchemy sessions with Zope's…
unclear · top 15,000 on PyPI
ZODBZODB is an object-oriented database for Python…
unclear · top 15,000 on PyPI
persistentProvides transparent persistence for Python…
unclear · top 15,000 on PyPI
BTreesBTrees provides persistent, scalable B-tree…
unclear · top 15,000 on PyPI
bitcoin-utilsA low-level Bitcoin library providing tools to…
permissive · top 15,000 on PyPI
repoze-sendmailCouples email sending with Zope transactions,…
permissive · top 15,000 on PyPI
apswutilsProvides a Python interface for SQLite…
permissive · top 15,000 on PyPI
eth-accounteth-account signs Ethereum transactions and…
permissive · top 5,000 on PyPI
paytmchecksumGenerates and verifies checksums for Paytm…
permissive · top 15,000 on PyPI