Skip to main content
Migrating from the established datafog package? Start with Migrate from DataFog Python before translating API calls.

Synchronous functions

transform uses explicit findings. scan_and_transform accepts the divided configuration envelope with scan and transform sections.

Result objects

Python exposes immutable objects with snake_case attributes:
  • TextRange(start, end)
  • Finding
  • Transformation
  • TransformResult
  • Restoration
  • RestoreResult

Asynchronous manager

The manager exposes awaitable methods:
The key provider must implement:
The token provider must implement:

Exceptions

  • DataFogConfigurationError
  • DataFogFindingError
  • DataFogKeyProviderError
  • DataFogInternalError
Exceptions expose stable code, optional reason, optional path, and optional finding_index attributes. See Errors.

Structured JSON and PERSON fields

Use discover_fields(data, config=None), scan_structured(data, config=None), transform_structured(data, findings, config), and scan_and_transform_structured(data, config). Results expose .mappings and .findings, or .data and .transformations. PrivacyManager also exposes transform_structured, scan_and_transform_structured, and restore_structured for provider-backed work. Paths are JSON Pointers. All ranges, including JavaScript UTF-16 ranges, address the decoded string at that path. See person-field discovery for aliases, policy configuration, input limits, and examples.