Skip to content

A Python script to fetch and analyze GitHub repository traffic data, including daily views, unique visitors, and top referrers with unique counts, using the GitHub API. ๐Ÿš€

License

Notifications You must be signed in to change notification settings

Gyakobo/github-repo-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Github Dashboard

image image image

Author: Andrew Gyakobo

Introduction

This project showcases a Dashboard that displays multiple repos and their number of views

Methodology

Before we start delving into progam let's first figure out how to run the script main.py.

Note

Don't forget to also setup the config.txt file with your user credentials(username and token).

Warning

Assuming you'd like to reuse this project for your own purposes kindly add the config.txt file into your .gitignore so that your private github key is not out there in the wild for the world to see.

The program would further go through all of your repositories and display the following setup:

The GitHub API only provides repository traffic data for the last 14 days in an aggregated form (total views and unique visitors), but it also includes detailed daily statistics within that 14-day window. To extract daily views, you can use the endpoint:

Repository: quadtree-image-compression
Views: 102 | Unique Views: 3
Repository: quadtree-image-compression
Date       | Views | Uniques
------------------------------
2024-12-14 |     3 |       1
2024-12-15 |    15 |       2
2024-12-16 |     7 |       1
2024-12-17 |     5 |       1
2024-12-18 |     5 |       1
2024-12-20 |    13 |       1
2024-12-22 |    17 |       1
2024-12-23 |    16 |       1
2024-12-25 |     3 |       1
2024-12-26 |     4 |       2
2024-12-27 |    14 |       1
------------------------------
Top Referrers:
Source               | Views | Uniques
----------------------------------------
github.com           |    69 |       3
com.linkedin.android |     4 |       1
linkedin.com         |     4 |       1
----------------------------------------

If you happen to have no views at all, you'd be shown the following:

Repository: anchor
Views: 0 | Unique Views: 0
No views
No referrer data available for anchor.

License

MIT

About

A Python script to fetch and analyze GitHub repository traffic data, including daily views, unique visitors, and top referrers with unique counts, using the GitHub API. ๐Ÿš€

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published