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

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.36
File Size Uploaded Provenance
simple_module_audit_log-0.0.36.tar.gz 50.1 kB With provenance Details

Built distribution (wheel)

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

Total release size: 92.6 kB

Release files / simple_module_audit_log-0.0.36.tar.gz

Download URL simple_module_audit_log-0.0.36.tar.gz
Size 50.1 kB
Tags Source
SHA-256 checksum
How to use checksums
832e7fc04c540044fdc29a82c93ae574e47a7006b50a6dec35af2657fb7103b8
BLAKE2b-256 checksum
How to use checksums
a758086ce497e85128ed5733370f2f7a443c53e781c589c725534d2024bfcc96
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 13, 2026.

Transparency log

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

Download URL simple_module_audit_log-0.0.36-py3-none-any.whl
Size 42.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abcea170823f8f364c577ebb95137c4c58428f06ca44d6a3d5011e17c726d9e5
BLAKE2b-256 checksum
How to use checksums
6d8200ce56d49a182691b67c3913180b8201ed60d5a52561493c1b49cd121828
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 13, 2026.

Transparency log

Security for simple-module-audit-log 0.0.36

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.36.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 13, 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