ghapi.repos#

class ghapi.repos.Repository(owner: str, name: str, conn: Optional[Connection] = None)[source]#

Implements a Repository object

>>> from ghapi.repos import Repository
>>> repo = Repository("frgfm", "torch-cam")
>>> repo.list_pulls()
Parameters
  • owner – GitHub login of the repository’s owner

  • name – name of the repository

  • conn – connection object

get_info() Dict[str, Any][source]#

Parses high-level information from the Repository

list_pulls(**kwargs: Any) List[int][source]#

List the pull requests of a repository.

Parameters

kwargs – query parameters of GitHub API

Returns

list of pull request numbers

get_content(file_path: str, **kwargs: Any) Dict[str, Any][source]#

Retrieve a file content from the repository.

Parameters
  • file_path – path to the file

  • kwargs

    query parameters of GitHub API

Returns

the file content payload

download_archive(ref: str) str[source]#

Generate a download link for the repository archive.

Parameters

ref – branch/tag reference

Returns

the download link