simple_module_audit_log
Automatic field-level audit trail for all SQLModel entities in simple_module apps. Every create / update / delete / soft-delete is captured in the audit_log_audit_entry table with the changed fields, the user who made the change, and the request correlation id — no instrumentation required in module code.
Install
pip install simple_module_audit_log
Add simple_module_audit_log to your host's dependencies and the entry point will be discovered automatically.
What it provides
- Two-phase capture (
before_flushsnapshots diffs,after_flush_postexecresolves DB-assigned primary keys) so integer-PK entities record the real id, not the empty string. AuditEntrySQLModel table with indexedentity_type,entity_id,user_id,created_atcolumns.GET /api/audit_log/REST endpoint withentity_type,entity_id,action,user_id,from_date,to_date, paging filters./audit_logInertia browse page with the same filter set rendered as a table, gated by theaudit_log.viewpermission.- Opt-outs: set
__audit_exclude__ = Trueon a model to skip it entirely, or__audit_exclude_fields__ = {"password_hash"}to skip specific columns.AuditMixin/SoftDeleteMixinbookkeeping fields are excluded automatically.
Usage
Install the module and grant the audit_log.view permission to your admin role. Audit entries appear automatically for every entity that does not opt out.
To exclude a sensitive column:
from typing import ClassVar
from sqlmodel import Field
from simple_module_db.base import create_module_base
from simple_module_db.mixins import AuditMixin
Base = create_module_base("auth")
class Credential(Base, AuditMixin, table=True):
__audit_exclude_fields__: ClassVar[set[str]] = {"password_hash"}
id: int | None = Field(default=None, primary_key=True)
user_id: str
password_hash: str
To opt a whole table out:
class Cache(Base, table=True):
__audit_exclude__ = True
...
License
MIT
Metadata
Release files for simple-module-audit-log 0.0.34
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 | |
|---|---|---|---|---|
| simple_module_audit_log-0.0.34.tar.gz | 47.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| simple_module_audit_log-0.0.34-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 88.3 kB
Release files / simple_module_audit_log-0.0.34.tar.gz
| Download URL | simple_module_audit_log-0.0.34.tar.gz |
|---|---|
| Size | 47.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6fb99b58e07c416fc2865fcfcb3ca834596556f3078b5f523664fef2d320dd7
|
|
BLAKE2b-256 checksum How to use checksums |
fb29a0928f7bd9e7aadebdb0053b5716fc8f3b0c4a0d21d39ba3af005038cf18
|
| 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 Sep 8, 2026.
Transparency logRelease files / simple_module_audit_log-0.0.34-py3-none-any.whl
| Download URL | simple_module_audit_log-0.0.34-py3-none-any.whl |
|---|---|
| Size | 41.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
abe20c57beb8a44001d3ae12373f1ae9f406cb06d9dff8443332996ddb199578
|
|
BLAKE2b-256 checksum How to use checksums |
bf7839a61f2a79ac07ba488c779d7c83b384df337ee2765b5070a5cddab6b4a8
|
| 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 Sep 8, 2026.
Transparency logSecurity for simple-module-audit-log 0.0.34
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 simple_module_audit_log-0.0.34.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 Sep 8, 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.