Skip to main content

ITOC360 Python SDK

PyPI Python versions Test License

Python client for the ITOC360 Events API.

ITOC360 is an incident management and on-call platform. This SDK sends events to an ITOC360 source, which runs them through your escalation policies, on-call schedules and notification channels — SMS, voice calls, email and push.

No dependencies outside the standard library.

Installation

pip install itoc360

Requires Python 3.10 or later.

Quick start

import os

import itoc360

client = itoc360.Client(os.environ["ITOC360_TOKEN"])

client.send_alert(
    itoc360.Alert(
        fingerprint="db-primary-disk-full",
        summary="Disk usage on db-primary is at 95%",
        severity=itoc360.Severity.CRITICAL,
        status=itoc360.Status.FIRING,
    )
)

Authentication

Every request carries a source token. Create a source in the ITOC360 app, choose its provider type, and copy the token it generates. The token identifies both the organization the events belong to and the payload format the endpoint expects.

The SDK sends it as an RFC 6750 bearer token. Read it from the environment or a secret store — never commit it, and never put it in a URL.

Sending alerts

send_alert takes a provider-independent Alert and expands it into the Prometheus Alertmanager webhook payload:

alert = itoc360.Alert(
    fingerprint="db-primary-disk-full",
    summary="Disk usage on db-primary is at 95%",
    description="The data volume has less than 5% free space left.",
    severity=itoc360.Severity.CRITICAL,
    status=itoc360.Status.FIRING,
    labels={"instance": "db-01", "service": "payments"},
)

event = client.send_alert(alert)
print(event.id, event.type)  # -> "...", "ALERT"

Resolve it later by sending the same fingerprint with Status.RESOLVED:

client.send_alert(
    itoc360.Alert(
        fingerprint="db-primary-disk-full",
        summary="Disk usage on db-primary is back to normal",
        status=itoc360.Status.RESOLVED,
    )
)

Fingerprints

fingerprint is the deduplication key. ITOC360 groups every event carrying the same fingerprint into one alert, so an event whose fingerprint matches an open alert updates it instead of paging someone again.

Derive it from whatever makes the condition unique — the host, the check and the object it watches — and keep it identical between the firing and the resolved event. A value that changes per run raises a new alert every time.

Severity

severity becomes the alert's priority in ITOC360:

Severity Priority
Severity.CRITICAL CRITICAL
Severity.ERROR HIGH
Severity.WARNING MEDIUM
Severity.INFO LOW

Defaults to Severity.WARNING.

Which sources send_alert works with

send_alert produces the Alertmanager payload, so the source must be configured for a provider that speaks it:

prometheus · mimir · cortex · loki · signoz · grafana

Other providers

ITOC360 supports over forty providers, each expecting its own vendor payload — Datadog, Zabbix, Dynatrace, CloudWatch, Splunk and the rest. send_raw sends any value that encodes to JSON and imposes no shape of its own:

client.send_raw(
    {
        "alert_id": "42",
        "alert_transition": "Triggered",
        "alert_title": "CPU high on web-03",
        "alert_type": "error",
    }
)

Match the payload to the provider your source is configured for; see the ITOC360 documentation for each format.

Configuration

client = itoc360.Client(
    token,
    base_url="https://itoc360.internal.example",
    timeout=10.0,
    user_agent="acme-pager/2.1",
)
Argument Purpose
base_url Point at a self-hosted deployment or a test server
timeout Seconds to wait for each request; defaults to 30
user_agent Identify your application in ITOC360's request logs
opener A urllib.request.OpenerDirector for proxies or custom TLS

Error handling

A rejected request raises APIError, carrying the status and the server's own message. Neither the token nor any request header ever appears in it.

try:
    client.send_alert(alert)
except itoc360.APIError as error:
    if error.unauthorized:
        ...  # the token is missing or matches no source
    elif error.subscription_inactive:
        ...  # the subscription has lapsed; the event was dropped
    elif error.retryable:
        ...  # a server-side failure — worth sending again
except itoc360.TransportError:
    ...  # the request never reached ITOC360

An Alert missing its fingerprint or summary raises ValidationError before any request is made. Every exception derives from ITOC360Error.

Type checking

The package ships a py.typed marker, so mypy and pyright see the annotations without a stub package.

Development

python -m venv .venv && source .venv/bin/activate
pip install pytest mypy ruff

pytest
ruff check .
mypy

The package is importable straight from the checkout, so the tests need no install. They run against a local HTTP server and never contact ITOC360.

License

Apache License 2.0. Copyright 2026 ITOC360 INC. See LICENSE.

Metadata

Release files for itoc360 0.1.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 itoc360 0.1.0
File Size Uploaded
itoc360-0.1.0.tar.gz 20.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for itoc360 0.1.0
File Interpreter ABI Platform
itoc360-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 37.0 kB

Release files / itoc360-0.1.0.tar.gz

Download URL itoc360-0.1.0.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
457999ce2962d00857c3f75d2657f9e0f03887e88feb2d99db52014fdb892457
BLAKE2b-256 checksum
How to use checksums
8ee36f8e5cdc98ab653607c3353a41da0c6d6a4e97ca8de0c942e806305d4d52
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 Sep 8, 2026.

Transparency log

Release files / itoc360-0.1.0-py3-none-any.whl

Download URL itoc360-0.1.0-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fef826f497de3395a609bf0fd98850642e185af48b5a237bd8a462125caa85d7
BLAKE2b-256 checksum
How to use checksums
832f9b99375dceb7a535b8a388bb3704b582f1a3f35528c3a22a5a51b944e27c
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 Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

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