Skip to content

users

Accessed as client.users; the async client mirrors it.

Users

The users namespace.

activities

activities: UsersActivities = UsersActivities(client)

following

following: UsersFollowing = UsersFollowing(client)

orgs

orgs: UsersOrgs = UsersOrgs(client)

tokens

tokens: UsersTokens = UsersTokens(client)

followers

followers(username: str, *, page: int | None = None, limit: int | None = None) -> Paginated[User]

List the given user's followers.

Parameters:

Name Type Description Default
username str

username of user

required
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[User]

UserList.

Raises:

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

Operation ID: userListFollowers

get

get(username: str) -> User

Get a user.

Parameters:

Name Type Description Default
username str

username of user to get

required

Returns:

Type Description
User

User.

Raises:

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

Operation ID: userGet

gpg_keys

gpg_keys(username: str, *, page: int | None = None, limit: int | None = None) -> Paginated[GPGKey]

List the given user's GPG keys.

Parameters:

Name Type Description Default
username str

username of user

required
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[GPGKey]

GPGKeyList.

Raises:

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

Operation ID: userListGPGKeys

heatmap

heatmap(username: str) -> list[UserHeatmapData]

Get a user's heatmap.

Parameters:

Name Type Description Default
username str

username of user to get

required

Returns:

Type Description
list[UserHeatmapData]

UserHeatmapData.

Raises:

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

Operation ID: userGetHeatmapData

keys

keys(
    username: str, *, fingerprint: str | None = None, page: int | None = None, limit: int | None = None
) -> Paginated[PublicKey]

List the given user's public keys.

Parameters:

Name Type Description Default
username str

username of user

required
fingerprint str | None

fingerprint of the key

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[PublicKey]

PublicKeyList.

Raises:

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

Operation ID: userListKeys

repos

repos(username: str, *, page: int | None = None, limit: int | None = None) -> Paginated[Repository]

List the repos owned by the given user.

Parameters:

Name Type Description Default
username str

username of user

required
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[Repository]

RepositoryList.

Raises:

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

Operation ID: userListRepos

search

search(
    *,
    q: str | None = None,
    uid: int | None = None,
    sort: Literal["oldest", "newest", "alphabetically", "reversealphabetically", "recentupdate", "leastupdate"]
    | None = None,
    page: int | None = None,
    limit: int | None = None,
) -> UserSearchResults

Search for users.

Parameters:

Name Type Description Default
q str | None

keyword

None
uid int | None

ID of the user to search for

None
sort Literal['oldest', 'newest', 'alphabetically', 'reversealphabetically', 'recentupdate', 'leastupdate'] | None

sort order of results

None
page int | None

page number of results to return (1-based)

None
limit int | None

page size of results

None

Returns:

Type Description
UserSearchResults

SearchResults of a successful search.

Operation ID: userSearch

starred

starred(username: str, *, page: int | None = None, limit: int | None = None) -> Paginated[Repository]

The repos that the given user has starred.

Parameters:

Name Type Description Default
username str

username of user

required
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[Repository]

RepositoryList.

Raises:

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

Operation ID: userListStarred

subscriptions

subscriptions(username: str, *, page: int | None = None, limit: int | None = None) -> Paginated[Repository]

List the repositories watched by a user.

Parameters:

Name Type Description Default
username str

username of the user

required
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[Repository]

RepositoryList.

Raises:

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

Operation ID: userListSubscriptions

AsyncUsers

The users namespace.

activities

following

orgs

tokens

followers

followers(username: str, *, page: int | None = None, limit: int | None = None) -> AsyncPaginated[User]

List the given user's followers.

Parameters:

Name Type Description Default
username str

username of user

required
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[User]

UserList.

Raises:

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

Operation ID: userListFollowers

get

get(username: str) -> User

Get a user.

Parameters:

Name Type Description Default
username str

username of user to get

required

Returns:

Type Description
User

User.

Raises:

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

Operation ID: userGet

gpg_keys

gpg_keys(username: str, *, page: int | None = None, limit: int | None = None) -> AsyncPaginated[GPGKey]

List the given user's GPG keys.

Parameters:

Name Type Description Default
username str

username of user

required
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[GPGKey]

GPGKeyList.

Raises:

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

Operation ID: userListGPGKeys

heatmap

heatmap(username: str) -> list[UserHeatmapData]

Get a user's heatmap.

Parameters:

Name Type Description Default
username str

username of user to get

required

Returns:

Type Description
list[UserHeatmapData]

UserHeatmapData.

Raises:

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

Operation ID: userGetHeatmapData

keys

keys(
    username: str, *, fingerprint: str | None = None, page: int | None = None, limit: int | None = None
) -> AsyncPaginated[PublicKey]

List the given user's public keys.

Parameters:

Name Type Description Default
username str

username of user

required
fingerprint str | None

fingerprint of the key

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[PublicKey]

PublicKeyList.

Raises:

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

Operation ID: userListKeys

repos

repos(username: str, *, page: int | None = None, limit: int | None = None) -> AsyncPaginated[Repository]

List the repos owned by the given user.

Parameters:

Name Type Description Default
username str

username of user

required
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[Repository]

RepositoryList.

Raises:

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

Operation ID: userListRepos

search

search(
    *,
    q: str | None = None,
    uid: int | None = None,
    sort: Literal["oldest", "newest", "alphabetically", "reversealphabetically", "recentupdate", "leastupdate"]
    | None = None,
    page: int | None = None,
    limit: int | None = None,
) -> UserSearchResults

Search for users.

Parameters:

Name Type Description Default
q str | None

keyword

None
uid int | None

ID of the user to search for

None
sort Literal['oldest', 'newest', 'alphabetically', 'reversealphabetically', 'recentupdate', 'leastupdate'] | None

sort order of results

None
page int | None

page number of results to return (1-based)

None
limit int | None

page size of results

None

Returns:

Type Description
UserSearchResults

SearchResults of a successful search.

Operation ID: userSearch

starred

starred(username: str, *, page: int | None = None, limit: int | None = None) -> AsyncPaginated[Repository]

The repos that the given user has starred.

Parameters:

Name Type Description Default
username str

username of user

required
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[Repository]

RepositoryList.

Raises:

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

Operation ID: userListStarred

subscriptions

subscriptions(username: str, *, page: int | None = None, limit: int | None = None) -> AsyncPaginated[Repository]

List the repositories watched by a user.

Parameters:

Name Type Description Default
username str

username of the user

required
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[Repository]

RepositoryList.

Raises:

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

Operation ID: userListSubscriptions