wyattowalsh docs
Data & MetricsFetch History

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 available
  • stars — historical starring events for the profile repository
  • forks — historical fork events for the profile repository
  • repos — repository timeline data for the account
  • contributions_daily / contributions_monthly — contribution calendar history
  • current_metrics — current snapshot values used alongside the historical series
  • star_velocity — derived velocity signal computed from the star timeline
  • contribution_streaks — derived streak metadata computed from contributions_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.json

Authentication

Same as fetch_metricsGITHUB_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.json

The 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.