'Is there a way to get a list of all the releases in a GitHub repository?
I believe the PyGitHub libary can do this, but for the purposes of my project, I am calling the GitHub API directly with the requests library as I am caching the results of my API call with the requests-cache library.
According to the documentation for the per_page parameter, the maximum number of releases you can retrieve is 100, but if I am dealing with a repository with over 100, how can I still get a list of all of them? Example code below.
import requests
ACCESS_TOKEN = '<insert token>'
headers = {
'Authorization': 'token ' + ACCESS_TOKEN,
'Accept': 'application/vnd.github.v3+json'
}
response = requests.get('https://api.github.com/repos/{insert author}/{insert repository}/releases?per_page=100', headers={'Authorization': 'token ' + ACCESS_TOKEN})
print(response.json())
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
