Skip to content

labels

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

ReposLabels

The repos.labels namespace.

create

create(
    owner: str,
    repo: str,
    *,
    color: str,
    description: str | None = None,
    exclusive: bool | None = None,
    is_archived: bool | None = None,
    name: str,
) -> Label

Create a label.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
color str
required
description str | None
None
exclusive bool | None
None
is_archived bool | None
None
name str
required

Returns:

Type Description
Label

Label.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.

Operation ID: issueCreateLabel

delete

delete(owner: str, repo: str, id: int) -> None

Delete a label.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
id int

id of the label to delete

required

Returns:

Type Description
None

No content.

Raises:

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

Operation ID: issueDeleteLabel

get

get(owner: str, repo: str, id: int) -> Label

Get a single label.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
id int

id of the label to get

required

Returns:

Type Description
Label

Label.

Raises:

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

Operation ID: issueGetLabel

list

list(
    owner: str,
    repo: str,
    *,
    sort: Literal["mostissues", "leastissues", "reversealphabetically"] | None = None,
    page: int | None = None,
    limit: int | None = None,
) -> Paginated[Label]

Get all of a repository's labels.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
sort Literal['mostissues', 'leastissues', 'reversealphabetically'] | None

Specifies the sorting method: mostissues, leastissues, or reversealphabetically.

None
page int | None

1-based page to start iteration at.

None
limit int | None

Page size; the instance caps it server-side.

None

Returns:

Type Description
Paginated[Label]

LabelList.

Raises:

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

Operation ID: issueListLabels

update

update(
    owner: str,
    repo: str,
    id: int,
    *,
    color: str | None = None,
    description: str | None = None,
    exclusive: bool | None = None,
    is_archived: bool | None = None,
    name: str | None = None,
) -> Label

Update a label.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
id int

id of the label to edit

required
color str | None
None
description str | None
None
exclusive bool | None
None
is_archived bool | None
None
name str | None
None

Returns:

Type Description
Label

Label.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.

Operation ID: issueEditLabel

AsyncReposLabels

The repos.labels namespace.

create

create(
    owner: str,
    repo: str,
    *,
    color: str,
    description: str | None = None,
    exclusive: bool | None = None,
    is_archived: bool | None = None,
    name: str,
) -> Label

Create a label.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
color str
required
description str | None
None
exclusive bool | None
None
is_archived bool | None
None
name str
required

Returns:

Type Description
Label

Label.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.

Operation ID: issueCreateLabel

delete

delete(owner: str, repo: str, id: int) -> None

Delete a label.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
id int

id of the label to delete

required

Returns:

Type Description
None

No content.

Raises:

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

Operation ID: issueDeleteLabel

get

get(owner: str, repo: str, id: int) -> Label

Get a single label.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
id int

id of the label to get

required

Returns:

Type Description
Label

Label.

Raises:

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

Operation ID: issueGetLabel

list

list(
    owner: str,
    repo: str,
    *,
    sort: Literal["mostissues", "leastissues", "reversealphabetically"] | None = None,
    page: int | None = None,
    limit: int | None = None,
) -> AsyncPaginated[Label]

Get all of a repository's labels.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
sort Literal['mostissues', 'leastissues', 'reversealphabetically'] | None

Specifies the sorting method: mostissues, leastissues, or reversealphabetically.

None
page int | None

1-based page to start iteration at.

None
limit int | None

Page size; the instance caps it server-side.

None

Returns:

Type Description
AsyncPaginated[Label]

LabelList.

Raises:

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

Operation ID: issueListLabels

update

update(
    owner: str,
    repo: str,
    id: int,
    *,
    color: str | None = None,
    description: str | None = None,
    exclusive: bool | None = None,
    is_archived: bool | None = None,
    name: str | None = None,
) -> Label

Update a label.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
id int

id of the label to edit

required
color str | None
None
description str | None
None
exclusive bool | None
None
is_archived bool | None
None
name str | None
None

Returns:

Type Description
Label

Label.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.

Operation ID: issueEditLabel