How dkssvp/day13_hourly_focus_metrics_sync_to_firebase works
This repository contains two Python workflows for tracking developer application time from ActivityWatch: one prints and saves a 24-hour focus summary, while the other periodically syncs hourly metrics to Firestore. Both identify window and AFK events, filter applications, and exclude AFK intervals. The scheduled workflow adds retries and a local fallback log. Relationships below are supported by the two sampled source files; the README is empty, and no broader product capabilities are documented.
Main entry points: scheduled_focus_push.py Hourly sync · focus_tracker.py Focus report runner
Components 16
Focus analysis
- Focus report runner
focus_tracker.py - ActivityWatch event fetch
focus_tracker.py - AFK and window intervals
focus_tracker.py - Focus summary
focus_tracker.py - JSON report file
Scheduled sync
- Hourly scheduler
scheduled_focus_push.py - Hourly sync
scheduled_focus_push.py - Hourly aggregation
scheduled_focus_push.py - ActivityWatch event fetch
scheduled_focus_push.py - AFK and window intervals
scheduled_focus_push.py - Firestore initialization
scheduled_focus_push.py - Retried document writes
scheduled_focus_push.py - Fallback logging
scheduled_focus_push.py
External services
- ActivityWatch API
- Firestore
Other components
- User
Connections 18
- User → Focus report runner: runs report
focus_tracker.py - Focus report runner → ActivityWatch event fetch: requests events
focus_tracker.py - ActivityWatch event fetch → ActivityWatch API: fetches events
focus_tracker.py - Focus report runner → AFK and window intervals: processes events
focus_tracker.py - AFK and window intervals → Focus summary: calculates totals
focus_tracker.py - Focus report runner → JSON report file: writes JSON
focus_tracker.py - User → Hourly scheduler: starts scheduler
scheduled_focus_push.py - Hourly scheduler → Hourly sync: runs hourly sync
scheduled_focus_push.py - Hourly sync → Hourly aggregation: requests metrics
scheduled_focus_push.py - Hourly aggregation → ActivityWatch event fetch: fetches events
scheduled_focus_push.py - ActivityWatch event fetch → ActivityWatch API: fetches events
scheduled_focus_push.py - Hourly aggregation → AFK and window intervals: filters and totals
scheduled_focus_push.py - Hourly sync → Firestore initialization: initializes client
scheduled_focus_push.py - Hourly sync → Retried document writes: writes metrics
scheduled_focus_push.py - Firestore initialization → Firestore: creates client
scheduled_focus_push.py - Retried document writes → Firestore: sets documents
scheduled_focus_push.py - Retried document writes → Fallback logging: logs failed writes
scheduled_focus_push.py - Hourly sync → Fallback logging: logs sync errors
scheduled_focus_push.py