Skip to content

gitea.client

client

Client for Gitea API.

Classes

gitea.client.AsyncGitea

AsyncGitea(token: str | None = None, base_url: str = 'https://gitea.com')

Bases: Client

Asynchronous Gitea API client.

Initialize the asynchronous Gitea client.

Parameters:

Name Type Description Default
token str | None

The API token for authentication.

None
base_url str

The base URL of the Gitea instance.

'https://gitea.com'
Source code in src/gitea/client/async_gitea.py
def __init__(self, token: str | None = None, base_url: str = "https://gitea.com") -> None:
    """Initialize the asynchronous Gitea client.

    Args:
        token: The API token for authentication.
        base_url: The base URL of the Gitea instance.

    """
    super().__init__(token=token, base_url=base_url)
    self.session: ClientSession | None = None

    # Resource handlers
    self.issue = AsyncIssue(client=self)
    self.pull_request = AsyncPullRequest(client=self)
    self.repository = AsyncRepository(client=self)
    self.user = AsyncUser(client=self)

gitea.client.Gitea

Gitea(token: str | None = None, base_url: str = 'https://gitea.com')

Bases: Client

Synchronous Gitea API client.

Initialize the Gitea client.

Parameters:

Name Type Description Default
token str | None

The API token for authentication.

None
base_url str

The base URL of the Gitea instance.

'https://gitea.com'
Source code in src/gitea/client/gitea.py
def __init__(self, token: str | None = None, base_url: str = "https://gitea.com") -> None:
    """Initialize the Gitea client.

    Args:
        token: The API token for authentication.
        base_url: The base URL of the Gitea instance.

    """
    super().__init__(token=token, base_url=base_url)
    self.session: requests.Session | None = None

    # Resource handlers
    self.issue = Issue(client=self)
    self.pull_request = PullRequest(client=self)
    self.repository = Repository(client=self)
    self.user = User(client=self)