Skip to content

topics

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

ReposTopics

The repos.topics namespace.

add

add(owner: str, repo: str, topic: str) -> None

Add a topic to a repository.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
topic str

name of the topic to add

required

Returns:

Type Description
None

No content.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.
UnprocessableEntityError
  1. APIInvalidTopicsError is error format response to invalid topics.

Operation ID: repoAddTopic

list

list(owner: str, repo: str, *, page: int | None = None, limit: int | None = None) -> TopicName

Get list of topics that a repository has.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
page int | None

page number of results to return (1-based)

None
limit int | None

page size of results

None

Returns:

Type Description
TopicName

TopicNames.

Raises:

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

Operation ID: repoListTopics

remove

remove(owner: str, repo: str, topic: str) -> None

Delete a topic from a repository.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
topic str

name of the topic to delete

required

Returns:

Type Description
None

No content.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.
UnprocessableEntityError
  1. APIInvalidTopicsError is error format response to invalid topics.

Operation ID: repoDeleteTopic

update

update(owner: str, repo: str, *, topics: list[str] | None = None) -> None

Replace list of topics for a repository.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
topics list[str] | None

list of topic names

None

Returns:

Type Description
None

No content.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.
UnprocessableEntityError
  1. APIInvalidTopicsError is error format response to invalid topics.

Operation ID: repoUpdateTopics

AsyncReposTopics

The repos.topics namespace.

add

add(owner: str, repo: str, topic: str) -> None

Add a topic to a repository.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
topic str

name of the topic to add

required

Returns:

Type Description
None

No content.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.
UnprocessableEntityError
  1. APIInvalidTopicsError is error format response to invalid topics.

Operation ID: repoAddTopic

list

list(owner: str, repo: str, *, page: int | None = None, limit: int | None = None) -> TopicName

Get list of topics that a repository has.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
page int | None

page number of results to return (1-based)

None
limit int | None

page size of results

None

Returns:

Type Description
TopicName

TopicNames.

Raises:

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

Operation ID: repoListTopics

remove

remove(owner: str, repo: str, topic: str) -> None

Delete a topic from a repository.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
topic str

name of the topic to delete

required

Returns:

Type Description
None

No content.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.
UnprocessableEntityError
  1. APIInvalidTopicsError is error format response to invalid topics.

Operation ID: repoDeleteTopic

update

update(owner: str, repo: str, *, topics: list[str] | None = None) -> None

Replace list of topics for a repository.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
topics list[str] | None

list of topic names

None

Returns:

Type Description
None

No content.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.
UnprocessableEntityError
  1. APIInvalidTopicsError is error format response to invalid topics.

Operation ID: repoUpdateTopics