What do you find here?

  • Accessing the Bitbucket API v2.0.
  • Get the list of the repo with UUID.
  • Get the history of the commit with the committed author within the limit.
  • Sort and get the top committer.
  • List the number of commits per repository and total percentage share of commits for each author in JSON format.
  • Version – 1.0

How do I get set up?

  • Clone the repo
  • install python 3.5 and above
  • Dependencies package – requests, JSON, operator

How to run the python script

$ git clone https://github.com/ahamedyaserarafath/bitbucket_top_commiter.git
$ chmod +x bitBucketTopCommit.py
$ ./bitBucketTopCommit.py <team_name>    
  • team_name -> team name of bit bucket
  • top -> display names of at most TOP committers taking into account all git repositories of the team
  • limit -> at most LIMIT latest commits per repository.
$ ./bitBucketTopCommit.py devops_team_x 3 1
  • output:
            {
              "devops_team_x": {
                "Ahamed Yaser Arafath <ahamedyaserarafath@gmail.com>": {
                  "git_repos": {
                    "testing1": "1",
                    "testing2_repo": "1"
                  },
                  "total_commit_share_percentage": 100.0
                }
              }
            }

https://github.com/ahamedyaserarafath/bitbucket_top_commiter

GitHub Link, Please feel free to fork and use it

Categorized in:

Tagged in:

,