Skip to main content

Aggregate Github commit count by author and time.

Python: 3.7+

License: CC BY-NC-SA 4.0

GitHub Actions codecov

Requirement

  • Python 3.7+

  • Your own GitHub account

Install

pip install git+https://github.com/rocaz/aggregateGithubCommits

Usage

aggregateGithubCommits [-h] -r|–repo REPO [-a|–author AUTHOR] [-s|since SINCE] [-u|until UNTIL] [-p|–period {h,d,m,w}] [-t|–term TERM] [-f|–format {text,json,csv}] [-v]

-h, –help: show this help message and exit

-r REPO, –repo REPO: [Required] GitHub owner and repositry name. ex)‘github/covid-19-repo-data’

-a AUTHOR, –author AUTHOR: GitHub author name, default is all authors. ex)‘github’

-s SINCE, –since SINCE: since date in ISO format. ex) ‘2020-07-12’

-u UNTIL, –until UNTIL: until date in ISO format, default is today. ex)‘2020-07-12’

-p {h,d,m,w}, –period {h,d,m,w}: Aggregating period, default is ‘h’. ‘h’: per hour,‘d’: per day, ‘m’: per month, ‘w’: per day of week

-t TERM, –term TERM: Aggregating term from until, default is ‘3m’. ‘3m’ means ‘3months’, ‘100d’ means ‘100days’

-f {text,json,csv}, –format {text,json,csv}: Output format type, default is ‘text’.

-v, –version: show program’s version number and exit

Example

  1. Specified author. Default term is from now to 3months ago.

python ./aggregateGithubCommits.py -r "github/covid-19-repo-data" -a gregce

Output:

Repository: git://github.com/github/covid-19-repo-data.git
Total:      15
   Author:    gregce
        Hour    00    01    02    03    04    05    06    07    08    09    10    11    12    13    14    15    16    17    18    19    20    21    22    23
       Count       2     1     2     1     1     0     2     0     1     2     0     1     1     1     0     0     0     0     0     0     0     0     0     0
        AuthorTotal:        15
  1. The term is specified from ‘2020-02-29’ to ‘2020-08-02’, Aggregation period is ‘per month’.

python ./aggregateGithubCommits.py -r "github/covid-19-repo-data" -p m -u '2020-08-02' -s '2020-02-29'

Output:

Repository: git://github.com/github/covid-19-repo-data.git
Total:      49
   Author:    gregce
       Month    2020-03  2020-04  2020-05  2020-06  2020-07
       Count          0        5        4        4        7
        AuthorTotal:        20
   Author:    Ashikpaul
       Month    2020-03  2020-04  2020-05  2020-06  2020-07
       Count          0        0        0        0        1
        AuthorTotal:         1
   Author:    hamelsmu
       Month    2020-03  2020-04  2020-05  2020-06  2020-07
       Count          0       22        0        4        0
        AuthorTotal:        26
   Author:    github-actions[bot]
       Month    2020-03  2020-04  2020-05  2020-06  2020-07
       Count          0        1        0        0        0
        AuthorTotal:         1
   Author:    DJedamski
       Month    2020-03  2020-04  2020-05  2020-06  2020-07
       Count          1        0        0        0        0
        AuthorTotal:         1
  1. Output format is setted to JSON.

python ./aggregateGithubCommits.py -r "github/covid-19-repo-data" -f json

{"AggregatedCommits": {"gregce": {"00": 2, "01": 1, "02": 2, "03": 1, "04": 1, "06": 2, "08": 1, "09": 2, "11": 1, "12": 1, "13": 1}, "Ashikpaul": {"00": 0, "01": 0, "02": 1, "03": 0, "04": 0, "06": 0, "08": 0, "09": 0, "11": 0, "12": 0, "13": 0}, "hamelsmu": {"00": 0, "01": 0, "02": 4, "03": 0, "04": 0, "06": 0, "08": 0, "09": 0, "11": 0, "12": 0, "13": 0}}, "Period": "h", "CommitCount": 20, "Authors": ["gregce", "Ashikpaul", "hamelsmu"], "Indexes": ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23"]}
  1. Output format is setted to CSV.

python ./aggregateGithubCommits.py -r "github/covid-19-repo-data" -f csv

"","00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"
"gregce","2","1","2","1","1","0","2","0","1","2","0","1","1","1","0","0","0","0","0","0","0","0","0","0"
"Ashikpaul","0","0","1","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"
"hamelsmu","0","0","4","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"

Environment Variable

‘GITHUBTOKEN’

Plase set your Github Token

License

CC BY-NC-SA 4.0

image1

non-commercial use only.

Metadata

Release files for aggregateGithubCommits 3.20200806

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for aggregateGithubCommits 3.20200806
File Interpreter ABI Platform
aggregateGithubCommits-3.20200806-py3-none-any.whl Python 3 none any Details

Release files / aggregateGithubCommits-3.20200806-py3-none-any.whl

Download URL aggregateGithubCommits-3.20200806-py3-none-any.whl
Size 27.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d59988352bf8237d8fe2c61cd3c169f3da2b2d1bf2f9e481f5550d412f090864
BLAKE2b-256 checksum
How to use checksums
1f5e4bbc041f8dbc6e0d488b3e82d3d8a56754d249f1e6d25bcba3116d52e40b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.6

Release history Release notifications | RSS feed

This release

3.20200806 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page