Skip to main content

GitHub Contributions Viewer

A Python package to view your GitHub yearly contributions in the terminal, duplicating the 'grass' map from your GitHub profile pages.

This tool is still being written, so there may be some more functionality coming.

NOTE: Currently the tool is untested under Windows, it may work but is unsupported. I'll look at testing under Windows and making any required fixes once the tool is stable. Should work fine under Linux (primary development environment) or Mac OsX.

Installation

You can install the package as a standalone tool using uv:

uv tool install github-contrib-view

or pipx:

pipx  install github-contrib-view

Or simply use pip to install to your current virtualenv or global python:

pip install github-contrib-view

Setup

You will need to have a GitHub Personal Access Token to use this tool, get one from GitHub.

Setup a configuration File

This is entirely optional, but is the best way to set the username and token variables to avoid having to specify them each time you run the tool.

You will need to create the config file manually, it should be named config.toml and placed in the ~/.config/ghcview/ folder (you will need to create the folder too).

The configuration is in TOML format, and currently has 4 possible variables:

  • username
    • Equivalent to the --username or -u CLI option. This should be a string enclosed in quotation marks.
  • token
    • Equivalent to the --token or -t CLI option. This should be a string enclosed in quotation marks.
  • ascii
    • Equivalent to the --ascii or -a option and can be True or False. If True then the output will use ASCII characters instead of the default Emoji characters. If False or ommitted then Emoji characters will be used as the default.
  • summary
    • Equivalent to the --summary or -s option and again can be True or False. The default is True. This will show a summary for the year under the main table.

The first line of the file should contain the section header [ghcview]

Example config file (~/.config/ghcview/config.toml)

[ghcview]
username="seapagan"
token="ghp_xxxxxxxxxxxxxxxxxxxxxxxxx"
summary=false
ascii=true

Configure from the CLI

Instead of this, you can specify options from the command line. These will take preference over any settings in the configuration file:

ghcview --username seapagan --token ghp_xxxxxxxxxxxxxxxxxxxxxxxxx --ascii --summary

Currently there are 5 CLI options:

  • --username / u: The username to show GitHub stats for. This is MANDATORY, either through the CLI or configuration file.
  • --token / -t: Your GitHub PAT (Personal Access Token). This is MANDATORY, either through the CLI or configuration file.
  • --ascii / -a : Use ASCII characters instead of the default emojis for the coloured boxes. Optional, defaults to False
  • --summary / -s : Display a summary of the past year's contributions under the chart. Optional, defaults to True.
  • --help : Display brief help for the program.

IMPORTANT

The ability to use Environment Variables USERNAME and GITHUB_PAT to set the username/token was REMOVED in version 0.3.0

Usage

Run the viewer as:

ghcview

Metadata

Release files for github-contrib-view 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for github-contrib-view 0.3.1
File Size Uploaded Provenance
github_contrib_view-0.3.1.tar.gz 7.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for github-contrib-view 0.3.1
File Interpreter ABI Platform
github_contrib_view-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.6 kB

Release files / github_contrib_view-0.3.1.tar.gz

Download URL github_contrib_view-0.3.1.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2afaa6b57302c5112ee4023ba04898ee224812282634d09bf01eeab396d6583d
BLAKE2b-256 checksum
How to use checksums
458b121d26c8e3447145e3fba66cc6e450f2c00e305e26e067ecbcfb3671bc80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.2

Release files / github_contrib_view-0.3.1-py3-none-any.whl

Download URL github_contrib_view-0.3.1-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e42c3f1b765e8b17a2d60c7aa0d5e9d94e429da06ce5a476935df053b79a474
BLAKE2b-256 checksum
How to use checksums
ab1d8dbd826c6d11778342e89fa8ef801c28e5d7b592b4f28919b918d675cc01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.2

Security for github-contrib-view 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page