Created
September 20, 2022 13:03
-
-
Save AndreVallestero/fa5b81e852f8a1028fcf32a40179e8b2 to your computer and use it in GitHub Desktop.
Count number of commits and unique contributors in the past year
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pydriller import Repository | |
from datetime import datetime | |
commits = 0 | |
contributors = set() | |
now = datetime.now().astimezone() | |
for commit in Repository('https://github.com/olive-editor/olive.git').traverse_commits(): | |
if ((now - commit.author_date).days > 365): continue | |
contributors.add(commit.author.email) | |
commits += 1 | |
contributors_count = len(contributors) | |
print(f"commits: {commits}\ncontributors: {contributors_count}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment