SQLAlchemy-Continuum
Versioning and auditing extension for SQLAlchemy.
Features
Creates versions for inserts, deletes and updates
Does not store updates which don’t change anything
Supports alembic migrations
Can revert objects data as well as all object relations at given transaction even if the object was deleted
Transactions can be queried afterwards using SQLAlchemy query syntax
Query for changed records at given transaction
Temporal relationship reflection. Version object’s relationship show the parent objects relationships as they where in that point in time.
Supports native versioning for PostgreSQL database (trigger based versioning)
QuickStart
pip install SQLAlchemy-Continuum
In order to make your models versioned you need two things:
Call make_versioned() before your models are defined.
Add __versioned__ to all models you wish to add versioning to
import sqlalchemy as sa
from sqlalchemy_continuum import make_versioned
make_versioned(user_cls=None)
class Article(Base):
__versioned__ = {}
__tablename__ = 'article'
id = sa.Column(sa.Integer, primary_key=True, autoincrement=True)
name = sa.Column(sa.Unicode(255))
content = sa.Column(sa.UnicodeText)
article = Article(name='Some article', content='Some content')
session.add(article)
session.commit()
# article has now one version stored in database
article.versions[0].name
# 'Some article'
article.name = 'Updated name'
session.commit()
article.versions[1].name
# 'Updated name'
# lets revert back to first version
article.versions[0].revert()
article.name
# 'Some article'
For completeness, below is a working example.
from sqlalchemy_continuum import make_versioned
from sqlalchemy import Column, Integer, Unicode, UnicodeText, create_engine
from sqlalchemy.orm import Session, configure_mappers, declarative_base
make_versioned(user_cls=None)
Base = declarative_base()
class Article(Base):
__versioned__ = {}
__tablename__ = 'article'
id = Column(Integer, primary_key=True, autoincrement=True)
name = Column(Unicode(255))
content = Column(UnicodeText)
configure_mappers()
engine = create_engine('sqlite://')
Base.metadata.create_all(engine)
session = Session(engine)
article = Article(name='Some article', content='Some content')
session.add(article)
session.commit()
article.versions[0].name
article.name = 'Updated name'
session.commit()
article.versions[1].name
article.versions[0].revert()
article.name
Resources
More information
Metadata
Release files for SQLAlchemy-Continuum 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sqlalchemy_continuum-2.0.0.tar.gz | 98.3 kB | With provenance | Details for sqlalchemy_continuum-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sqlalchemy_continuum-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for sqlalchemy_continuum-2.0.0-py3-none-any.whl |
Total release size: 152.6 kB
Release files / sqlalchemy_continuum-2.0.0.tar.gz
| Download URL | sqlalchemy_continuum-2.0.0.tar.gz |
|---|---|
| Size | 98.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f725be86ea008965232377275ed1790b09e9aad7ae272f58620d2cba2db2b85b
|
|
BLAKE2b-256 checksum How to use checksums |
96fb1a70851799160d9de73277bdeeb738e3ebac05cae48d6e48875c53a7cb37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency logRelease files / sqlalchemy_continuum-2.0.0-py3-none-any.whl
| Download URL | sqlalchemy_continuum-2.0.0-py3-none-any.whl |
|---|---|
| Size | 54.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0db1f78ba4c8ebdcbdfed491fee0c3953e3c4061ff8f9828915d503a0d22f039
|
|
BLAKE2b-256 checksum How to use checksums |
b73925fa5dac50a544087559ec7c42136fe8d66cd1c27a1738c7465a14fd8268
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency logSecurity for SQLAlchemy-Continuum 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for sqlalchemy_continuum-2.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.