Skip to content
All projects
Core engineering libraryArchitect

my_functions.py — Centralised Python Library

BCHPR · underpins 23+ projects · 2023 – present

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.

Highlights

  • 50+ API key groups managed through a single APIManager (GHIT, Wave11, S4A, RapidTB, Viral Load, Manager.io, M365 Graph).
  • Cross-platform PathsManager auto-detecting Windows / WSL / Linux with SharePoint-sync awareness.
  • ThreadPoolExecutor-based parallel REDCap exports / imports with exponential-backoff retry logic.
  • Chunked record imports (default 2,000 per call) and rate-limited API request queuing.
  • Cut new-project setup time from days to hours by standardising patterns across all 23+ projects.