How pkpio/fitbit-googlefit works
This is a Fitbit-to-Google Fit data exporter. The main workflow reads configuration and authenticated clients, then syncs a date range: Fitbit records are fetched, converted to Google Fit points or sessions, and written to Google Fit. Separate paths handle intraday and daily logs, sleep, and activity sessions; the README also documents minute-level steps, distance, calories, and sleep, plus second-level heart rate. Authentication scripts establish credentials for both services. Relationships below follow shown calls or README statements; unsampled implementation details are not inferred.
Main entry points: remote.py Remote sync coordinator · app.py Sync entry point · helpers.py API client helper · convertors.py Point and session conversion
Components 14
Sync orchestration
- Sync entry point
app.py - Sync configuration
config.ini - Remote sync coordinator
remote.py - Intraday metrics
remote.py - Daily logs
remote.py - Sleep sync
remote.py - Activity sessions
remote.py
Data conversion
- Point and session conversion
convertors.py
Authentication
- API client helper
helpers.py - Fitbit OAuth
auth/auth_fitbit.py - Google OAuth
auth/auth_google.py
External services
- Fitbit API
- Google Fit API
Other components
- Operator
Connections 26
- Operator → Sync entry point: starts sync
README.md - Sync entry point → Sync configuration: reads settings
app.py - Sync entry point → API client helper: creates clients
app.py - Sync entry point → Point and session conversion: initializes
app.py - Sync entry point → Remote sync coordinator: dispatches sync
app.py - Remote sync coordinator → Intraday metrics: dispatches intraday
remote.py - Remote sync coordinator → Daily logs: dispatches logs
remote.py - Remote sync coordinator → Sleep sync: dispatches sleep
remote.py - Sync entry point → Activity sessions: syncs activities
app.py - Intraday metrics → Fitbit API: fetches metrics
remote.py - Daily logs → Fitbit API: fetches logs
remote.py - Sleep sync → Fitbit API: fetches sleep
remote.py - Activity sessions → Fitbit API: fetches activities
remote.py - Intraday metrics → Point and session conversion: converts points
remote.py - Daily logs → Point and session conversion: converts logs
remote.py - Sleep sync → Point and session conversion: converts sleep
remote.py - Activity sessions → Point and session conversion: converts sessions
remote.py - Remote sync coordinator → Google Fit API: creates data sources
remote.py - Remote sync coordinator → Google Fit API: writes points
remote.py - Remote sync coordinator → Google Fit API: writes sessions
remote.py - Operator → Fitbit OAuth: authorizes Fitbit
README.md - Operator → Google OAuth: authorizes Google
README.md - Fitbit OAuth → API client helper: provides credentials
README.md - Google OAuth → API client helper: provides credentials
README.md - API client helper → Fitbit API: builds client
helpers.py - API client helper → Google Fit API: builds client
helpers.py