API Module

Source: gitlab_overviewer.api.__init__.py

API subpackage for gitlab_overviewer.

Implements Specification: GitLab API Client §1-3, covering:

  • API client operations (§1)

  • Error handling (§3)

Provides the main API client and error models for interacting with GitLab’s REST API.

See also: gitlab_overviewer.api.client, gitlab_overviewer.api.errors

class gitlab_overviewer.api.GitLabClient[source]

Bases: object

Minimal GitLab API Client (sync, httpx).

__init__()[source]
_request(method, url, **kwargs)[source]

Perform method request with simple exponential back-off retry.

Retries are triggered for the following cases: * Network errors (connection errors, timeouts, etc.) * 429 (rate limit) * 5xx server errors (502/503/504 or any >=500)

Return type:

Response

close()[source]
fetch_file(project_id, path, ref='main')[source]
Return type:

str

list_groups()[source]

List all groups with pagination support.

Collates all pages and returns a complete list as required by specification.

Return type:

list[Group]

list_issues(project_id)[source]
Return type:

list[Issue]

list_projects(group_id, with_shared=False)[source]

List all projects for a group with pagination support.

If with_shared is True, also include projects shared with the group. Collates all pages and returns a complete list as required by specification.

Return type:

list[Project]

exception gitlab_overviewer.api.GitLabAPIError[source]

Bases: Exception

Base exception for GitLab API errors.

exception gitlab_overviewer.api.AuthenticationError[source]

Bases: GitLabAPIError

Raised for 401/403 responses.

exception gitlab_overviewer.api.NotFoundError[source]

Bases: GitLabAPIError

Raised for 404 responses.

exception gitlab_overviewer.api.RateLimitError[source]

Bases: GitLabAPIError

Raised for 429 responses or rate-limit headers.

api.errors

Source: gitlab_overviewer.api.errors.py

API error handling implementation.

Implements Specification: GitLab API Client §3, covering:

  • Error-to-exception mapping

  • HTTP status code handling

exception gitlab_overviewer.api.errors.GitLabAPIError[source]

Bases: Exception

Base exception for GitLab API errors.

exception gitlab_overviewer.api.errors.AuthenticationError[source]

Bases: GitLabAPIError

Raised for 401/403 responses.

exception gitlab_overviewer.api.errors.NotFoundError[source]

Bases: GitLabAPIError

Raised for 404 responses.

exception gitlab_overviewer.api.errors.RateLimitError[source]

Bases: GitLabAPIError

Raised for 429 responses or rate-limit headers.

api.client

Source: gitlab_overviewer.api.client.py

GitLab API client implementation.

Implements Specification: GitLab API Client §1-5, covering:

  • Endpoint responsibilities (§1)

  • Configuration and authentication (§2)

  • Error mapping (§3)

  • Retry strategy (§4)

  • Resource management (§5)

class gitlab_overviewer.api.client.GitLabClient[source]

Bases: object

Minimal GitLab API Client (sync, httpx).

__init__()[source]
list_groups()[source]

List all groups with pagination support.

Collates all pages and returns a complete list as required by specification.

Return type:

list[Group]

list_projects(group_id, with_shared=False)[source]

List all projects for a group with pagination support.

If with_shared is True, also include projects shared with the group. Collates all pages and returns a complete list as required by specification.

Return type:

list[Project]

fetch_file(project_id, path, ref='main')[source]
Return type:

str

list_issues(project_id)[source]
Return type:

list[Issue]

close()[source]
_request(method, url, **kwargs)[source]

Perform method request with simple exponential back-off retry.

Retries are triggered for the following cases: * Network errors (connection errors, timeouts, etc.) * 429 (rate limit) * 5xx server errors (502/503/504 or any >=500)

Return type:

Response