All notable changes to dpdpstack-python-sdk. The core stays dependency-free; optional
features live behind extras ([django], [sqlalchemy], [crypto]).
- Sealing key rotation:
seal/unseal(andAuditLog.record(seal_key=…)/open_sealed) accept a list of keys (newest first) via MultiFernet — new payloads seal with the first key, unsealing tries all, so older-key payloads still open.
- Evidence client (
EvidenceClient): push the tamper-evident chain to a hosted vault. Zero-dependency (stdlib), evidence-only (never PII), idempotent, with a fire-and-forgetpush_backgroundthat never blocks or raises.
- Retention-safe checkpoints:
AuditLog.checkpoint()/prune_through()andverify_report()(pinpoints where a chain breaks) let a hash-chained log be pruned and still verify by anchoring to an immutable, self-chainingCheckpoint. - Offline verification:
dpdpstack verify-chain audit.jsonl [--checkpoints cp.jsonl]. - Crypto-shred (
[crypto]):dpdpstack.sealing— encrypt PII into a token the entry hash covers, so destroying the key satisfies right-to-erasure while the chain verifies. - SQLAlchemy adapter (
[sqlalchemy]):contrib.sqlalchemymirrors the Django adapter for FastAPI/Flask/any SQLAlchemy app; the@piideclaration is shared.
- DPDP linter + readiness score:
dpdpstack.rules—lint_policyflags retention compliance smells (each tied to a DPDP citation);score_policiesgrades a policy set (0–100, letter grade, tier). CLI:dpdpstack lint [--score]. - Value-level PII detection:
detect_values(Aadhaar via Verhoeff, cards via Luhn, PAN/GST/IFSC/UPI/email/phone/IP) andclassify_breach_naturefor a breach report. - New presets:
companies_act(),third_schedule().
- PII auto-discovery (
scan): suggest@pii(...)declarations from Django model schema (dpdp_scan) or any field names —dpdpstack scan,suggest_strategies,scan_mapping. Schema-only, India-first catalog, advisory.
- Core: legal-hold-aware
ErasureEngine,RetentionPolicy+ RBI/PMLA/CERT-In presets, anonymization strategies (null/hashed/redact/constant), hash-chainedAuditLog(in-memory / JSONL / Django stores),issue_certificate(Certificate of Erasure), optional RS256 signing ([crypto]), Django adapter, and thedpdpstackCLI.