Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/collect-play.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ jobs:
printf '%s' "$PLAY_SA_JSON" > "$GOOGLE_APPLICATION_CREDENTIALS"
uv run vitals.py crash-rate --days 30 --update data/android-crash-rate.csv
uv run vitals.py anr-rate --days 30 --update data/android-anr-rate.csv
# installs/installed.csv is intentionally disabled pending the metric
# decision (Installed audience vs Active Device Installs) — see #17.
# The SA can now read the bucket, so re-enable once decided:
# uv run android_installs.py --bucket "$PLAY_BUCKET" update
# installed.csv = Active Device Installs from the bulk reports (#17).
if [ -n "$PLAY_BUCKET" ]; then
uv run android_installs.py --bucket "$PLAY_BUCKET" update
fi
rm -f "$GOOGLE_APPLICATION_CREDENTIALS"
- name: Commit
if: env.HAS_SA == 'true'
run: |
git config --local user.email "noreply@github.com"
git config --local user.name "GitHub Action"
git add data/android-crash-rate.csv data/android-anr-rate.csv
git add data/android-crash-rate.csv data/android-anr-rate.csv data/android/installed.csv
git diff --cached --quiet || git commit -m "chore: update Play Console stats"
- name: Push changes
if: env.HAS_SA == 'true'
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ These data are updated automatically in CI:
- `stats.csv` - Downloads & GitHub stars
- `releases.csv` - Release dates of past releases
- `stats-assets.csv` - Per-asset download counts (source for per-platform / per-version breakdowns)
- `android/installed.csv` - Android install base (Active Device Installs, Play Console bulk reports)
- `android-crash-rate.csv` / `android-anr-rate.csv` - Android vitals (Play Developer Reporting API)

The following is manually updated:

- `chrome-weekly-users.csv` - Chrome extension weekly active users
- `firefox-daily-users.csv` - Firefox extension daily active users
- `android/installed.csv` - Android installed devices (Play Console export)
- `notes.csv` - Manual entries of major/interesting events


Expand Down
10 changes: 4 additions & 6 deletions android_installs.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@
# Consistent key location shared by local runs, agents, and CI.
DEFAULT_CREDENTIALS = os.path.expanduser("~/.config/activitywatch/play-sa.json")
DEFAULT_METRIC_COLUMN = "Active Device Installs"
INSTALLED_HEADER = [
"Date",
"Installed audience (All users, Unique users, Per interval, Daily): All app versions",
"Notes",
]
INSTALLED_HEADER = ["Date", "Active Device Installs", "Notes"]


def _token(credentials: str | None) -> str:
Expand Down Expand Up @@ -114,7 +110,9 @@ def parse_report(raw: bytes, metric_column: str) -> dict[str, str]:
for row in csv.DictReader(io.StringIO(text)):
date = (row.get("Date") or "").strip()
value = (row.get(metric_column) or "").strip().replace(",", "")
if date and value:
# Skip "0": Play leaves not-yet-finalized recent days as 0, which would
# otherwise be a spurious dip in the install base.
if date and value and value != "0":
out[date] = value
Comment on lines +115 to 116

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restrict zero filtering to the unfinalized tail

When a report contains an internal zero, this predicate removes that date entirely instead of only suppressing Play's unfinalized trailing days; the committed rebuild already shows this by omitting 2026-07-06 while keeping 2026-07-07 and 2026-07-08. That makes the daily series consumed by analyze_stats._load_data() sparse and interpolated, so the chart/CSV no longer reflects the reported install base for the missing day; please trim only the trailing zero suffix or otherwise retain an explicit value.

Useful? React with 👍 / 👎.

return out

Expand Down
Loading