Skip to content

feat: tqdm progress bar for the anonymization phase#26

Merged
armand0e merged 2 commits into
TeichAI:mainfrom
CompactAIOfficial:feat/anonymize-progress-bar
Jul 10, 2026
Merged

feat: tqdm progress bar for the anonymization phase#26
armand0e merged 2 commits into
TeichAI:mainfrom
CompactAIOfficial:feat/anonymize-progress-bar

Conversation

@CompactAIOfficial

Copy link
Copy Markdown
Contributor

The anonymization phase of teich extract (and teich anonymize) runs silently — on a large session store there's no indication of progress until it finishes.

  • anonymize_path gains an optional progress callback, called after each file with (file_report, files_done, files_total) — no UI coupling in the library
  • the CLI wraps both commands with a tqdm bar: dynamic_ncols=True so it resizes with the terminal window, unit="file", and a live postfix showing running counts of scrubbed API keys / emails / usernames plus the current file name
  • the bar clears itself on completion (leave=False), so the existing rich summary lines stay the final output
  • tqdm was already installed transitively via huggingface_hub; it's now an explicit dependency (tqdm>=4.66), with uv.lock updated

Example while running:

Anonymizing:  63%|██████▎   | 120/190 [00:02<00:01, 55.3file/s, keys=14, emails=9, users=31, file=session-0120.jsonl]

Testing

  • pytest tests/test_extract_anonymize_cli.py tests/test_cli.py — 56 passed
  • manual run over a seeded directory: bar renders, totals match the report

🤖 Generated with Claude Code

anonymize_path accepts an optional per-file progress callback; the CLI
wires it to a tqdm bar (dynamic_ncols, so it resizes with the terminal)
for both teich extract and teich anonymize, showing files processed and
running counts of scrubbed keys, emails, and usernames plus the current
file name. tqdm was already a transitive dependency via
huggingface_hub; it is now declared explicitly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@armand0e armand0e self-assigned this Jul 10, 2026
@armand0e
armand0e merged commit dbd804c into TeichAI:main Jul 10, 2026
3 checks passed
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.

2 participants