Skip to content

feat(anonymizer): add batch deanonymization support#2115

Open
rodboev wants to merge 5 commits into
data-privacy-stack:mainfrom
rodboev:pr/batch-deanonymization
Open

feat(anonymizer): add batch deanonymization support#2115
rodboev wants to merge 5 commits into
data-privacy-stack:mainfrom
rodboev:pr/batch-deanonymization

Conversation

@rodboev

@rodboev rodboev commented Jun 28, 2026

Copy link
Copy Markdown

Change Description

Adds a public BatchDeanonymizeEngine to presidio-anonymizer, so encrypted values produced through the batch analyzer and anonymizer flow can be decrypted with the same list and dictionary ergonomics as BatchAnonymizerEngine.

The new batch engine delegates string values to the existing DeanonymizeEngine.deanonymize(...), supports list and nested dictionary traversal, and leaves unsupported scalar or object values unchanged. The change is additive and keeps the existing single-text deanonymization API unchanged.

The README now includes a batch deanonymization example, and the changelog records the new Anonymizer feature under Unreleased.

Issue reference

Fixes #1617

Tests

  • poetry run pytest tests/test_batch_deanonymize_engine.py tests/integration/test_deanonymize_engine.py tests/test_batch_anonymizer_engine.py tests/test_readme.py
  • poetry run ruff check presidio_anonymizer/batch_deanonymize_engine.py presidio_anonymizer/__init__.py tests/test_batch_deanonymize_engine.py tests/test_readme.py

Note on CHANGELOG

Update CHANGELOG.md under [unreleased]AnonymizerAdded.

Checklist

  • I have reviewed the contribution guidelines
  • I have signed the CLA (if required)
  • My code includes unit tests
  • All unit tests and lint checks pass locally
  • My PR contains documentation updates / additions if required

Copilot AI review requested due to automatic review settings June 28, 2026 03:13
@rodboev

rodboev commented Jun 28, 2026

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new public BatchDeanonymizeEngine to presidio-anonymizer to support batch deanonymization over lists and nested dictionaries, mirroring the ergonomics of BatchAnonymizerEngine, with documentation and tests.

Changes:

  • Introduces BatchDeanonymizeEngine and exports it from presidio_anonymizer.
  • Adds unit tests and extends the README tests to cover the new batch deanonymization example.
  • Updates presidio-anonymizer/README.md and root CHANGELOG.md to document the new capability.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
presidio-anonymizer/presidio_anonymizer/batch_deanonymize_engine.py New batch deanonymization implementation for lists and nested dicts.
presidio-anonymizer/presidio_anonymizer/init.py Exposes BatchDeanonymizeEngine from the package root.
presidio-anonymizer/tests/test_batch_deanonymize_engine.py Adds unit coverage for list/dict/nested behaviors and engine injection.
presidio-anonymizer/tests/test_readme.py Extends README snippet tests to include batch deanonymization example.
presidio-anonymizer/README.md Documents batch deanonymization usage example.
CHANGELOG.md Notes the new batch deanonymization feature under Unreleased.

Comment thread presidio-anonymizer/presidio_anonymizer/batch_deanonymize_engine.py
Comment thread presidio-anonymizer/presidio_anonymizer/batch_deanonymize_engine.py
Comment thread presidio-anonymizer/presidio_anonymizer/batch_deanonymize_engine.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Batch Decryption

2 participants