skillfed

transaction

Transaction management for Python

transaction v5.1 852.2K downloads/30d#4,900 on PyPI74
License unclear ZPL-2.1 Active released

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 transaction

uv

uv add transaction

poetry

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 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

Development Status :: 6 - MatureFramework :: ZODBOperating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: DatabaseTopic :: Software Development :: Libraries :: Python Modules

Tags

transaction management pythoncommit abort lifecycleZODB transactionsdata manager coordinationtransaction hookspython transaction controlatomic operations python
transaction-controldata-managerzodb

More Python Modules packages