You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Michael R. Crusoe edited this page Feb 2, 2023
·
2 revisions
To use: pip install ghapi and update the date below.
If you exceed the rate limit, then make a GitHub personal access token, which is a secret code used to access your account. If you don’t have one, click here to create one. You’ll be asked to enter a name – choose anything you like, for instance “ghapi”.
Example usage: python3 changelog.py > changelog.txt
#!/usr/bin/python3fromghapi.allimportGhApiimportsysimportosgithub_token=''# os.environ['GITHUB_TOKEN']date=2021-02-04# Only show commits after the given time.# This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: YYYY-MM-DDTHH:MM:SSZ# https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#list-commitsapi=GhApi(owner='simd-everywhere', repo='simde', token=github_token)
page=0whileTrue:
page+=1print(f"Page #{page}.", file=sys.stderr)
commits=api.repos.list_commits(since="2021-02-04",per_page=100, page=page)
iflen(commits) <1:
breakforcommitincommits:
summary=commit.commit.message.split('\n')[0]
author=commit.author.loginifcommit.authorelse"????"print(f"{summary}{commit.sha[0:7]} @{author}")