How swsphn/pmhclib works
Main Components
a) Client Application Layer:
• User's Python application that implements pmhclib
• As the topmost component
b) pmhclib Core:
• Central component showing the main PMHC class (from pmhc.py)
• Authentication handling subsystem
• Environment variables integration
c) External Dependencies:
• Playwright browser automation
• TOTP authentication system
• PMHC MDS Portal API (external system)
Component Relationships
• Top-down architecture showing data flow
• Authentication flow separate from main API operations
• Clear distinction between library components and external services
Specific Implementation Details
1. User Application (Top)
2. pmhclib Interface Layer
• Context Manager implementation
• Environment variables handler
3. Authentication Layer
• Playwright Browser Automation
• TOTP Generator
• Credentials Manager
4. API Communication Layer
5. PMHC MDS Portal (Bottom)
Specific Flows to Highlight
a) Authentication Flow:
• User App → pmhclib → Credentials Manager → Playwright → PMHC Portal
• ↳ TOTP Generator ↗
b) API Operations Flow:
• User App → pmhclib → PMHC Portal API
Additional Elements
Annotations for:
• Environment variables (PMHC_USERNAME, PMHC_PASSWORD, PMHC_TOTP_SECRET)
• Context manager boundaries
• Browser automation scope
• API endpoints