Skip to main content

View your GitHub contributions as a graph in the terminal.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

github_contrib_view-0.3.1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

github_contrib_view-0.3.1-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file github_contrib_view-0.3.1.tar.gz.

File metadata

  • Download URL: github_contrib_view-0.3.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for github_contrib_view-0.3.1.tar.gz
Algorithm Hash digest
SHA256 2afaa6b57302c5112ee4023ba04898ee224812282634d09bf01eeab396d6583d
MD5 e3e33f87509ff11348cd52912d100994
BLAKE2b-256 458b121d26c8e3447145e3fba66cc6e450f2c00e305e26e067ecbcfb3671bc80

See more details on using hashes here.

File details

Details for the file github_contrib_view-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for github_contrib_view-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7e42c3f1b765e8b17a2d60c7aa0d5e9d94e429da06ce5a476935df053b79a474
MD5 4b88f69b8adef80b5f814cde831d1944
BLAKE2b-256 ab1d8dbd826c6d11778342e89fa8ef801c28e5d7b592b4f28919b918d675cc01

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page