uw-ssec / tutorials

SSEC tutorials for various topics
https://uw-ssec-tutorials.readthedocs.io
BSD 3-Clause "New" or "Revised" License
4 stars 4 forks source link

chore: Verify Astropy GitHub Fetch Method uses GitHub Personal Access token #74

Closed anantmittal closed 4 months ago

IshikaKhandelwal commented 4 months ago

https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28

Fetching Astropy does not require using personal access token, since it is a public repo and can be fetched unauthorised. But the primary rate limit for unauthenticated requests is 60 requests per hour.

Using personal access token to fetch public repo increases the rate limit to 5000 requests per hour.

anantmittal commented 4 months ago

Fix:

response = requests.get(github_file_url, headers={ 'Accept': 'application/vnd.github.v3.raw', 'Authorization': f'token {ACCESS_TOKEN}' })