{"id":18032226,"url":"https://github.com/msmygit/gh_contributors","last_synced_at":"2026-01-24T07:33:52.221Z","repository":{"id":258339474,"uuid":"866823994","full_name":"msmygit/gh_contributors","owner":"msmygit","description":"Fetches the contributors list from a GitHub org \u0026 repo and quickly creates a pie chart based on a parameter","archived":false,"fork":false,"pushed_at":"2024-10-16T17:34:09.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-10T06:30:39.707Z","etag":null,"topics":["contributors","github","pie-chart","python"],"latest_commit_sha":null,"homepage":"https://github.com/msmygit/msmygit","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msmygit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-02T23:52:38.000Z","updated_at":"2025-01-03T20:00:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"edd987e0-3f6e-4f9e-987a-5987ddafe27a","html_url":"https://github.com/msmygit/gh_contributors","commit_stats":null,"previous_names":["msmygit/gh_contributors"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msmygit%2Fgh_contributors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msmygit%2Fgh_contributors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msmygit%2Fgh_contributors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msmygit%2Fgh_contributors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msmygit","download_url":"https://codeload.github.com/msmygit/gh_contributors/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256081,"owners_count":20909240,"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","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":["contributors","github","pie-chart","python"],"created_at":"2024-10-30T10:12:44.772Z","updated_at":"2026-01-24T07:33:47.201Z","avatar_url":"https://github.com/msmygit.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Contributors\n- Fetches the contributors list from a GitHub org \u0026amp; repo combo and quickly creates a pie chart based on a parameter.\n- Using this script simplifies pulling a repo contribution, making the process more robust and improving the user experience.\n- GitHub has [default rate-limits](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28) for API calls in place and hence we use PAT tokens here. If you don't want to mess with tokens and want a more quick-and-dirty method, answers at [this stackoverflow post](https://stackoverflow.com/questions/9597410/list-all-developers-on-a-project-in-git) has it and one could do some manual steps with the data.\n\n\u003e [!IMPORTANT]\n\u003e This utility can only access [*non-anonymous* GitHub user profile](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-profile/customizing-your-profile/setting-your-profile-to-private) data.\n\n## Getting Started\n1. Preferably, create [a python virtual environment](https://packaging.python.org/en/latest/tutorials/installing-packages/#creating-virtual-environments) or skip this step if an environment is already available to run this.\n2. Install the recommended packages:\n   ```\n   sudo apt install python3-pip -y\n   pip3 install requests matplotlib urllib3\n   ```\n3. Get it going with `chmod +x ./gh_contributors.py \u0026\u0026 ./gh_contributors.py`\n4. There will be 3 files created, in case of a happy path:\n   - `\u003cGH_ORG\u003e_\u003cGH_REPO\u003e_contributors_\u003cYYYYMMDD\u003e.json` containing the contributor details.\n   - `\u003cGH_ORG\u003e_\u003cGH_REPO\u003e_login_details_\u003cYYYYMMDD\u003e.json` containing the contributor/user details from above data.\n   - `\u003cGH_ORG\u003e_\u003cGH_REPO\u003e_pie_chart_\u003cYYYYMMDD\u003e.png` containing a simple pie chart based on contributor distribution.\n\n\u003cdetails\u003e\n\u003csummary\u003eExpand/Collapse to view the steps to run this program in a non-interactive mode\u003c/summary\u003e\n\nFor those who prefer the non-interactive mode, set the below environment variables and run it with step 3 from above,\n```\nexport GH_TOKEN= (or) GITHUB_TOKEN=\u003cYour GitHub PAT token\u003e\nexport GH_ORG=\u003cGitHub Org\u003e\nexport GH_REPO=\u003cGitHub Repo\u003e\nexport USER_CHART_BASED_ON=\u003ca valid reponse parameter from https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#update-the-authenticated-user\u003e\n```\n\u003c/details\u003e\n\n## Things To Know\nThe GitHub PAT token needs to have access to an organization's repositories or else one will see an error as below in the JSON files,\n```\n{\"message\":\"Resource protected by organization SAML enforcement. You must grant your Personal Access token access to this organization.\",\"documentation_url\":\"https://docs.github.com/articles/authenticating-to-a-github-organization-with-saml-single-sign-on/\",\"status\":\"403\"}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsmygit%2Fgh_contributors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsmygit%2Fgh_contributors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsmygit%2Fgh_contributors/lists"}