How guillaumelog/teams-exporter works
Teams Exporter is a local-first CLI for exporting direct and group chats into a browsable HTML archive, interactively soft-deleting selected sent messages and eligible OneDrive files, and experimentally cleaning activity notifications. The main workflow runs from CLI configuration and command dispatch through Graph authentication and retrieval, then local archive generation and rendering. Purge and notifications are separate command branches. The graph follows the excerpts and README; unsampled details are represented only where documented, and optional notification deletion is kept distinct.
Main entry points: cli.py Command dispatch · graph.py Graph client · export.py Chat export · render.py HTML rendering
Components 16
CLI and configuration
- Command dispatch
src/teams_exporter/cli.py - Configuration
src/teams_exporter/config.py
Shared services
- Logging setup
src/teams_exporter/logging_setup.py - Graph authentication
src/teams_exporter/auth.py - Graph client
src/teams_exporter/graph.py
Conversation export
- Chat export
src/teams_exporter/export.py - Local conversation data
- HTML rendering
src/teams_exporter/render.py - Archive templates and UI
src/teams_exporter/templates
Remote cleanup
- Interactive purge
src/teams_exporter/purge.py - Notification cleanup
src/teams_exporter/notifications.py
Other components
- CLI user
- Microsoft Graph
- Local browser
- OneDrive
- Internal Teams endpoints
Connections 20
- CLI user → Command dispatch: runs command
README.md - Command dispatch → Configuration: loads settings
src/teams_exporter/cli.py - Command dispatch → Logging setup: configures logging
src/teams_exporter/cli.py - Command dispatch → Chat export: dispatches export
src/teams_exporter/cli.py - Command dispatch → Interactive purge: dispatches purge
src/teams_exporter/cli.py - Command dispatch → Notification cleanup: dispatches cleanup
src/teams_exporter/cli.py - Command dispatch → Graph authentication: builds Graph auth
src/teams_exporter/cli.py - Command dispatch → Graph client: builds Graph client
src/teams_exporter/cli.py - Graph authentication → Microsoft Graph: authenticates
src/teams_exporter/auth.py - Graph client → Graph authentication: gets tokens
src/teams_exporter/graph.py - Graph client → Microsoft Graph: requests data
src/teams_exporter/graph.py - Chat export → Graph client: retrieves chats
src/teams_exporter/export.py - Chat export → Local conversation data: writes and reuses
src/teams_exporter/export.py - Chat export → HTML rendering: renders archive
src/teams_exporter/export.py - HTML rendering → Archive templates and UI: renders pages
src/teams_exporter/render.py - HTML rendering → Local conversation data: writes HTML
src/teams_exporter/render.py - Local browser → Local conversation data: browses archive
README.md - Interactive purge → Graph client: scans and deletes
src/teams_exporter/purge.py - Interactive purge → OneDrive: deletes eligible files
README.md - Notification cleanup → Internal Teams endpoints: marks read; tries delete
src/teams_exporter/notifications.py