m365_graph.py — Microsoft Graph Integration Client
BCHPR · Microsoft 365 estate · 2023 – present
5,512-line Microsoft Graph API client covering OAuth authentication, Outlook email, Teams messaging, OneDrive / SharePoint file management, calendar events, and user delegation.
Highlights
- OAuth 2.0 client-credentials flow with automatic token refresh and disk cache.
- send_mail, post_teams_message, and calendar create_event / update_event / find_time_slots.
- OneDrive / SharePoint list / download / upload / move with path → drive-ID caching (lru_cache).
- Rate-limited (100 ms between calls) with specific exception types (TokenError, FileNotFoundError).
- Handles 1,000+ file operations per pipeline run; centralises M365 authentication across all projects.
Related projects
Architect
my_functions.py — Centralised Python Library
The 21,086-line shared Python library that every BCHPR data project depends on — APIManager, PathsManager, REDCap wrappers, study-ID generation, SharePoint I/O, and dozens of cross-project utilities.
Architect
data_quality_manager.py — Enterprise DQA Framework
11,007-line data quality platform with fluent QueryBuilder, persistent query lifecycle tracking, duplicate analysis, and double-data-entry verification across 28+ instruments — with SQLite persistence and Polars acceleration.
Engineer
study_id_patterns.py — Study-ID Regex Registry
2,611-line centralised registry of 8 study-ID patterns and 14 site-code patterns across Cameroon, Nigeria, and Vietnam projects — with vectorised extraction, validation, classification, and cleaning.