Skip to content

repos

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

UserRepos

The user.repos namespace.

create

create(
    *,
    auto_init: bool | None = None,
    default_branch: str | None = None,
    description: str | None = None,
    gitignores: str | None = None,
    issue_labels: str | None = None,
    license: str | None = None,
    name: str,
    object_format_name: CreateRepoOptionObjectFormatName | None = None,
    private: bool | None = None,
    readme: str | None = None,
    template: bool | None = None,
    trust_model: CreateRepoOptionTrustModel | None = None,
) -> Repository

Create a repository.

Parameters:

Name Type Description Default
auto_init bool | None

Whether the repository should be auto-initialized?

None
default_branch str | None

DefaultBranch of the repository (used when initializes and in template)

None
description str | None

Description of the repository to create

None
gitignores str | None

Gitignores to use, separated by commas

None
issue_labels str | None

Label-Set to use

None
license str | None

License to use

None
name str

Name of the repository to create

required
object_format_name CreateRepoOptionObjectFormatName | None

ObjectFormatName of the underlying git repository

None
private bool | None

Whether the repository is private

None
readme str | None

Readme of the repository to create

None
template bool | None

Whether the repository is template

None
trust_model CreateRepoOptionTrustModel | None

TrustModel of the repository

None

Returns:

Type Description
Repository

Repository.

Raises:

Type Description
BadRequestError
  1. APIError is error format response.
UnauthorizedError
  1. APIUnauthorizedError is a unauthorized error response.
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
ConflictError
  1. The repository with the same name already exists.
PayloadTooLargeError
  1. QuotaExceeded.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.

Operation ID: createCurrentUserRepo

list

list(
    *,
    order_by: Literal[
        "name",
        "id",
        "newest",
        "oldest",
        "recentupdate",
        "leastupdate",
        "reversealphabetically",
        "alphabetically",
        "reversesize",
        "size",
        "reversegitsize",
        "gitsize",
        "reverselfssize",
        "lfssize",
        "moststars",
        "feweststars",
        "mostforks",
        "fewestforks",
    ]
    | None = None,
    page: int | None = None,
    limit: int | None = None,
) -> Paginated[Repository]

List the repos that the authenticated user owns.

Parameters:

Name Type Description Default
order_by Literal['name', 'id', 'newest', 'oldest', 'recentupdate', 'leastupdate', 'reversealphabetically', 'alphabetically', 'reversesize', 'size', 'reversegitsize', 'gitsize', 'reverselfssize', 'lfssize', 'moststars', 'feweststars', 'mostforks', 'fewestforks'] | None

order the repositories

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

RepositoryList.

Raises:

Type Description
UnauthorizedError
  1. APIUnauthorizedError is a unauthorized error response.
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.

Operation ID: userCurrentListRepos

AsyncUserRepos

The user.repos namespace.

create

create(
    *,
    auto_init: bool | None = None,
    default_branch: str | None = None,
    description: str | None = None,
    gitignores: str | None = None,
    issue_labels: str | None = None,
    license: str | None = None,
    name: str,
    object_format_name: CreateRepoOptionObjectFormatName | None = None,
    private: bool | None = None,
    readme: str | None = None,
    template: bool | None = None,
    trust_model: CreateRepoOptionTrustModel | None = None,
) -> Repository

Create a repository.

Parameters:

Name Type Description Default
auto_init bool | None

Whether the repository should be auto-initialized?

None
default_branch str | None

DefaultBranch of the repository (used when initializes and in template)

None
description str | None

Description of the repository to create

None
gitignores str | None

Gitignores to use, separated by commas

None
issue_labels str | None

Label-Set to use

None
license str | None

License to use

None
name str

Name of the repository to create

required
object_format_name CreateRepoOptionObjectFormatName | None

ObjectFormatName of the underlying git repository

None
private bool | None

Whether the repository is private

None
readme str | None

Readme of the repository to create

None
template bool | None

Whether the repository is template

None
trust_model CreateRepoOptionTrustModel | None

TrustModel of the repository

None

Returns:

Type Description
Repository

Repository.

Raises:

Type Description
BadRequestError
  1. APIError is error format response.
UnauthorizedError
  1. APIUnauthorizedError is a unauthorized error response.
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
ConflictError
  1. The repository with the same name already exists.
PayloadTooLargeError
  1. QuotaExceeded.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.

Operation ID: createCurrentUserRepo

list

list(
    *,
    order_by: Literal[
        "name",
        "id",
        "newest",
        "oldest",
        "recentupdate",
        "leastupdate",
        "reversealphabetically",
        "alphabetically",
        "reversesize",
        "size",
        "reversegitsize",
        "gitsize",
        "reverselfssize",
        "lfssize",
        "moststars",
        "feweststars",
        "mostforks",
        "fewestforks",
    ]
    | None = None,
    page: int | None = None,
    limit: int | None = None,
) -> AsyncPaginated[Repository]

List the repos that the authenticated user owns.

Parameters:

Name Type Description Default
order_by Literal['name', 'id', 'newest', 'oldest', 'recentupdate', 'leastupdate', 'reversealphabetically', 'alphabetically', 'reversesize', 'size', 'reversegitsize', 'gitsize', 'reverselfssize', 'lfssize', 'moststars', 'feweststars', 'mostforks', 'fewestforks'] | None

order the repositories

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

RepositoryList.

Raises:

Type Description
UnauthorizedError
  1. APIUnauthorizedError is a unauthorized error response.
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.

Operation ID: userCurrentListRepos