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/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.0.tar.gz (7.1 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.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for github_contrib_view-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ff97f975cdc7ce71930d7b9cc48a4ff6215f958c023945d35642cb293b2481f8
MD5 de7ded75c1706b45ce7a30dfca26ab68
BLAKE2b-256 6d9a00a3809a63bc781e8d85ab83804758cb6b2e72a85391a32a38706682eed6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for github_contrib_view-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5892f9fdaa70f64da6043389c42b9ffe37fd07d17c598084124d7a6a47d6d3e3
MD5 497d3665f0e2b09c8ba51b5eaac4af90
BLAKE2b-256 d009c01297fc2f890b20f90fada2d6565db0003252a9c418f17d81cd2f3f461e

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