PyPaC is an experimental Python library for privacy compliance in code. The goal is to explore what it looks like to embed privacy compliance needs, such as purpose limitation, retention, consent, masking, and access controls, directly into code, without relying on an external platform.
Data can be defined with rules and access is checked against roles, declared purpose, consent status, or the service making the request. Logs are created when there is access and this engine supports features, such as data expiration, redaction, and DSAR request logging.
PyPaC_engine.pyis the engine and definesPrivacyFieldandPrivacyModelto assign privacy rules to each field and to enforce those rules.Example.pyis a fake CRM customer script that includes access examples by actors, such as Support, Analytics, and Sales. It includes test scenarios to demo enforcement, consent, expired data, and logging.- Access and DSAR logs are structured for JSON export and audit needs.
- The output could be easily updated into other apps, APIs, or reports.
PyPaC is a draft and work in progress personal experiment. It is not ready for real PII, data, or systems.
MIT license
Carl Ditzler