I am attempting to use the pyGithub library for accessing v3 API of github. Although this library is simple to use. I found the documentation to be very vague.
Below I am successfully getting the contents of a file with the file path and its sha. My end goal is to reduce my API calls from 3 to just 1, since I want to make use of the full 5000 API calls within the hour.
from github import Github
gh = Github(access_token) # I supply an access token here.
user = gh.get_user(owner_name) # This takes 1 API call
repo = user.get_repo(repo_name) # This takes 1 API call
file = repo.get_file_contents(filename, ref=sha) # This takes 1 API call
Does anyone know how I can pass the repo and owner name to get_file_contents() or a similar function I can use to achieve this?
Any help is appreciated.