Convert Figma logo to code with AI

jstrieb logogithub-stats

Better GitHub statistics images for your profile, with stats from private repos too

2,875
612
2,875
44

Top Related Projects

:zap: Dynamically generated stats for your github readmes

13,445

📊 An infographics generator with 30+ plugins and 300+ options to display stats about your GitHub account and render them as SVG, Markdown, PDF or JSON!

🏆 Add dynamically generated GitHub Stat Trophies on your readme

🔥 Stay motivated and show off your contribution streak! 🌟 Display your total contributions, current streak, and longest streak on your GitHub profile README

A tool to generate your github summary card for profile README

It counts how many times your GitHub profile has been viewed. Free cloud micro-service.

Quick Overview

GitHub Stats is a project that generates GitHub stats cards for your profile README. It creates customizable SVG images displaying various statistics about your GitHub activity, including top languages, commit frequency, and star counts. The project aims to provide an easy way to showcase your GitHub contributions and activity in a visually appealing manner.

Pros

  • Highly customizable, allowing users to tailor the appearance of their stats cards
  • Automatically updates stats, ensuring the displayed information is always current
  • Supports both light and dark themes to match different README styles
  • Easy to integrate into GitHub profile READMEs with minimal setup

Cons

  • Requires setting up a GitHub Actions workflow, which may be challenging for some users
  • Limited to displaying GitHub-specific statistics only
  • May not accurately represent all contributions, especially for users who work on private repositories
  • Can potentially slow down the loading of profile READMEs due to external image generation

Getting Started

To use GitHub Stats in your profile README:

  1. Fork the jstrieb/github-stats repository.
  2. Go to the "Actions" tab in your forked repository and enable workflows.
  3. Edit the README.md file in your fork, replacing jstrieb with your GitHub username:
![](https://raw.githubusercontent.com/your-username/github-stats/master/generated/overview.svg#gh-dark-mode-only)
![](https://raw.githubusercontent.com/your-username/github-stats/master/generated/overview.svg#gh-light-mode-only)

![](https://raw.githubusercontent.com/your-username/github-stats/master/generated/languages.svg#gh-dark-mode-only)
![](https://raw.githubusercontent.com/your-username/github-stats/master/generated/languages.svg#gh-light-mode-only)
  1. Commit the changes and wait for the GitHub Action to generate your stats cards.
  2. Copy the markdown from step 3 into your profile README, replacing your-username with your actual GitHub username.

Competitor Comparisons

:zap: Dynamically generated stats for your github readmes

Pros of github-readme-stats

  • More customizable with themes, icons, and layout options
  • Provides dynamic cards for languages, stats, and top repositories
  • Easier to integrate with just a single line of markdown

Cons of github-readme-stats

  • Relies on external hosting, which may have uptime or performance issues
  • Limited to predefined card types and metrics

Code Comparison

github-readme-stats:

[![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra)](https://github.com/anuraghazra/github-readme-stats)

github-stats:

import github_stats
user = github_stats.GitHubUser("jstrieb")
print(user.to_str())

github-readme-stats offers a simpler integration with a single line of markdown, while github-stats requires Python code to generate statistics.

github-readme-stats focuses on visual representation with customizable cards, whereas github-stats provides more raw data and flexibility for custom processing.

github-stats allows for local generation and hosting of statistics, which can be beneficial for privacy and control, while github-readme-stats relies on external services.

Both projects aim to display GitHub statistics, but they cater to different use cases and levels of customization. The choice between them depends on the specific needs of the user, such as ease of integration, visual appeal, or data control.

13,445

📊 An infographics generator with 30+ plugins and 300+ options to display stats about your GitHub account and render them as SVG, Markdown, PDF or JSON!

Pros of metrics

  • More comprehensive and customizable, offering a wider range of metrics and visualizations
  • Supports multiple CI/CD platforms and can be integrated into various workflows
  • Actively maintained with frequent updates and a larger community

Cons of metrics

  • More complex setup and configuration process
  • Requires more resources to run due to its extensive features
  • Steeper learning curve for users new to GitHub metrics

Code comparison

metrics:

- uses: lowlighter/metrics@latest
  with:
    token: ${{ secrets.METRICS_TOKEN }}
    config_timezone: Europe/Paris
    plugin_languages: yes
    plugin_languages_ignored: html, css

github-stats:

- uses: jstrieb/github-stats@v1
  with:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    EXCLUDED_LANGS: html,css
    EXCLUDED_REPOS: jstrieb/github-stats

Both repositories provide GitHub statistics and visualizations, but metrics offers a more feature-rich and flexible solution at the cost of increased complexity. github-stats is simpler and easier to set up but has fewer customization options. The code comparison shows that metrics requires more configuration parameters, reflecting its broader range of features.

🏆 Add dynamically generated GitHub Stat Trophies on your readme

Pros of github-profile-trophy

  • Visually appealing trophies for GitHub profile achievements
  • Easy to customize and integrate into GitHub README
  • Provides a gamification aspect to GitHub contributions

Cons of github-profile-trophy

  • Limited to predefined trophy types and achievements
  • May not provide as detailed statistics as github-stats
  • Requires manual updates to keep trophies current

Code Comparison

github-profile-trophy:

[![trophy](https://github-profile-trophy.vercel.app/?username=ryo-ma)](https://github.com/ryo-ma/github-profile-trophy)

github-stats:

<a href="https://github.com/jstrieb/github-stats">
<img src="https://github.com/jstrieb/github-stats/blob/master/generated/overview.svg#gh-dark-mode-only" />
<img src="https://github.com/jstrieb/github-stats/blob/master/generated/languages.svg#gh-dark-mode-only" />
</a>

Summary

github-profile-trophy offers an eye-catching, gamified approach to showcasing GitHub achievements, making it ideal for users who want to add a fun element to their profile. It's easy to implement but limited in customization and detail.

github-stats, on the other hand, provides more comprehensive statistics and language breakdowns, making it better suited for users who want to display detailed information about their GitHub activity and coding preferences.

Both projects serve different purposes and can be used together to create a more comprehensive GitHub profile.

🔥 Stay motivated and show off your contribution streak! 🌟 Display your total contributions, current streak, and longest streak on your GitHub profile README

Pros of github-readme-streak-stats

  • Focuses specifically on GitHub contribution streaks, providing a visually appealing way to showcase consistency
  • Offers extensive customization options for colors, themes, and layout
  • Regularly updated with new features and improvements

Cons of github-readme-streak-stats

  • Limited to streak statistics, lacking broader GitHub activity metrics
  • Requires a separate service to generate and host the streak images

Code Comparison

github-readme-streak-stats:

def get_streak_count(contributions):
    streak = 0
    for day in contributions:
        if day.count > 0:
            streak += 1
        else:
            break
    return streak

github-stats:

def get_total_contributions(contributions):
    return sum(day.count for day in contributions)

The code snippets highlight the different focus areas of each project. github-readme-streak-stats calculates consecutive contribution days, while github-stats provides a broader overview of total contributions.

Both projects offer valuable insights into GitHub activity, with github-readme-streak-stats excelling in visualizing contribution streaks and github-stats providing a more comprehensive set of statistics. The choice between them depends on the specific metrics a user wants to highlight in their GitHub profile.

A tool to generate your github summary card for profile README

Pros of github-profile-summary-cards

  • Offers a wider variety of visual cards and statistics
  • Provides language-specific contribution graphs
  • Easier to customize and configure through a YAML file

Cons of github-profile-summary-cards

  • Requires more setup and configuration
  • May have a steeper learning curve for beginners
  • Limited to predefined card types and layouts

Code Comparison

github-profile-summary-cards:

name: GitHub-Profile-Summary-Cards
on:
  schedule:
    - cron: "0 0 * * *"
  workflow_dispatch:
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: vn7n24fzkq/github-profile-summary-cards@release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

github-stats:

name: Generate Stats Images
on:
  schedule:
    - cron: "0 0 * * 0"
  workflow_dispatch:
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: jstrieb/github-stats@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Both projects use GitHub Actions to generate statistics, but github-profile-summary-cards offers more customization options through its YAML configuration. github-stats has a simpler setup but provides fewer visual options. The choice between the two depends on the user's preference for customization versus simplicity.

It counts how many times your GitHub profile has been viewed. Free cloud micro-service.

Pros of github-profile-views-counter

  • Simple setup with minimal configuration required
  • Provides a real-time count of profile views
  • Easily customizable badge design

Cons of github-profile-views-counter

  • Limited to tracking profile views only
  • Doesn't provide detailed statistics or visualizations
  • May require external hosting for optimal performance

Code Comparison

github-profile-views-counter:

![](https://komarev.com/ghpvc/?username=your-github-username)

github-stats:

name: GitHub Stats
uses: jstrieb/github-stats@v1.0.0
with:
  USERNAME: ${{ github.repository_owner }}
  TOKEN: ${{ secrets.GITHUB_TOKEN }}

github-profile-views-counter focuses on providing a simple, easy-to-implement view counter for GitHub profiles. It offers a straightforward solution for users who want to display their profile view count without additional complexity.

On the other hand, github-stats provides a more comprehensive set of statistics and visualizations for GitHub profiles and repositories. It generates detailed graphs and charts, offering a broader overview of a user's GitHub activity and contributions.

While github-profile-views-counter excels in simplicity and ease of use, github-stats offers more in-depth analytics and visual representations of GitHub data. The choice between the two depends on the user's specific needs and desired level of detail in their GitHub profile statistics.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

GitHub Stats Visualization

Generate visualizations of GitHub user and repository statistics with GitHub Actions. Visualizations can include data for both private repositories, and for repositories you have contributed to, but do not own.

Generated images automatically switch between GitHub light theme and GitHub dark theme.

Background

When someone views a profile on GitHub, it is often because they are curious about a user's open source projects and contributions. Unfortunately, that user's stars, forks, and pinned repositories do not necessarily reflect the contributions they make to private repositories. The data likewise does not present a complete picture of the user's total contributions beyond the current year.

This project aims to collect a variety of profile and repository statistics using the GitHub API. It then generates images that can be displayed in repository READMEs, or in a user's Profile README.

Since the project runs on GitHub Actions, no server is required to regularly regenerate the images with updated statistics. Likewise, since the user runs the analysis code themselves via GitHub Actions, they can use their GitHub access token to collect statistics on private repositories that an external service would be unable to access.

Disclaimer

If the project is used with an access token that has sufficient permissions to read private repositories, it may leak details about those repositories in error messages. For example, the aiohttp library—used for asynchronous API requests—may include the requested URL in exceptions, which can leak the name of private repositories. If there is an exception caused by aiohttp, this exception will be viewable in the Actions tab of the repository fork, and anyone may be able to see the name of one or more private repositories.

Due to some issues with the GitHub statistics API, there are some situations where it returns inaccurate results. Specifically, the repository view count statistics and total lines of code modified are probably somewhat inaccurate. Unexpectedly, these values will become more accurate over time as GitHub caches statistics for your repositories. Additionally, repositories that were last contributed to more than a year ago may not be included in the statistics due to limitations in the results returned by the API.

For more information on inaccuracies, see issue #2, #3, and #13.

Installation

  1. Create a personal access token (not the default GitHub Actions token) using the instructions here. Personal access token must have permissions: read:user and repo. Copy the access token when it is generated – if you lose it, you will have to regenerate the token.
    • Some users are reporting that it can take a few minutes for the personal access token to work. For more, see #30.
  2. Create a copy of this repository by clicking here. Note: this is not the same as forking a copy because it copies everything fresh, without the huge commit history.
  3. Go to the "Secrets" page of your copy of the repository. If this is the README of your copy, click this link to go to the "Secrets" page. Otherwise, go to the "Settings" tab of the newly-created repository and go to the "Secrets" page (bottom left).
  4. Create a new secret with the name ACCESS_TOKEN and paste the copied personal access token as the value.
  5. It is possible to change the type of statistics reported by adding other repository secrets.
    • To ignore certain repos, add them (in owner/name format e.g., jstrieb/github-stats) separated by commas to a new secret—created as before—called EXCLUDED.
    • To ignore certain languages, add them (separated by commas) to a new secret called EXCLUDED_LANGS. For example, to exclude HTML and TeX you could set the value to html,tex.
    • To show statistics only for "owned" repositories and not forks with contributions, add an environment variable (under the env header in the main workflow) called EXCLUDE_FORKED_REPOS with a value of true.
    • These other values are added as secrets by default to prevent leaking information about private repositories. If you're not worried about that, you can change the values directly in the Actions workflow itself.
  6. Go to the Actions Page and press "Run Workflow" on the right side of the screen to generate images for the first time.
    • The images will be automatically regenerated every 24 hours, but they can be regenerated manually by running the workflow this way.
  7. Take a look at the images that have been created in the generated folder.
  8. To add your statistics to your GitHub Profile README, copy and paste the following lines of code into your markdown content. Change the username value to your GitHub username.
    ![](https://raw.githubusercontent.com/username/github-stats/master/generated/overview.svg#gh-dark-mode-only)
    ![](https://raw.githubusercontent.com/username/github-stats/master/generated/overview.svg#gh-light-mode-only)
    
    ![](https://raw.githubusercontent.com/username/github-stats/master/generated/languages.svg#gh-dark-mode-only)
    ![](https://raw.githubusercontent.com/username/github-stats/master/generated/languages.svg#gh-light-mode-only)
    
  9. Link back to this repository so that others can generate their own statistics images.
  10. Star this repo if you like it!

Support the Project

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

  • Star the repository (and follow me on GitHub for more)
  • Share and upvote on sites like Twitter, Reddit, and Hacker News
  • Report any bugs, glitches, or errors that you find

These things motivate me to to keep sharing what I build, and they provide validation that my work is appreciated! They also help me improve the project. Thanks in advance!

If you are insistent on spending money to show your support, I encourage you to instead make a generous donation to one of the following organizations. By advocating for Internet freedoms, organizations like these help me to feel comfortable releasing work publicly on the Web.

Related Projects