A GitHub user activity tracker that records profile snapshots over time and stores them as append-only JSON history files. Designed around a small Repository/Fetcher interface so the live API path and the offline demo path are swappable.
Fetcherinterface with two implementations:GitHubApiFetcher: live GitHub REST API viarequests. Guarded: requires aGITHUB_TOKEN(or--token), handles 404 and rate-limit (403) responses, and adds recent public-event activity. Rate-limited by GitHub.FixtureFetcher: reads bundleddata/user_fixture.json, so--offline, tests and demos work with no network and no token.
SnapshotStore: append-only JSON snapshots underhistory/<username>.json.- CLI:
track(fetch + store) andhistory(list snapshots with deltas).
Offline demo (no network, no token):
pip install -r requirements.txt
python -m github_tracker track alex_dev --offline
python -m github_tracker history alex_devLive tracking (needs a personal access token):
set GITHUB_TOKEN=your_token_here
python -m github_tracker track some_user
python -m github_tracker history some_userCustom history directory: add --history <dir> to either command. The default
is history/, which is git-ignored (folders created on first run).
Verify:
python -m pytest -qgithub-tracker/
data/user_fixture.json
src/github_tracker/
fetcher.py # Fetcher interface + GitHubApiFetcher + FixtureFetcher
store.py # append-only JSON snapshot history
cli.py # track / history subcommands
tests/test_smoke.py
requirements.txt
MIT