Skip to main content

forge-dashboard-sdk-python

CI PyPI Codecov License: MIT docs

A Python client for forge-dashboard's REST API, generated from its OpenAPI spec with openapi-python-client. It saves you from hand-rolling HTTP requests, auth and retries against the API yourself.

Requirements

  • Python 3.12 or later.
  • A running forge-dashboard instance.
  • A personal API token for that instance (see "Authentication" below) — every endpoint except health, get_version and the two webhook receivers needs one.

Installation

pip install forge-dashboard-sdk

Pin an exact version in your own pyproject.toml/requirements.txt rather than tracking the latest release in anything but a quick trial.

Authentication

forge-dashboard accepts either a browser's passkey session cookie or a personal API token — Authorization: Bearer <token> — as an alternative that needs no WebAuthn ceremony. This SDK only speaks the token half, the one a script can actually use. Mint one by signing into the dashboard once and calling POST /api/tokens, then pass it to ForgeDashboardClient or set FORGE_DASHBOARD_API_TOKEN in the environment:

import os
from forge_dashboard import ForgeDashboardClient

client = ForgeDashboardClient(
    "https://forge-dashboard.example.com",
    api_token=os.environ.get("FORGE_DASHBOARD_API_TOKEN"),
)

Usage

health and get_version need no token and are good first calls to prove the client reaches the server at all:

from forge_dashboard import ForgeDashboardClient

with ForgeDashboardClient("https://forge-dashboard.example.com") as client:
    version = client.get_version()
    print("server version:", version.version)

The aggregated dashboard needs a token, and demonstrates error handling:

import os
from forge_dashboard import APIError, ForgeDashboardClient, decode_error
from forge_dashboard._generated.api.dashboard import get_dashboard

client = ForgeDashboardClient(
    "https://forge-dashboard.example.com",
    api_token=os.environ.get("FORGE_DASHBOARD_API_TOKEN"),
)

try:
    response = get_dashboard.sync_detailed(client=client.raw)
    if error := decode_error(response):
        raise error
    for pr in response.parsed.pull_requests:
        print(pr.title, pr.ci)
except APIError as e:
    if e.status_code == 401:
        raise SystemExit("API token expired or invalid") from e
    raise

Every other operation follows the generated client's pattern — forge_dashboard._generated.api.<tag>.<operation>.sync_detailed(client=client.raw, ...) (or asyncio_detailed for async) returns a typed Response whose .parsed field holds the decoded body for a documented status code. Use decode_error to turn any error response into a forge_dashboard.APIError uniformly:

from forge_dashboard import decode_error
from forge_dashboard._generated.api.dashboard import get_dashboard

response = get_dashboard.sync_detailed(client=client.raw)
if error := decode_error(response):
    raise error
dashboard = response.parsed

The client retries a 429 or 5xx response with exponential backoff and jitter (honoring a server-sent Retry-After), and never retries any other 4xx. Tune it by passing a forge_dashboard.RetryConfig as retry=, or swap the underlying httpx.Client/httpx.AsyncClient entirely with httpx_client=/httpx_async_client=.

Reports

Every push to main that passes its tests publishes the reports to apis.ryankes.eu:

Regenerating the client

See CONTRIBUTING.md — the generated code is pinned to a specific forge-dashboard commit and shouldn't drift from it silently.

Contributing

See CONTRIBUTING.md for building, testing and the release process.

License

MIT — a permissive license for the client, independent of forge-dashboard's own AGPL-3.0.

Metadata

Release files for forge-dashboard-sdk 2.0.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for forge-dashboard-sdk 2.0.16
File Size Uploaded
forge_dashboard_sdk-2.0.16.tar.gz 268.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for forge-dashboard-sdk 2.0.16
File Interpreter ABI Platform
forge_dashboard_sdk-2.0.16-py3-none-any.whl Python 3 none any Details

Total release size: 439.0 kB

Release files / forge_dashboard_sdk-2.0.16.tar.gz

Download URL forge_dashboard_sdk-2.0.16.tar.gz
Size 268.1 kB
Tags Source
SHA-256 checksum
How to use checksums
23c9b5d54b8e6b08bc785a46e6a8d71f76357965187683e0738143869d87f3fa
BLAKE2b-256 checksum
How to use checksums
e2e439fa3cabe4dccce8560019b5d8b33734b7109b23c1a7291cfed4b9a4ea8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release files / forge_dashboard_sdk-2.0.16-py3-none-any.whl

Download URL forge_dashboard_sdk-2.0.16-py3-none-any.whl
Size 170.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed1ffc7147cc836cedb1538810adb2fd7083c0add87a096132e3d155019722d6
BLAKE2b-256 checksum
How to use checksums
3a25bec25972dbcfe134083a56fa8b0cd4c32d7ae318254f362de642b0b91c80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

2.0.23

2 release files

2.0.22

2 release files

2.0.21

2 release files

2.0.20

2 release files

This release

2.0.16 This release

2 release files

2.0.9

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page