Package: githubV3py
OverviewA python3 API for accessing githubBuild StatusAuthenticationAccess tokens are generated by github at this linkhttps://github.com/settings/tokens/newInstallation$pipinstallgithubV3pyExamplesUsageghc=GitHubClient(token=githubtoken)ascii_art=ghc.MetaGetOctocat("Hello World").data.decode('utf-8')print(ascii_art)print(f"rate-limit remaining={ghc.rateLimitRemaining}")MMM.           .MMM
               MMMMMMMMMMMMMMMMMMM
               MMMMMMMMMMMMMMMMMMM      _____________
              MMMMMMMMMMMMMMMMMMMMM    |             |
             MMMMMMMMMMMMMMMMMMMMMMM   | Hello World |
            MMMMMMMMMMMMMMMMMMMMMMMM   |_   _________|
            MMMM::- -:::::::- -::MMMM    |/
             MM~:~ 00~:::::~ 00~:~MM
        .. MMMMM::.00:::+:::.00::MMMMM ..
              .MM::::: ._. :::::MM.
                 MMMM;:::::;MMMM
          -MM        MMMMMMM
          ^  M+     MMMMMMMMM
              MMMMMMM MM MM MM
                   MM MM MM MM
                   MM MM MM MM
                .~~MM~MM~MM~MM~~.
             ~~~~MM:~MM~~~MM~:MM~~~~
            ~~~~~~==~==~~~==~==~~~~~~
             ~~~~~~==~==~==~==~~~~~~
                 :~==~==~==~==~~

rate-limit remaining=4998GitHubClient MethodsGitHubClient MethodsPaginationMany of github's api calls return a collection of results as a list. For example:commits=ghc.ReposListCommits("owner","repo",per_page=30,page=1)ResposListCommitsreturns a list of commits for the specified repository.  However, it will only return the first 'per_page' entries.   To get the next set of commits, increment 'page' by 1.commits=ghc.ReposListCommits("owner","repo",per_page=30,page=2)Automatic PaginationGiven that in many cases all of a particular set of a data is desired, a convenient class method is provided for instance methods that do pagination:commits=GitHubClient.paginate(ghc.ReposListCommits,"owner","repo",pagination_limit=1000)The first parameter is the paginating instance method and the remaining parameters are the parameters you would supply the method if calling it discretely.   The optional 'pagination_limit' parameter can be specified to put a limit on the amount of data retrieved.  If not specified GitHubClient.paginate will attempt to retrieve every record.An 'extractor' method may be provided for responses that contain a list, as opposed to a list itself, for example:  GitHubClient.ActionsListArtifactsForRepo returns and instance of:classActionsListArtifactsForRepoSuccess(ResponseBase):def__init__(self,artifacts:list,total_count:int):ResponseBase.__init__(self)self._artifacts=artifactsself._total_count=total_countreturndef_getartifacts(self):returnself._artifactsand[entryandArtifact(**entry)forentryinself._artifacts]artifacts=property(_getartifacts)In order to paginate the result, the artifacts property must be extracted:fromoperatorimportattrgetterartifacts=GitHubClient.paginate(ghc.ActionsListArtifactsForRepo,owner,reponame,extractor=attrgetter('artifacts'))USE THIS METHOD WITH CAUTION.  Have some situational awareness of how much data you will be asking for.   Otherwise therate-limiton the authentication you're using could be fully consumed.To this end another method is provided that provides agenerator objectinstead.   Iterating over it will still appear as if it were one 'list' but the list is broken up into discrete queries, so that if you're scanning for something you can stop, without having to download the entire collection.forrepoinGitHubClient.generate(ghc.ReposListForAuthenticatedUser,type=None):print(f"{repo.name}")DownloadsSeveral methods download data(Build Artifacts, Logs, tarballs).   The data can be downloaded in several ways:Downloading all at oncedata=ghc.ActionsDownloadArtifact(owner,repository,artifact_id,'zip')Downloading in chunksThis is recommended for very large files.  Specify a 'chunk_size' to a size appropriate for your application.out=open(fname,"wb")forchunkinghc.ActionsDownloadArtifact(owner,repository,artifact_id,'zip',chunk_size=1024):out.write(chunk)Download URLurl=ghc.ActionsDownloadArtifact(owner,repsitory,artifact_id,'zip',fetch_url=True)url=urllib.parse.urlparse(url)Quick Rate Limit Check:python-c"import githubV3py ;  print(githubV3py.GitHubClient(token='_token_').RateLimitGet().rate.remaining)"TroubleshootingIntellisense not working in WingIDEIn order for intellisense to work under WingIDE, the 'main entry point' must import the githubV3py package or import another package/module that does.Corrective Action:right click the file you wish to execute in the 'Project' tab/tool and select "Set as Main Entry Point".