Fetch History
Collects historical GitHub signals into a JSON snapshot used by living-art timelapse generation.
Module
scripts/fetch_history.py
Shared HTTP helpers live in scripts/_github_http.py.
What it fetches
fetch_history builds one consolidated history payload for living-art rendering. The shape includes:
account_created— account creation timestamp when GraphQL access is availablestars— historical starring events for the profile repositoryforks— historical fork events for the profile repositoryrepos— repository timeline data for the accountcontributions_daily/contributions_monthly— contribution calendar historycurrent_metrics— current snapshot values used alongside the historical seriesstar_velocity— derived velocity signal computed from the star timelinecontribution_streaks— derived streak metadata computed fromcontributions_monthly
Internally the module mixes REST and GraphQL calls, then derives the extra signals before writing the final JSON.
CLI
uv run python -m scripts.fetch_history \
--owner wyattowalsh \
--repo wyattowalsh \
--output /tmp/history.jsonAuthentication
Same as fetch_metrics — GITHUB_TOKEN env var:
export GITHUB_TOKEN=ghp_...Output shape
{
"account_created": "2020-01-01T00:00:00Z",
"stars": [
{ "starred_at": "2024-01-10T12:00:00Z" }
],
"forks": [
{ "created_at": "2024-02-01T09:30:00Z" }
],
"repos": [
{
"name": "orchid-core",
"created_at": "2023-06-01T00:00:00Z",
"stargazers_count": 12,
"forks_count": 3,
"topics": ["ai", "agents"]
}
],
"contributions_daily": {
"2025-01-01": 2
},
"contributions_monthly": {
"2025-01": 12
},
"star_velocity": {
"stars_last_30d": 4
},
"contribution_streaks": {
"longest_streak_months": 6,
"current_streak_months": 3,
"streak_active": true
}
}Usage in living art
The history JSON is passed into the living-art commands so the canonical living-*.gif timelapses can use real repository chronology:
uv run python -m scripts.cli generate living-art \
--metrics-path /tmp/metrics.json \
--history-path /tmp/history.jsonThe commit timestamps are used to compute daily activity density and day-by-day sampling. After a successful render, the canonical output directory is re-indexed into living-art-manifest.json and living-art-preview.html, then mirrored into docs/public/showcase/ when the docs site is available.