github-readme-stats-0.2.0 is not a library.
github-readme-stats
Rust CLI to fetch GitHub user statistics as JSON.
Installation
Download from Releases or build from source:
Usage
Configuration file
Create github-readme-stats.toml in the working directory for optional settings
(token stays in GHT env only).
[]
= "+08:00" # UTC offset for time distribution
[]
= ["owner/repo1", "owner/repo2"] # repos to fetch detailed stats for
[]
= 1000 # max commits to sample (default 1000)
= 10 # top N languages to include (default 10)
= ["HTML", "CSS"] # languages to exclude (case-insensitive)
= ["programming"] # Linguist types to include (default: ["programming"])
Environment Variables
| Variable | Required | Description |
|---|---|---|
GHT |
yes | GitHub Personal Access Token (read:user scope) |
Output
JSON with the following structure:
Notes
- Profile and contribution data are fetched via GraphQL; commit sample, time distribution, and language stats use REST.
language_usageis derived from commit file changes (additions + deletions), not repo sizes.- Language detection uses a build-time snapshot of GitHub Linguist
languages.yml. To update, re-downloaddata/languages.ymland rebuild. - By default, only
programminglanguages are included. Setlanguage.typesto["programming", "markup"]etc. to widen the filter. Valid types:programming,data,markup,prose. - Time distribution and language usage share the same commit sample (
language.commits_limit). - Language stats can be rate-limit heavy because each sampled commit fetches commit details.
Used by
- github-stats-typst — GitHub Action to render stats as SVG cards
License
MIT