{"id":20634370,"url":"https://github.com/bcongdon/github_contributions","last_synced_at":"2025-06-13T15:04:33.182Z","repository":{"id":57434562,"uuid":"97131907","full_name":"bcongdon/github_contributions","owner":"bcongdon","description":":octocat: A Python interface for Github's contribution system","archived":false,"fork":false,"pushed_at":"2021-03-31T02:10:08.000Z","size":176,"stargazers_count":7,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T00:12:00.501Z","etag":null,"topics":["api-client","api-wrapper","github","github-api","python","python-library"],"latest_commit_sha":null,"homepage":"","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/bcongdon.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":null,"security":null,"support":null}},"created_at":"2017-07-13T14:29:44.000Z","updated_at":"2023-12-05T15:32:26.000Z","dependencies_parsed_at":"2022-08-27T23:11:23.621Z","dependency_job_id":null,"html_url":"https://github.com/bcongdon/github_contributions","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcongdon%2Fgithub_contributions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcongdon%2Fgithub_contributions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcongdon%2Fgithub_contributions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcongdon%2Fgithub_contributions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcongdon","download_url":"https://codeload.github.com/bcongdon/github_contributions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249139427,"owners_count":21219073,"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":["api-client","api-wrapper","github","github-api","python","python-library"],"created_at":"2024-11-16T14:25:04.685Z","updated_at":"2025-04-15T19:36:04.929Z","avatar_url":"https://github.com/bcongdon.png","language":"Python","readme":"# github_contributions\n:octocat: A Python interface for Github's user contribution system\n\n[![Build Status](https://travis-ci.org/bcongdon/github_contributions.svg?branch=master)](https://travis-ci.org/bcongdon/github_contributions)\n[![Documentation Status](https://readthedocs.org/projects/github-contributions/badge/?version=latest)](http://github-contributions.readthedocs.io/en/latest/?badge=latest)\n[![PyPI version](https://badge.fury.io/py/GithubContributions.svg)](https://badge.fury.io/py/GithubContributions)\n[![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license)\n\n```python\n\u003e\u003e\u003e from github_contributions import GithubUser\n\u003e\u003e\u003e user = GithubUser('bcongdon')\n\u003e\u003e\u003e print(user.contributions().today())\nDay(date=datetime.date(2017, 7, 15), count=2, level=1)\n```\n\n## Installation\n\n```sh\n$ pip install githubcontributions\n$ python\n\u003e\u003e\u003e import github_contributions\n```\n\n## Why github_contributions?\n\nThe Github Data API does not provide data on the contribution graphs for users. While you can get fine-grained details on the stats of specific repositories, there is not currently an API for a user's overall contributions.\n\nCalculating a user's contributions by aggregating their repositories is expensive, and can require a prohibitive number of API calls. `github_contributions` can fetch an entire year of contribution data in 1 request.\n\n`github_contributions` exposes user contribution data (i.e. the sum of commits, issues created, and PRs reviewed per day), and also exposes Github's 'contribution level' data (the colors displayed on the contribution graph).\n\n## Basic Usage\n\n### Getting a User's Contribution History\n\n``` python\nfrom github_contributions import GithubUser\n\nuser = GithubUser('bcongdon')\ncontribs = user.contributions()\n\nprint(contribs.days[0])\n# Day(date=datetime.date(2016, 7, 10), count=6, level=1)\n\ncontribs_2016 = user.contributions(start_date='2016-01-01', end_date='2016-12-31')\nprint(sum([day.count for day in contribs_2016.days]))\n# 1509\n```\n\n### Getting a User's Current Streak\n``` python\nfrom github_contributions import GithubUser\n\nuser = GithubUser('bcongdon')\nstreak = user.current_streak()\nprint(len(streak))\n# 501\n\nprint(streak[0].date)\n# 2016-03-02)\n```\n\n### Getting a User's Past Streaks\n``` python\nfrom github_contributions import GithubUser\n\nuser = GithubUser('sindresorhus')\ncontributions = user.contributions()\nstreaks = contributions.streaks()\n\nprint(len(streaks))\n# 30\n\nprint(streaks[-1][0].date)\n# 2017-07-15\n```\n\n## Documentation\n\nRead more about the github_contributions API on the [ReadTheDocs](https://github-contributions.readthedocs.io) page.\n\n## Projects that use github_contributions\n\n`github_contributions` is used in the following projects. If you have a project that does something neat with this library, submit a PR or send me a message to be added to this list. 😀\n\n* [git-trophy](https://github.com/bcongdon/git-trophy) - Create a 3D Printed Model of Your Github Contributions\n\n## Contributing\n\nContributions to `github_contributions` are welcomed! 😁\n\n1. Fork the repo.\n2. Create a new feature branch.\n3. Add your feature / make your changes.\n4. Install [tox](https://tox.readthedocs.io/) (`pip install tox`) and run `tox` in a terminal window to run the test and linting suite.\n5. Create a PR.\n6. ???\n7. 🎉 Profit. 🎉\n\n## Attribution\n\nInspired by akerl's [githubstats](https://github.com/akerl/githubstats) Ruby gem\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcongdon%2Fgithub_contributions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcongdon%2Fgithub_contributions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcongdon%2Fgithub_contributions/lists"}