https://github.com/hollowman6/github-contribution
:octocat: Get Contribution History on Days for Specified Github Account. (获取指定Github账户的日贡献历史)
https://github.com/hollowman6/github-contribution
contribution github
Last synced: about 1 month ago
JSON representation
:octocat: Get Contribution History on Days for Specified Github Account. (获取指定Github账户的日贡献历史)
- Host: GitHub
- URL: https://github.com/hollowman6/github-contribution
- Owner: HollowMan6
- License: gpl-3.0
- Created: 2021-01-30T14:30:14.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-30T14:57:48.000Z (over 5 years ago)
- Last Synced: 2025-01-25T06:26:08.361Z (over 1 year ago)
- Topics: contribution, github
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# 获取指定Github账户的日贡献历史
[](../../graphs/commit-activity)

[](https://github.com/HollowMan6?tab=followers)
[](../../watchers)
[](../../stargazers)
[](../../network/members)
[](https://hollowman6.github.io/fund.html)
[](https://opensource.org/licenses/GPL-3.0/)
[](../../archive/master.zip)
[](https://lgtm.com/projects/g/HollowMan6/Github-Contribution/alerts/)
[](https://lgtm.com/projects/g/HollowMan6/Github-Contribution/context:python)
(English version is down below)
[Python库依赖](../../network/dependencies)
安装好Python3运行环境和依赖后,运行`python Github_Contribution.py`,输入Github账户信息,你就可以获得打印版的贡献信息。
另外,你还可以将[Github_Contribution.py](Github_Contribution.py)放到你的项目目录下,作为包导入:
```python
from Github_Contribution import GithubContributions
username = input("Github UserID: ")
github = GithubContributions(username)
```
类GithubContributions包含属性username,为用户ID;joinTime为Github账户创建日期,格式为`%Y-%m-%d`,为字符串类型;totalCount为总贡献数,整型数字;yearlyLeastContri和yearlyMaxContri分别为每年最小最大日贡献数,为字典类型,键为整型年份,值为整型的单日极值贡献数量。noContribution为list型,存放无贡献的日期;L1Contribution、L2Contribution、L3Contribution、L4Contribution分别存放第一、二、三、四级贡献的日期和具体贡献数量,为字典类型组成的list,单个字典中键date存放日期,count存放数量。
**警告**:
***仅供测试使用,不可用于任何非法用途!***
***对于使用本代码所造成的一切不良后果,本人将不负任何责任!***
# Get Contribution History on Days for Specified Github Account
[Python Dependencies](../../network/dependencies)
After installing the running environment and dependencies of Python3, run `python Add_Github_Contribution_History.py`, enter your Github user ID, you can get printed version of your contribution history on days.
In addition, you can put [Github_Contribution.py](Github_Contribution.py) in your project directory and import it as a package:
```python
from Github_Contribution import GithubContributions
username = input("Github UserID: ")
github = GithubContributions(username)
```
The class `GithubContributions` contains the attribute `username`, which is the user ID; `joinTime`, which is the creation date of GitHub account, in the format of `%Y-%m-%d`, which is the string type; `totalCount`, which is the total number of contributions in integer number; `yearlyLeastContri` and `yearlyMaxContri`, which separately stores the minimum and maximum daily number of contributions each year, and which is the dictionary type; the key, which is the integer year, and the value is the single day extreme number of contributions. `noContribution` is a list type, which stores the date of no contribution; `L1Contribution`, `L2Contribution`, `L3Contribution` and `L4Contribution` store the date and specific contribution quantity of the first, second, third and fourth level contribution respectively, which is a list of dictionary types, and in a single dictionary key date stores the date and count stores the quantity.
**Warning**:
***For TESTING ONLY, not for any ILLEGAL USE!***
***I will not be responsible for any adverse consequences caused by using this code.***