--- id: zope-sqlalchemy version: "4.1" license: ZPL-2.1 license_treatment: unclear maintenance: aging --- # zope.sqlalchemy — Minimal Zope/SQLAlchemy transaction integration License: unclear · Maintenance: aging · Downloads: 344.5K/mo ## What it is and what it does zope.sqlalchemy is a lightweight bridge between SQLAlchemy's session management and Zope's transaction system. It registers SQLAlchemy sessions as participants in Zope's distributed transaction protocol, so that session commits and rollbacks are coordinated with the broader transaction context—useful in Zope-based applications, Pyramid web frameworks using pyramid_tm, and WSGI applications using repoze.tm2. The package does not attempt to define a Zope-specific way to configure engines; it only provides a data manager that hooks into SQLAlchemy's event system via a register() function. The integration handles both simple commits and two-phase commits. Sessions default to an 'active' state on first use and move to 'changed' when ORM writes occur, avoiding unnecessary database commits. For raw SQL operations, you can manually mark the session as changed or configure it to start in 'changed' state. The package supports scoped sessions (required for threaded web servers) and allows fine-grained control over session lifecycle and transaction boundaries. Use it for: - Integrate SQLAlchemy ORM into a Zope application where transactions must be coordinated across multiple resources - Use Pyramid with pyramid_tm to manage SQLAlchemy session commits alongside other transactional operations - Implement two-phase commit for SQLAlchemy sessions in distributed transaction scenarios - Manage long-lived or scoped sessions in WSGI applications using repoze.tm2 for automatic transaction handling - Coordinate raw SQL operations with Zope transactions by explicitly marking sessions as changed ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Integrates SQLAlchemy sessions with Zope's transaction manager, allowing database operations to participate in Zope's distributed transaction protocol. Yes, if you are building or maintaining a Zope or Pyramid application that requires SQLAlchemy and distributed transaction support. The package is stable and has no known vulnerabilities, but maintenance is aging (262 days since last release). Install only if you understand both SQLAlchemy and Zope transactions; it is not a general-purpose ORM integration and adds no abstraction layer. Verify ZPL-2.1 license compatibility with your project first. ## Install pip install zope-sqlalchemy uv add zope-sqlalchemy poetry add zope-sqlalchemy ## Installing zope.sqlalchemy Before you install: Low install friction with a pure-Python wheel. Maintenance is aging—last release was 262 days ago—but the repository remains active and the package is marked Production/Stable. Suitable for established Zope or Pyramid projects where transaction integration is already a known requirement. License in practice: Licensed under ZPL-2.1 (Zope Public License), which is OSI-approved but less common than MIT or Apache 2.0. Verify compatibility with your project's license policy before adopting. Quickstart: from zope.sqlalchemy import register from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker, scoped_session import transaction engine = create_engine("postgresql://user:pass@localhost/db") DBSession = scoped_session(sessionmaker(bind=engine)) register(DBSession) session = DBSession() session.add(obj) transaction.commit() Requires Python 3.10 or later. Assumes familiarity with both SQLAlchemy and Zope's transaction manager; integration is minimal and does not abstract away either system's complexity. Verify before relying: - Whether the aging maintenance status (262 days since last release) affects stability for current SQLAlchemy versions - Compatibility with SQLAlchemy 2.0+ ORM patterns beyond the examples shown in the description ## Package facts - License: ZPL-2.1 (unclear) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 344.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sqlalchemy zope transaction integration, zope transaction manager sqlalchemy, sqlalchemy session zope transactions, distributed transactions sqlalchemy, zope.sqlalchemy data manager, pyramid sqlalchemy transactions, two-phase commit sqlalchemy, transaction-management, zope-framework, web-framework-integration [View on SkillFed](https://skillfed.io/packages/zope-sqlalchemy) · [View on PyPI](https://pypi.org/project/zope-sqlalchemy/)