Skip to main content

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_flush snapshots diffs, after_flush_postexec resolves DB-assigned primary keys) so integer-PK entities record the real id, not the empty string.
  • AuditEntry SQLModel table with indexed entity_type, entity_id, user_id, created_at columns.
  • GET /api/audit_log/ REST endpoint with entity_type, entity_id, action, user_id, from_date, to_date, paging filters.
  • /audit_log Inertia browse page with the same filter set rendered as a table, gated by the audit_log.view permission.
  • Opt-outs: set __audit_exclude__ = True on a model to skip it entirely, or __audit_exclude_fields__ = {"password_hash"} to skip specific columns. AuditMixin / SoftDeleteMixin bookkeeping 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.37

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simple-module-audit-log 0.0.37
File Size Uploaded Provenance
simple_module_audit_log-0.0.37.tar.gz 50.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for simple-module-audit-log 0.0.37
File Interpreter ABI Platform
simple_module_audit_log-0.0.37-py3-none-any.whl Python 3 none any Details

Total release size: 92.6 kB

Release files / simple_module_audit_log-0.0.37.tar.gz

Download URL simple_module_audit_log-0.0.37.tar.gz
Size 50.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e68e897fcbb03439219eafe19cbc2e7c3db3cad23d77f079fad0dacfd2e1896d
BLAKE2b-256 checksum
How to use checksums
2350b50d764bdea0a7cd971d1da9297484cb35ffea6c2c3705f295c68a8bb5da
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 19, 2026.

Transparency log

Release files / simple_module_audit_log-0.0.37-py3-none-any.whl

Download URL simple_module_audit_log-0.0.37-py3-none-any.whl
Size 42.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c4f8fd0fe966f66226587363fb9c81f60aaa3eb97b378bdbd31eeecd779b9648
BLAKE2b-256 checksum
How to use checksums
0293b5e93274329055520183addb214116dc969942650605e4685e1d00da74a5
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 19, 2026.

Transparency log

Security for simple-module-audit-log 0.0.37

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.

Select from 2 files

Attestation for simple_module_audit_log-0.0.37.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 19, 2026.

Transparency log

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

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page