Metadata-Version: 2.4
Name: firm-audit
Version: 0.1.0
Summary: Database-backed append-only audit log. No Redis required — runs on SQLite, PostgreSQL, or MySQL.
Keywords: audit,log,sqlite,postgresql,mysql
Author: firm contributors
License-Expression: MIT
License-File: LICENSE
License-File: NOTICE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Database
Classifier: Typing :: Typed
Requires-Dist: firm-core~=0.1.0
Requires-Dist: click>=8.1
Requires-Dist: firm-core[mysql] ; extra == 'mysql'
Requires-Dist: firm-core[postgres] ; extra == 'postgres'
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/h11t-labs/firm
Project-URL: Repository, https://github.com/h11t-labs/firm
Project-URL: Issues, https://github.com/h11t-labs/firm/issues
Provides-Extra: mysql
Provides-Extra: postgres
Description-Content-Type: text/markdown

# firm-audit

Database-backed, append-only audit log for Python. No Redis required: events are recorded in
your existing **SQLite**, **PostgreSQL**, or **MySQL/MariaDB** database.

Part of [firm](https://github.com/h11t-labs/firm), a port of the Rails 8 Solid stack — the
audit module is original to firm (it has no Rails counterpart).

```bash
pip install firm-audit
```

## Quickstart

```python
from firm.audit import AuditLog

audit = AuditLog(database_url="postgresql://localhost/myapp")

audit.record("user.login", subject=("User", 42), actor=("User", 42), data={"ip": "10.0.0.1"})

for event in audit.history(subject=("User", 42)):
    print(event["action"], event["created_at"])
```

## Highlights

- **Append-only** — no update or delete API on recorded events
- **Structured querying** with `history()` — filter by action, subject, actor, time range
- **Opt-in retention** — nothing is trimmed unless you ask for it

## Docs

- [Audit overview](https://github.com/h11t-labs/firm/blob/main/docs/audit/overview.md)
- [All firm documentation](https://github.com/h11t-labs/firm#readme)

MIT licensed; see [NOTICE](https://github.com/h11t-labs/firm/blob/main/NOTICE) for third-party
notices.
