How robberwick/pylibrelinkup works
Main Components
a. Client Layer:
• PyLibreLinkUp client class at the center
• Main public methods: authenticate(), get_patients(), latest(), graph(), logbook()
b. Model Layer:
• Model classes: Connection, Hardware, Login, Data
c. External Integration:
• LibreLinkUp API as an external system
• Main API endpoints the client interacts with
Component Relationships
• Client → Authentication → LibreLinkUp API
• Client → Data Retrieval → LibreLinkUp API
• API Responses → Models (Data Transformation)
• Models → Client (Return Data)
Architectural Elements
Specific components:
┌─────────────────────────────────────────────────────┐
• PyLibreLinkUp Client │
• ┤
• Authentication │
• Patient Management │
• Glucose Data Retrieval │
• ┘
• ↑ ↓
┌─────────────────────────────────────────────────────┐
• Model Layer │
• ┤
• Connection Model │
• Hardware Model │
• Login Model │
• Data Model │
• ┘
• ↑ ↓
┌─────────────────────────────────────────────────────┐
• LibreLinkUp API │
• ┤
• Authentication Endpoints │
• Patient Data Endpoints │
• Glucose Measurement Endpoints │
• ┘
Additional Elements
a. Utilities Section:
• Utilities.py and decorators.py components
• Their support role in the architecture
b. Exception Handling:
• An exceptions component
• How it integrates with the main client
c. Configuration:
• Config model and its relationship to the client
• How API URLs are managed (api_url.py)
Important Details to Highlight
• Authentication Flow:
• Sequence of authentication steps
• Token management
• Data Retrieval Methods:
• Distinguish between latest(), graph(), and logbook() methods
• Their different data paths
Notes for Implementation
• Use clear boundaries between internal and external components
• Version information and deprecation notices (e.g., for the read() method)
• Test coverage relationship to components
Remember to maintain a balance between detail and clarity, focusing on the key architectural components while avoiding overwhelming detail at the implementation level.