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
--usernameor-uCLI option. This should be a string enclosed in quotation marks.
- Equivalent to the
token- Equivalent to the
--tokenor-tCLI option. This should be a string enclosed in quotation marks.
- Equivalent to the
ascii- Equivalent to the
--asciior-aoption and can beTrueorFalse. IfTruethen the output will use ASCII characters instead of the default Emoji characters. IfFalseor ommitted then Emoji characters will be used as the default.
- Equivalent to the
summary- Equivalent to the
--summaryor-soption and again can beTrueorFalse. The default is True. This will show a summary for the year under the main table.
- Equivalent to the
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 toFalse--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
USERNAMEandGITHUB_PATto 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2afaa6b57302c5112ee4023ba04898ee224812282634d09bf01eeab396d6583d
|
|
| MD5 |
e3e33f87509ff11348cd52912d100994
|
|
| BLAKE2b-256 |
458b121d26c8e3447145e3fba66cc6e450f2c00e305e26e067ecbcfb3671bc80
|
File details
Details for the file github_contrib_view-0.3.1-py3-none-any.whl.
File metadata
- Download URL: github_contrib_view-0.3.1-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e42c3f1b765e8b17a2d60c7aa0d5e9d94e429da06ce5a476935df053b79a474
|
|
| MD5 |
4b88f69b8adef80b5f814cde831d1944
|
|
| BLAKE2b-256 |
ab1d8dbd826c6d11778342e89fa8ef801c28e5d7b592b4f28919b918d675cc01
|