Problem to solve
Type: Enhancement / Feature Request
Description:
It would be useful if redactable supported a mode of configuration and execution that does not rely on importing external policy/config files.
Motivation:
- Easier quick-start usage (drop into an app or script with minimal setup).
- More developer-friendly for rapid prototyping and testing.
- Helps when external file I/O or imports are restricted (e.g., serverless environments, locked containers).
Proposal
- Allow passing policy definitions/config directly as Python dicts, JSON strings, or inline YAML strings.
- Provide a convenience function or method for “manual execution” (e.g., redactable.apply(text, policy=inline_policy_dict)).
- Ensure parity with existing file-based policy loading.
Alternatives considered
No response
Additional context
Example usage:
from redactable import apply
policy = {
"detectors": ["EMAIL", "PHONE"],
"transforms": {"EMAIL": "[REDACTED:EMAIL]"}
}
text = "email aidan@example.com"
print(apply(text, policy=policy))
Problem to solve
Type: Enhancement / Feature Request
Description:
It would be useful if redactable supported a mode of configuration and execution that does not rely on importing external policy/config files.
Motivation:
Proposal
Alternatives considered
No response
Additional context
Example usage: