Skip to content

Commit

Permalink
use csv
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed Nov 10, 2024
1 parent 3cf96b8 commit e00f5ca
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tools/github-stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument("--pull-requests", action="store_true")
group.add_argument("--opened-pull-requests", action="store_true")

# Add more options
# group.add_argument('--other-stat', action='store_true')
Expand All @@ -50,7 +50,7 @@
)


def pull_requests(owner, repo):
def opened_pull_requests(owner, repo):

# Authentication
token = os.environ["GITHUB_TOKEN"]
Expand Down Expand Up @@ -101,10 +101,10 @@ def pull_requests(owner, repo):
k += datetime.timedelta(days=1)


if args.pull_requests:
if args.opened_pull_requests:
stats = dict()
print("repo", "date", "opened")
print(",".join(["repo", "date", "opened"]))
for repo in REPOS:
for date, opened in pull_requests("ecmwf", f"anemoi-{repo}"):
print(repo, date, opened)
for date, opened in opened_pull_requests("ecmwf", f"anemoi-{repo}"):
print(",".join(str(_) for _ in [repo, date, opened]))
exit(0)

0 comments on commit e00f5ca

Please sign in to comment.