Skip to content

Add an optional table-only k-anonymity path - #79

Merged
leo-gan merged 2 commits into
leo-gan:mainfrom
LeoGan:table-privacy-engine
Sep 22, 2026
Merged

leo-gan merged 2 commits into
leo-gan:mainfrom
LeoGan:table-privacy-engine

Conversation

@leo-gan

@leo-gan leo-gan commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add --k for CSV and Excel. Direct identifiers keep the existing operators. Quasi-identifier columns are generalized or suppressed until each combination appears at least k times.
  • Write data/stats/<stem>.table_privacy.json with prosecutor risk, and ℓ-diversity and t-closeness when --sensitive-column is set. The report is an aid, not a certificate.
  • Refuse --k on a PDF, Word file, or Markdown file, and leave that file unchanged. The default cell-level replace is unchanged.
  • Bump the anonymizer packages from 0.30.0 to 0.31.0. id-extract stays 0.3.0.

Test plan

  • uv run ruff check .
  • uv run pytest (344 passed)
  • Default CSV run does not write a table-privacy report
  • --k 2 coarsens a unique zip/gender row and masks emails
  • --k on Markdown exits without rewriting the file

CSV and Excel can generalize or suppress quasi-identifier columns until each combination appears at least k times, and write a prosecutor-risk report. PDFs are unchanged. The default cell replace is unchanged. The anonymizer packages move from 0.30.0 to 0.31.0.
Record PR 79 on the optional table-only privacy engine.
@leo-gan
leo-gan merged commit ba653c2 into leo-gan:main Sep 22, 2026
2 checks passed
@leo-gan
leo-gan deleted the table-privacy-engine branch September 22, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant