{"id":18358982,"url":"https://github.com/ev2900/github_insigths_history","last_synced_at":"2025-09-08T00:45:01.550Z","repository":{"id":85139169,"uuid":"590966062","full_name":"ev2900/GitHub_Insigths_History","owner":"ev2900","description":"Script to collect GitHub repository views and unique visits","archived":false,"fork":false,"pushed_at":"2025-08-07T19:32:28.000Z","size":1627,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-07T21:21:00.030Z","etag":null,"topics":["github","metrics","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ev2900.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-19T16:19:26.000Z","updated_at":"2025-08-07T19:32:31.000Z","dependencies_parsed_at":"2024-01-06T21:27:34.353Z","dependency_job_id":"3a567acc-ae02-46d4-aa85-e08e31803ede","html_url":"https://github.com/ev2900/GitHub_Insigths_History","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ev2900/GitHub_Insigths_History","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ev2900%2FGitHub_Insigths_History","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ev2900%2FGitHub_Insigths_History/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ev2900%2FGitHub_Insigths_History/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ev2900%2FGitHub_Insigths_History/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ev2900","download_url":"https://codeload.github.com/ev2900/GitHub_Insigths_History/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ev2900%2FGitHub_Insigths_History/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274117523,"owners_count":25225104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","metrics","python"],"created_at":"2024-11-05T22:20:17.503Z","updated_at":"2025-09-08T00:45:01.540Z","avatar_url":"https://github.com/ev2900.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Insights History\n\nGitHub provides insights for repositories including page views and unique visitor counts. GitHub only provides 2 weeks of history for these metrics\n\nThe script [metric_collection.py](https://github.com/ev2900/GitHub_Insigths_History/blob/main/Metric_Collection/metric_collection.py) in this repository collect and store these metrics (page views and unique visitor counts) for all of a given GitHub user's repositories. Storing these metrics outside of GitHub allows a user to retain a longer history for page views and unique visitor counts metrics\n\n## Summary of My Repository Data\n\nTo view the historic data of views for my repositories check out [views.csv](https://github.com/ev2900/GitHub_Insigths_History/blob/main/Metric_Collection/Metric_Data/views.csv) for unique visits check out [unique_visits.csv](https://github.com/ev2900/GitHub_Insigths_History/blob/main/Metric_Collection/Metric_Data/unique_visits.csv)\n\nOr the table below summarizes views and unique visits per month for all of my repositories\n\n| Month - Year | # of Views | # of Unique Visits |\n| ------------ | ---------- | ------------------ |\n| 2023-01 | 1615 | 452 |\n| 2023-02 | 2051 | 644 |\n| 2023-03 | 2219 | 780 |\n| 2023-04 | 2774 | 727 |\n| 2023-05 | 2651 | 638 |\n| 2023-06 | 2541 | 769 |\n| 2023-07 | 2530 | 706 |\n| 2023-08 | 3448 | 856 |\n| 2023-09 | 3860 | 916 |\n| 2023-10 | 3818 | 953 |\n| 2023-11 | 2786 | 888 |\n| 2023-12 | 4982 | 1032 |\n| 2024-01 | 4409 | 912 |\n| 2024-02 | 3177 | 1025 |\n| 2024-03 | 3985 | 1273 |\n| 2024-04 | 3713 | 1248 |\n| 2024-05 | 4140 | 1364 |\n| 2024-06 | 3637 | 1528 |\n| 2024-07 | 1813 | 681 |\n| 2024-08 | 3397 | 1383 |\n| 2024-09 | 3540 | 1326 |\n| 2024-10 | 3472 | 1610 |\n| 2024-11 | 1973 | 1113 |\n| 2024-12 | 1522 | 795 |\n| 2025-01 | 2241 | 1178 |\n| 2025-02 | 1833 | 1091 |\n| 2025-03 | 2083 | 1145 |\n| 2025-04 | 1545 | 793 |\n| 2025-05 | 1654 | 905 |\n| 2025-06 | 1762 | 934 |\n| 2025-07 | 1086 | 630 |\n| 2025-07 | 0000 | 000 |\n| **Total** | **86257** | **30295** |\n\n## How to Set this up for your GitHub\n\n1. Set up a personal access token\n\nThe script that collects the number of page views and unique visitors requires push access to see the traffic statistics for each repository. The script in this project uses a GitHub person access token to authenticate\n\nTo generate a person access token go to [Settings](https://github.com/settings/profile) -\u003e [Developer settings](https://github.com/settings/apps) -\u003e [Personal access tokens](https://github.com/settings/tokens) -\u003e [Tokens classic](https://github.com/settings/tokens)\n\nTo make it easy you can select the repo permissions\n\n\u003cimg width=\"500\" alt=\"token_creation\" src=\"https://github.com/ev2900/GitHub_Insigths_History/blob/main/README/token_creation.png\"\u003e\n\nAfter you create the person access token create a file with the name *token.txt* then copy and past the value of the person access token from GitHub into this file. Save the file in *Metric_Collection* folder\n\n2. Install required libraries\n\nThe python script requires the following non-standard libraries: requests, pandas. If you do not already have them installed install them via\n\n```pip install requests``` \u003cbr\u003e\n```pip install pandas```\n\n3. Configure the output data files\n\nThe results of the python script will be directed to [unique_visits.csv](https://github.com/ev2900/GitHub_Insigths_History/blob/main/Metric_Collection/Metric_Data/unique_visits.csv) and [views.csv](https://github.com/ev2900/GitHub_Insigths_History/blob/main/Metric_Collection/Metric_Data/views.csv) in the *Metric_Collection* folder\n\nWhen you clone, download ... this repository these CSV files have data in them w/r to my repositories. Delete all of the columns and rows except for first row of the first column\n\nThe excel file should look like the following before the first run\n\n\u003cimg width=\"300\" alt=\"blank_excel\" src=\"https://github.com/ev2900/GitHub_Insigths_History/blob/main/README/blank_excel.png\"\u003e\n\n4. Update the python script\n\nIn the [metric_collection.py](https://github.com/ev2900/GitHub_Insigths_History/blob/main/Metric_Collection/metric_collection.py) update ```git_hub_user_name = \u003cGitHub user name ex. ev2900\u003e``` with your GitHub username and save the file\n\n5. Run the python script\n\nTo run the python script on the command line run ```python metric_collection.py```\n\n6. Schedule the python script\n\nNow that everything is set up you will want to repeat step #5 at least every two weeks. GitHub insights only keeps two weeks of historic data. Running the script at least every two weeks ensures you are storing longer durations of these statistics in the csv files\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fev2900%2Fgithub_insigths_history","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fev2900%2Fgithub_insigths_history","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fev2900%2Fgithub_insigths_history/lists"}