Skip to main content

Pingera Python SDK

PyPI Python versions CI

The official Python SDK for the Pingera monitoring and status page platform API. It is generated from the Pingera OpenAPI specification, so it covers every endpoint and ships typed Pydantic models for all requests and responses.

Installation

pip install pingera-sdk

Requires Python 3.10 or newer.

Quick start

Create an API token in the Pingera app under Settings → API tokens and export it:

export PINGERA_API_KEY="your_api_token"
import os

from pingera import ApiClient, ChecksApi, Configuration, StatusPagesApi, StatusPagesComponentsApi

configuration = Configuration()  # defaults to https://api.pingera.ru
configuration.api_key["apiKeyAuth"] = os.environ["PINGERA_API_KEY"]

with ApiClient(configuration) as api_client:
    pages = StatusPagesApi(api_client).v1_pages_get()
    print(f"Found {len(pages.pages)} status pages")

    checks = ChecksApi(api_client).v1_checks_get(page=1, page_size=10)
    for check in checks.checks:
        print(check.name, check.type, check.status)

    components = StatusPagesComponentsApi(api_client).v1_pages_page_id_components_get("your_page_id")
    print(f"Found {len(components)} components")

Authentication

Use an API token (recommended for scripts and integrations):

configuration.api_key["apiKeyAuth"] = "your_api_token"

The same token can be sent in the X-API-KEY header instead, if a proxy rewrites Authorization:

configuration.api_key["apiKeyHeader"] = "your_api_token"

Or a JWT access token obtained by logging in:

configuration = Configuration(access_token="your_jwt")

Available APIs

All API classes can be imported from pingera or pingera.api. Method names follow the endpoint path and HTTP method, e.g. GET /v1/checks/{check_id} is ChecksApi.v1_checks_check_id_get.

API class Purpose
ChecksApi Monitoring checks, results, regions, uptime and status history
CheckGroupsApi Group checks together
CheckSecretsApi / SecretsApi Secrets and their assignment to checks
ChecksUnifiedResultsApi Unified results across checks
ExecutionGroupsApi Multi-region execution results
OnDemandChecksApi Run checks on demand and poll for results
HeartbeatsApi Heartbeat (cron job) monitoring
PrivateLocationsApi Private locations and runner tokens for self-hosted runners
AlertsApi Alerts, alert rules and notification channels
StatusPagesApi Status pages, custom sender email domains
StatusPagesComponentsApi Status page components and their uptime
StatusPagesIncidentsApi Incidents, maintenance and postmortems
PagePasswordsApi Password protection for status pages
ReportsApi PDF report generation
AuditApi Organization audit trail
OrganizationsApi / UsageApi Organization settings, plans, subscriptions and usage
UsersApi / AuthEnhancedApi / OAuthApi / WebauthnApi Users, API tokens and authentication

The full reference for every method and model is in client/README.md and client/docs/.

Working with models

from pingera import StatusPagesIncidentsApi
from pingera.models import IncidentCreate, IncidentUpdateCreate

incidents_api = StatusPagesIncidentsApi(api_client)

incident = incidents_api.v1_pages_page_id_incidents_post(
    "your_page_id",
    IncidentCreate(
        name="Database connectivity issues",
        body="We are investigating connectivity issues",
        status="investigating",
        impact="major",
    ),
)

incidents_api.v1_pages_page_id_incidents_incident_id_incident_updates_post(
    "your_page_id",
    incident.id,
    IncidentUpdateCreate(status="identified", body="The cause has been found"),
)

Models can be converted with to_dict() / to_json() and created with from_dict() / from_json().

Error handling

Failed requests raise pingera.ApiException, or a subclass for common statuses (BadRequestException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException):

from pingera.exceptions import ApiException, NotFoundException

try:
    check = ChecksApi(api_client).v1_checks_check_id_get("missing")
except NotFoundException:
    print("Check not found")
except ApiException as e:
    print(f"API error {e.status}: {e.body}")

Examples

See the examples/ directory:

The examples read PINGERA_API_KEY (or PINGERA_BEARER_TOKEN) and, where needed, PINGERA_PAGE_ID.

Development

pip install -e ".[dev]"
pytest

Regenerating the client

The SDK is generated with OpenAPI Generator, run through Docker:

python generate_client.py                  # fetch https://api.pingera.ru/openapi.json and regenerate
python generate_client.py --spec spec.json # regenerate from a local spec file
python generate_client.py --check          # only check whether the SDK matches the live API

The script stores the spec in openapi/openapi.json and rewrites client/pingera/, client/docs/ and client/README.md. Don't edit those generated files by hand. Use --runner local to call a locally installed openapi-generator-cli instead of Docker.

A scheduled workflow runs --check against the live API every day, so new endpoints, fields and enum values are noticed quickly.

Releasing

Releases are published to PyPI by the Release workflow when a vX.Y.Z tag is pushed:

  1. Bump version in pyproject.toml (the only place it is defined) and run python generate_client.py --spec openapi/openapi.json so the generated code picks up the new version (use python generate_client.py instead to also pull the latest API spec).

  2. Add a ## X.Y.Z section to CHANGELOG.md; it becomes the GitHub release notes.

  3. Merge to main, then tag the merge commit and push the tag:

    git switch main && git pull
    git tag v1.2.0
    git push origin v1.2.0
    

The workflow checks that the tag matches the package version, runs the tests, builds the package, publishes it to PyPI with Trusted Publishing (no API tokens), and creates a GitHub release with the changelog section and the built files attached.

License

MIT, see LICENSE.

Metadata

Release files for pingera-sdk 1.2.0

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

Source distribution (sdist)

Source distribution for pingera-sdk 1.2.0
File Size Uploaded Provenance Actions
pingera_sdk-1.2.0.tar.gz 174.2 kB With provenance Details for pingera_sdk-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pingera-sdk 1.2.0
File Interpreter ABI Platform Actions
pingera_sdk-1.2.0-py3-none-any.whl Python 3 none any Details for pingera_sdk-1.2.0-py3-none-any.whl

Total release size: 595.5 kB

Release files / pingera_sdk-1.2.0.tar.gz

Download URL pingera_sdk-1.2.0.tar.gz
Size 174.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2ff9966d0cb1e0e3588b967309d26779b83c20d775f59b795c766b642beb0555
BLAKE2b-256 checksum
How to use checksums
931f6fda3592894bee2086b7a099c45b48a3394eb88f868462b2a1824b362e7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 28, 2026.

Transparency log

Release files / pingera_sdk-1.2.0-py3-none-any.whl

Download URL pingera_sdk-1.2.0-py3-none-any.whl
Size 421.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ec5348c59237d4fb5db5d10e3bacf68d9c66f835d8af38aa02fc765d8b8a7db
BLAKE2b-256 checksum
How to use checksums
8b0171848eeb1a2cede017b2076a9ae232bd4f23ec071bffa9989f44fd70dd6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 28, 2026.

Transparency log

Security for pingera-sdk 1.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pingera_sdk-1.2.0.tar.gz

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 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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