https://github.com/spenserblack/github-polyglot
Linguist, but for the user instead of the repository
https://github.com/spenserblack/github-polyglot
github language-statistics
Last synced: 9 days ago
JSON representation
Linguist, but for the user instead of the repository
- Host: GitHub
- URL: https://github.com/spenserblack/github-polyglot
- Owner: spenserblack
- License: mit
- Created: 2025-12-23T15:17:04.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-06-09T20:55:08.000Z (16 days ago)
- Last Synced: 2026-06-09T22:06:07.831Z (16 days ago)
- Topics: github, language-statistics
- Language: Ruby
- Homepage:
- Size: 58.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# github-polyglot
[](https://badge.fury.io/rb/github-polyglot)
[](https://github.com/spenserblack/github-polyglot/actions/workflows/ci.yml)
Linguist, but for the user instead of the repository.
This scans all of the repositories that the user has and compiles the language stats.
The stats can be output as...
- A human-readable terminal output
- JSON
- An SVG file resembling the language bar
## Usage
### As a GitHub Action
This action runs the `github-polyglot` gem in a Docker container.
#### Inputs
##### `token`
Optional. GitHub API token to avoid rate limits when scanning repository language details.
##### `user`
Optional. The user to collect data for. Defaults to the owner of the repository that is running
the action.
##### `format`
Optional. The format of the output. Defaults to `print` (a display format for terminal display).
#### Outputs
##### `output`
The output of the `github-polyglot` gem.
#### Example
```yaml
# ...
steps:
- uses: spenserblack/github-polyglot@main
id: github-polyglot
with:
token: ${{ secrets.PAT }}
format: svg
- name: Create language stats image
env:
SVG: ${{ steps.github-polyglot.outputs.output }}
run: echo "$SVG" > language-stats.svg
# Commit the SVG with your favorite commands or actions
```
### As a Ruby Gem
If the `GITHUB_TOKEN` environment variable is set, it can use that token to get more
accurate stats and avoid rate-limiting. You can also avoid needing to pass `--username`
if you have the token set.
## Building
### Prerequisites
This project depends on [Linguist][github-linguist], which has some dependencies that
may require extra steps. Read their documentation for more details.
#### On Ubuntu
```shell
sudo apt install build-essential cmake pkg-config libicu-dev zlib1g-dev libcurl4-openssl-dev libssl-dev ruby-dev
```
[dotenv-gem]: https://github.com/bkeepers/dotenv
[github-linguist]: https://github.com/github-linguist/linguist