paths_manager.py — Cross-Platform Path Resolution
BCHPR · 16 dependent scripts · 2023 – present
Every project script reads and writes under a shared SharePoint-synced tree. Hard-coding those paths breaks the moment a script runs on another machine, under WSL, or inside Airflow. 586 lines resolve 213 named paths across 27 project groups, from one environment variable.
Highlights
- Platform detected once at construction — Windows, WSL (sniffed from the kernel release string), or POSIX — and every path rewritten to match.
- Validation is extension-aware: a path with no file extension that does not exist is reported missing and can be created, while file-shaped paths are skipped so the pass never tries to mkdir a template.
- New path groups are picked up automatically by type dispatch rather than manual registration.
- Paths are exported both as a structured object and as module-level names, so the older call sites that predate the class redesign keep working unchanged.
Related projects
Data Manager
data_quality_manager.py — Data-Quality Engine
REDCap validates one field at a time, at entry. It cannot express “this specimen date precedes the enrolment date on a different form”, or “these two record IDs are the same participant”. This 14,274-line engine does, and it remembers — every issue it raises has an open date, a close date, and a resolution time.
Data Manager
MANAGER.py — Manager.io Accounting API Client
15,661-line Manager.io API client. Full create / update / delete across 18 document types — sales quotes, orders, invoices, credit notes, delivery notes and receipts; purchase quotes, orders, invoices and debit notes; inventory items, locations, transfers, write-offs, goods receipts, production orders and starting balances; and payments. Customers, suppliers, projects, accounts, assets and tax codes are exposed read-only.
Data Manager
data_utilities.py — Shared DataFrame Toolbox
The dependency root of the library — 9,746 lines that import nothing else in the codebase and that everything else imports. 84 public callables covering REDCap activity-log parsing, data-dictionary recoding, checkbox column expansion, export diffing, and file I/O that survives a SharePoint sync.