Metadata-Version: 2.4
Name: stapel-gdpr
Version: 0.4.1
Summary: GDPR data export and account deletion Django app for the Stapel framework
License: MIT
Project-URL: Homepage, https://github.com/usestapel/stapel-gdpr
Project-URL: Repository, https://github.com/usestapel/stapel-gdpr
Project-URL: Documentation, https://github.com/usestapel/stapel-gdpr#readme
Project-URL: Changelog, https://github.com/usestapel/stapel-gdpr/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/usestapel/stapel-gdpr/issues
Keywords: django,stapel,gdpr,privacy,data-export,right-to-erasure
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: stapel-core<1.0,>=0.24.0
Requires-Dist: celery>=5.3
Provides-Extra: s3
Requires-Dist: boto3>=1.34; extra == "s3"
Provides-Extra: all
Requires-Dist: stapel-gdpr[s3]; extra == "all"
Dynamic: license-file

<!-- Generated by stapel-readme from docs/readme.md + docs/*.json. Do not edit this file; edit docs/readme.md and re-run `make readme`. -->

# stapel-gdpr

[![CI](https://img.shields.io/github/actions/workflow/status/usestapel/stapel-gdpr/ci.yml?branch=main&logo=github&label=CI)](https://github.com/usestapel/stapel-gdpr/actions/workflows/ci.yml?query=branch%3Amain)
[![coverage](https://img.shields.io/codecov/c/github/usestapel/stapel-gdpr?branch=main&logo=codecov&label=coverage)](https://app.codecov.io/gh/usestapel/stapel-gdpr)
[![pypi](https://img.shields.io/pypi/v/stapel-gdpr?logo=pypi&logoColor=white&label=pypi)](https://pypi.org/project/stapel-gdpr/)
[![downloads](https://static.pepy.tech/badge/stapel-gdpr/month)](https://pepy.tech/project/stapel-gdpr)
[![python](https://img.shields.io/pypi/pyversions/stapel-gdpr?logo=python&logoColor=white)](https://pypi.org/project/stapel-gdpr/)
[![license](https://img.shields.io/github/license/usestapel/stapel-gdpr)](https://github.com/usestapel/stapel-gdpr/blob/main/LICENSE)
[![llms.txt](https://img.shields.io/badge/llms.txt-blue)](https://github.com/usestapel/stapel-gdpr/blob/main/docs/llms.txt)

> GDPR compliance: staged async data export (Art. 15/20) with status polling and download, account deletion with a cancellable grace period (Art. 17), inactivity closure, retention cleanup, LegalHold (blocks closure/deletion) and ReRegistrationHash, orchestrated through an in-process GDPRProvider registry (stapel_core.gdpr.gdpr_registry) plus comm confirmation (gdpr.section.erased) for remote services.

Part of the [Stapel framework](https://github.com/usestapel) — composable Django apps that deploy as a monolith or as microservices without changing module code.

## Install

```bash
pip install stapel-gdpr
```

## At a glance

| Fact | Value |
|---|---|
| Version | `0.4.1` |
| Python | `>=3.11` (3.11, 3.12, 3.13, 3.14) |
| HTTP operations | 7 |
| Config axes | 1 |
| Usage surface | 14 |
| Extension points | 3 |
| Error codes | 51 |
| Fleet dependencies | [`stapel-core`](https://github.com/usestapel/stapel-core) |

## Documentation

[capabilities.json](https://github.com/usestapel/stapel-gdpr/blob/main/docs/capabilities.json) · [llms.txt (for agents)](https://github.com/usestapel/stapel-gdpr/blob/main/docs/llms.txt)

## Quick start

```python
# settings.py
INSTALLED_APPS = [
    ...
    'stapel_gdpr',
]

MIDDLEWARE = [
    ...
    # After authentication: refuses every request of an account being erased,
    # whatever a still-valid token claims.
    'stapel_gdpr.guards.AccountClosureGuardMiddleware',
]

STAPEL_GDPR = {
    # Every store holding personal data. Erasure is only ever reported
    # complete when each of these returned a deletion receipt, so an owner
    # missing here is a store that quietly keeps the data. `manage.py check`
    # fails while this is empty.
    'DATA_OWNERS': ['auth', 'profiles', {'name': 'cdn', 'kind': 'remote'}],
    'DATA_OWNERS_VERSION': '2026-08-13.1',
    # How the user's sessions are revoked at closure. Auto-detected when
    # stapel-auth is installed; without any seam, closure is refused rather
    # than performed with live tokens left behind.
    'SESSION_REVOKER': 'stapel_auth.sessions.services.SessionService.revoke_all',
}
```

Run `manage.py check` after wiring: a missing or stale data-owner inventory,
hash rows written outside `store_hashes`, and every open escape hatch are
reported there rather than discovered in an audit.

## Bus events

### Emits
| `user.deleted` | [schema](schemas/emits/user.deleted.json) | All user PII permanently deleted after grace period. Every package storing user  |
| `user.deletion_initiated` | [schema](schemas/emits/user.deletion_initiated.json) | Account closure started. 30-day grace period begins; account is deactivated. |
| `user.export_ready` | [schema](schemas/emits/user.export_ready.json) | Data export archive is ready for download. |
| `user.sessions_revoked` | [schema](schemas/emits/user.sessions_revoked.json) | Closure revoked every session and access JTI of the user. |

## License

MIT — see [LICENSE](https://github.com/usestapel/stapel-gdpr/blob/main/LICENSE).

---

<sub>This page is assembled by `stapel-readme` from `docs/readme.md` plus the contract artifacts in `docs/`. Edit the prose in `docs/readme.md`; the badges, facts and links above and below it are generated — do not hand-edit `README.md`.</sub>
