Generate daily updated visualizations of user and repository statistics from the GitHub API using GitHub Actions

Overview

GitHub Stats Visualization

Generate daily updated visualizations of user and repository statistics from the GitHub GraphQL and REST APIs using GitHub Actions and Secrets for any combination of private and public repositories - dark mode supported.

GitStats Overview - LightGitStats Overview - DarkGitStats Languages - LightGitStats Languages - Dark

This is a modification of jstrieb/github-stats with many additional statistics, options and dark mode support

By default, statistical data for GitHub repositories an authenticated user either owns, has collaborative access to, or has otherwise contributed to are fetched from the GitHub API for visualization.

Forked repositories are excluded by default. However, there are many options provided for including or excluding any repository and more using: Statistics Options.

Regardless of which repositories are included, the generated All-time GitHub contributions given statistic will always represent all GitHub contributions by the user.

It seems that view and clone statistical data for repositories that an authenticated user neither owns nor has collaborative access to are not included in the generated statistics being visualized.

It also seems that statistics for contributions to GitHub repositories that an authenticated user neither owns nor has collaborative access to possibly only includes repositories that exist on GitHub before the contributions do. Contribution statistics for repositories uploaded to GitHub after the contributions are made, so long that the configured commit email is associated with the user's GitHub account, can be included in the statistic visualizations by manually including the repository using the MORE_REPOS secret option in Statistics Options.

Instructions

Click to view step-by-step instructions for generating your own GitHub statistics visualizations

Copy Repository

  1. Click either link to start generating your own GitHub statistic visualizations:
    1. Generate your own copy of this repository without the commit history
      • Note: the first GitHub Actions workflow initiated at creation of the copied repository is expected to fail
    2. Fork a copy of this repository with the commit history configured to sync changes
      • Note: this copies all branches including the action_branch with statistics, but this can be overwritten

Generate a New Personal Access Token

  1. Generate a personal access token by following these steps:
    1. If you are logged in, click this link to: generate a new token
    2. Name the token
    3. Select your preferred 'Expiration' date
    4. Select repo for 'Full control of private repositories'
    5. Select read:user to 'Read ALL user profile data'
    6. Click the 'Generate token' button
    7. Copy the generated token - there is only one opportunity provided for this

Create ACCESS_TOKEN Secret

  1. Create a repository secret for the personal access token by following these steps:
    1. If this is your copy of the repository, click this link to: create a new secret
      • Otherwise, go to repository Settings, click the Secrets option, then click New repository secret
    2. Name the new secret: ACCESS_TOKEN
    3. Enter the generated personal access token as the 'Value'

Run GitHub Actions Workflow

  1. Manually generate GitHub statistics visualizations:
    1. This can be done using any of the following two GitHub Actions workflows:
      1. For the first time, or to reset stored statistics (although this is done with every push to master):

        This is required if the actions_branch branch is not created, as it is created when run

      2. Otherwise, for updating generated statistics visualizations (although this is automatically done daily):

        This requires the actions_branch branch to first be created with generated statistics visualizations

    2. With the GitHub Actions page open, click the 'Run workflow' dropdown menu button
    3. Select Branch: master from the 'Use workflow from' dropdown list
    4. Click the 'Run workflow' button

View Generated Statistics

  1. Following the successful completion of a workflow, generated statistics visualizations can be viewed:
    1. In the generated_images directory in the actions_branch branch with the following image links:
      1. Language statistics using @media prefers-color-scheme for dark and light mode - not tested
      2. Language statistics in light mode only
      3. Language statistics in dark mode only
      4. Overview statistics using @media prefers-color-scheme for dark and light mode - not tested
      5. Overview statistics in light mode only
      6. Overview statistics in dark mode only

Display Generated Statistics

  1. To display the generated statistics, constant URLs can be used for images that are updated daily:
    1. For a GitHub profile README.md, attach #gh-light-mode-only and #gh-dark-mode-only to light and dark raw image links, respectively, such as:
      1. For generated language statistics visualizations (replacing with your GitHub username):
      ![](https://raw.githubusercontent.com/
              /GitStats/actions_branch/generated_images/languagesLightMode.svg
              #gh-light-mode-only)![](https://raw.githubusercontent.com/
              
               /GitStats/actions_branch/generated_images/languagesDarkMode.svg
               #gh-dark-mode-only)
              
             
      1. For generated overview statistic visualizations (replacing with your GitHub username):
      ![](https://raw.githubusercontent.com/
              /GitStats/actions_branch/generated_images/overviewLightMode.svg
              #gh-light-mode-only)![](https://raw.githubusercontent.com/
              
               /GitStats/actions_branch/generated_images/overviewDarkMode.svg
               #gh-dark-mode-only)
              
             
    2. For websites, use the raw image URLs for any suitable image from the above View Generated Statistics links.

      Note: I have not used the images on any website other than the following GitHub pages:

      https://r055a.github.io/profile/statistics/

      https://r055a.github.io/university-projects/statistics/

Statistics Options

Click to view Repository Secrets for customizing GitHub statistic visualizations
  • Secret Name: EXCLUDED
    • for excluding listed repositories from being included in the generated statistic visualizations
    • enter Value in the following format (separated by commas):
      • [owner/repo],[owner/repo],...,[owner/repo]
    • example:
      • jstrieb/github-stats,rahul-jha98/github-stats-transparent,idiotWu/stats
  • Secret Name: ONLY_INCLUDED
    • for ONLY including listed repositories in the generated statistic visualizations
    • enter Value in the following format (separated by commas):
      • [owner/repo],[owner/repo],...,[owner/repo]
    • example:
      • R055A/GitStats,R055A/R055A
  • Secret Name EXCLUDED_LANGS
    • for excluding listed languages from being included in the generated statistic visualizations
    • enter Value in the following format (separated by commas):
      • [language],[language],...,[language]
    • example:
      • HTML,Jupyter Notebook,Makefile,Dockerfile
  • Secret Name INCLUDE_FORKED_REPOS
    • for including forked repositories in the generated statistic visualizations
      • false by default
    • enter Value in the following format:
    • examples:
      • true
  • Secret Name EXCLUDE_CONTRIB_REPOS
    • for excluding repositories (pull request) contributed to in the generated statistic visualizations
      • false by default
    • enter Value in the following format:
    • examples:
      • true
  • Secret Name EXCLUDE_ARCHIVE_REPOS
    • for excluding archived repositories in the generated statistic visualizations
      • false by default
    • enter Value in the following format:
    • examples:
      • true
  • Secret Name EXCLUDE_PRIVATE_REPOS
    • for excluding private repositories in the generated statistic visualizations
      • false by default
    • enter Value in the following format:
    • examples:
      • true
  • Secret Name EXCLUDE_PUBLIC_REPOS
    • for excluding public repositories in the generated statistic visualizations
      • false by default
    • enter Value in the following format:
    • examples:
      • true
  • Secret Name MORE_REPOS
    • for including repositories that are otherwise not included in the generated statistic visualizations
      • such as imported repositories with contributions
    • enter Value in the following format (separated by commas):
      • [owner/repo],[owner/repo],...,[owner/repo]
    • example:
      • R055A/GitStats,R055A/R055A
  • Secret Name MORE_COLLABS
    • for adding a constant value to the generated repository collaborators statistic
      • such as for collaborators that are otherwise not represented
    • enter Value in the following format:
    • example:
      • 4
  • Secret Name STORE_REPO_CLONES
    • for storing generated repository clone statistic visualization data beyond the 14 day-limit GitHub API allows
      • true by default
    • enter Value in the following format:
    • examples:
      • false
  • Secret Name STORE_REPO_VIEWS
    • for storing generated repository view statistic visualization data beyond the 14 day-limit GitHub API allows
      • true by default
    • enter Value in the following format:
    • examples:
      • false
  • Secret Name REPO_VIEWS
    • for adding a constant value to the generated repository view statistics
      • such as for when the stored data is reset or when importing stat data from elsewhere
      • requires being removed within 14 days after the first workflow is run (with LAST_VIEWED)
      • requires corresponding LAST_VIEWED and FIRST_VIEWED Secrets
    • enter Value in the following format:
    • example:
      • 5000
  • Secret Name LAST_VIEWED
    • for updating the date the generated repository view statistics data is added to storage from
      • such as for when the stored data is reset or when importing stat data from elsewhere
      • requires being removed within 14 days after the first workflow is run (with REPO_VIEWS)
      • may require corresponding REPO_VIEWS and FIRST_VIEWED Secrets
    • enter Value in the following format:
      • YYYY-MM-DD
    • example:
      • 2020-10-01
  • Secret Name FIRST_VIEWED
    • for updating the 'as of' date the generated repository view statistics data is stored from
      • such as for when the stored data is reset or when importing stat data from elsewhere
      • may require corresponding REPO_VIEWS and LAST_VIEWED Secrets
    • enter Value in the following format:
      • YYYY-MM-DD
    • example:
      • 2021-03-31
  • Secret Name REPO_CLONES
    • for adding a constant value to the generated repository clone statistics
      • such as for when the stored data is reset or when importing stat data from elsewhere
      • requires being removed within 14 days after the first workflow is run (with LAST_CLONED)
      • requires corresponding LAST_CLONED and FIRST_CLONED Secrets
    • enter Value in the following format:
    • example:
      • 2500
  • Secret Name LAST_CLONED
    • for updating the date the generated repository clone statistics data is added to storage from
      • such as for when the stored data is reset or when importing stat data from elsewhere
      • requires being removed within 14 days after the first workflow is run (with REPO_CLONES)
      • may require corresponding REPO_CLONES and FIRST_CLONED Secrets
    • enter Value in the following format:
      • YYYY-MM-DD
    • example:
      • 2020-10-01
  • Secret Name FIRST_CLONED
    • for updating the 'as of' date the generated repository clone statistics data is stored from
      • such as for when the stored data is reset or when importing stat data from elsewhere
      • may require corresponding REPO_CLONES and LAST_CLONED Secrets
    • enter Value in the following format:
      • YYYY-MM-DD
    • example:
      • 2021-04-01

Support the Project

There are a few things you can do to support the project:

  • Star the repository (and follow me and/or jstrieb on GitHub for more)
  • Share and upvote on sites
  • Report any bugs, glitches, or errors that you find
  • Spare a donation to a worthy cause

Related Projects

Lightning fast and portable programming language!

Photon Documentation in English Lightning fast and portable programming language! What is Photon? Photon is a programming language aimed at filling th

William 58 Dec 27, 2022
Fastapi strawberry graphql

fastapi-strawberry-graphql Quick and dirty 🍓 python python --version Python 3.10 pip pip install sqlalchemy pip install sqlmodel pip install fastapi

Rodrigo Ney 7 Oct 19, 2022
Gerenciar a velocidade da internet banda larga

Monitoramento da Velocidade da internet 📶 Status do Projeto: ✔️ (pronto) Tópicos ✍️ Descrição do projeto Funcionalidades Deploy da Aplicação Pré-requ

Bárbara Guerbas de Figueiredo 147 Nov 02, 2022
Generate a FullStack Playground using GraphQL and FastAPI 🚀

FastQL - FastAPI GraphQL Playground Generate a FullStack playground using FastAPI and GraphQL and Ariadne 🚀 . This Repository is based on this Articl

OBytes 109 Dec 23, 2022
A library to help construct a graphql-py server supporting react-relay

Relay Library for GraphQL Python GraphQL-relay-py is the Relay library for GraphQL-core. It allows the easy creation of Relay-compliant servers using

GraphQL Python 143 Nov 15, 2022
graphw00f is Server Engine Fingerprinting utility for software security professionals looking to learn more about what technology is behind a given GraphQL endpoint.

graphw00f - GraphQL Server Fingerprinting graphw00f (inspired by wafw00f) is the GraphQL fingerprinting tool for GQL endpoints. Table of Contents How

Dolev Farhi 282 Jan 04, 2023
ReplAPI.it A Simple and Complete Replit API Package

Notice: Currently this project is just a framework. It does not work yet. If you want to get updated when 1.0.0 is released, then click Watch - Custo

The ReplAPI.it Project 10 Jun 05, 2022
Django Project with Rest and Graphql API's

Django-Rest-and-Graphql # 1. Django Project Setup With virtual environment: mkdir {project_name}. To install virtual Environment sudo apt-get install

Shubham Agrawal 5 Nov 22, 2022
A python graphql api, which serves ECB currency rates from last 90 days.

Exchange Rate Api using GraphQL Get Code git pull https://github.com/alaturqua/exchangerate-graphql.git Create .env file with following content and s

Isa 1 Nov 04, 2021
tartiflette-aiohttp is a wrapper of aiohttp which includes the Tartiflette GraphQL Engine, do not hesitate to take a look of the Tartiflette project.

tartiflette-aiohttp is a wrapper of aiohttp which includes the Tartiflette GraphQL Engine. You can take a look at the Tartiflette API documentation. U

tartiflette 60 Nov 08, 2022
(Now finding maintainer) 🐍A Pythonic way to provide JWT authentication for Flask-GraphQL

Flask-GraphQL-Auth What is Flask-GraphQL-Auth? Flask-GraphQL-Auth is JWT decorator for flask-graphql inspired from Flask-JWT-Extended. all you have to

Seonghyeon Kim 64 Feb 19, 2022
A real time webchat made in graphql

Graphql Chat. This is a real time webchat made in graphql. Description Welcome to my webchat api, here i put my knowledge in graphql to work. Requirem

Nathan André 1 Jan 03, 2022
UltraGraphQL - a GraphQL interface for querying and modifying RDF data on the Web.

UltraGraphQL - cloned from https://git.rwth-aachen.de/i5/ultragraphql Updated or extended files: build.gradle: updated maven to use maven {url "https:

DrSnowbird 1 Jan 07, 2023
Blazing fast GraphQL endpoints finder using subdomain enumeration, scripts analysis and bruteforce.

Graphinder Graphinder is a tool that extracts all GraphQL endpoints from a given domain. Run with docker docker run -it -v $(pwd):/usr/bin/graphinder

Escape 76 Dec 28, 2022
A Python 3.6+ port of the GraphQL.js reference implementation of GraphQL.

GraphQL-core 3 GraphQL-core 3 is a Python 3.6+ port of GraphQL.js, the JavaScript reference implementation for GraphQL, a query language for APIs crea

GraphQL Python 458 Dec 13, 2022
This is a graphql api build using ariadne python that serves a graphql-endpoint at port 3002 to perform language translation and identification using deep learning in python pytorch.

Language Translation and Identification this machine/deep learning api that will be served as a graphql-api using ariadne, to perform the following ta

crispengari 2 Dec 30, 2021
Python script to like all posts from a selected Anilist profile

AniLiker: A python autoliker What's the point of this project? This project was a way to learn GraphQL, and also create a project that I've been inter

Iván Pérez 9 Nov 25, 2022
This is a minimal project using graphene with django and user authentication to expose a graphql endpoint.

Welcome This is a minimal project using graphene with django and user authentication to expose a graphql endpoint. Definitely checkout how I have mana

yosef salmalian 1 Nov 18, 2021
Django GraphQL To Do List Application

Django GraphQL Simple ToDo HOW TO RUN just run the following instructions: python -m venv venv pip install -r requirements.txt source venv/bin/activat

pedram shahsafi 1 Nov 13, 2021
GraphQL Engine built with Python 3.6+ / asyncio

Tartiflette is a GraphQL Server implementation built with Python 3.6+. Summary Motivation Status Usage Installation Installation dependencies Tartifle

tartiflette 839 Dec 31, 2022