Skip to content

media

Accessed as client.repos.media; the async client mirrors it.

ReposMedia

The repos.media namespace.

get

get(owner: str, repo: str, filepath: str, *, ref: str | None = None) -> bytes

Get a file or it's LFS object from a repository.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
filepath str

filepath of the file to get

required
ref str | None

The name of the commit/branch/tag. Default the repository's default branch (usually master)

None

Returns:

Type Description
bytes

Returns raw file content.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: repoGetRawFileOrLFS

AsyncReposMedia

The repos.media namespace.

get

get(owner: str, repo: str, filepath: str, *, ref: str | None = None) -> bytes

Get a file or it's LFS object from a repository.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
filepath str

filepath of the file to get

required
ref str | None

The name of the commit/branch/tag. Default the repository's default branch (usually master)

None

Returns:

Type Description
bytes

Returns raw file content.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: repoGetRawFileOrLFS