Created
January 18, 2025 00:23
-
-
Save obfusk/9973cb08c246fdf51c9d7ef30351b633 to your computer and use it in GitHub Desktop.
per-day downloads for a specific IoD app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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