This repo generates isometric SVG versions of the GitHub contribution graph for a profile README.
The generated assets live here:
output/contribs-light.svgoutput/contribs-dark.svg
Your actual profile README should live in a separate public repository named exactly:
your-username/your-username
generate_contribs.pyfetches your contribution calendar from the GitHub GraphQL API.- It renders light and dark SVG variants into
output/. - The GitHub Actions workflow runs once a day and commits refreshed SVGs back to this repo.
- Your profile README embeds those SVGs from the raw GitHub URLs.
This project intentionally treats color and height differently:
- Color matches GitHub's native contribution intensity buckets via
contributionLevel - Height uses the raw daily
contributionCountwith a logarithmic curve
Why do that?
- A single contribution should still feel visually meaningful in 3D
- Higher-count days should keep getting taller
- Extremely busy days should not become absurd spikes that dominate the whole graphic
So two days can share the same GitHub color bucket but still have different heights here.
In short:
- color = GitHub-style intensity
- height = softened contribution volume
If you want a stricter “exactly GitHub, but extruded” version, you can swap the height logic to use contributionLevel instead of contributionCount.
Use a temporary output directory so you do not accidentally overwrite the tracked production SVGs while experimenting.
python3 generate_contribs.py --mock --out ./tmp/mock-outputGH_README_TOKEN=your_token_here GITHUB_USER=your_username python3 generate_contribs.py --out ./tmp/live-outputOpen the generated files in your browser:
open ./tmp/live-output/contribs-dark.svg
open ./tmp/live-output/contribs-light.svgFork this repo into your own GitHub account.
Your fork becomes the public asset repo that stores the generated SVGs. Example:
your-username/github-readme
In your-username/github-readme:
- Go to
Settings -> Secrets and variables -> Actions - Create a repository secret named
GH_README_TOKEN - Paste a GitHub personal access token
If you want private contributions included, use a token with enough access to read them. If the secret is missing, the workflow falls back to the built-in GITHUB_TOKEN, which is usually only good for public-only data.
In the repo:
- Open the
Actionstab - Enable workflows if GitHub prompts you to
- Run
Update Contribution Artonce manually withRun workflow
After that, the workflow also runs every day on this schedule:
17 6 * * *UTC
The asset repo must be public, or the raw SVG URLs will return 404.
Create your profile README repo if you do not already have one:
your-username/your-username
That repo must be public and contain a root README.md.
Add this snippet to that README:
<picture>
<source
media="(prefers-color-scheme: dark)"
srcset="https://raw.githubusercontent.com/your-username/github-readme/main/output/contribs-dark.svg"
/>
<img
alt="Isometric GitHub contribution chart"
src="https://raw.githubusercontent.com/your-username/github-readme/main/output/contribs-light.svg"
/>
</picture>Replace:
your-username/github-readmewith your asset repo
If GitHub shows a Share to profile button on the your-username/your-username repo page, click it.
- generate_contribs.py: fetches GitHub data and renders the SVGs
- .github/workflows/update-contribs.yml: regenerates and commits the SVGs every day
output/contribs-light.svgandoutput/contribs-dark.svg: generated assets committed by the workflow