Skip to content

Instantly share code, notes, and snippets.

@obfusk
Created January 18, 2025 00:23
Show Gist options
  • Save obfusk/9973cb08c246fdf51c9d7ef30351b633 to your computer and use it in GitHub Desktop.
Save obfusk/9973cb08c246fdf51c9d7ef30351b633 to your computer and use it in GitHub Desktop.
per-day downloads for a specific IoD app
import glob
import json
import sys
from typing import Dict
appid, = sys.argv[1:]
results: Dict[str, int] = {}
for json_file in sorted(glob.glob("apk_downloads/*/*.json")):
with open(json_file, encoding="utf-8") as fh:
data = json.load(fh)
for date, value in data.items():
if appid in value:
results.setdefault(date, 0)
results[date] += value[appid]
for date, downloads in sorted(results.items()):
print(f"{date}: {downloads}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment