Skip to main content

bellator-si

Python client for the Bellator Schedule Intelligence API. Version 0.4.5.

This README is hand-maintained. The client code and docs/ are generated from output/openapi-public-v0.4.5.json by scripts/generate-sdks.sh.

Install

pip install bellator-si==0.4.5

Python 3.9 or later.

Quick start

Set your key in an environment variable. Do not put it in code.

export BELLATOR_API_KEY="your-key"
import os

from bellator_si import ApiClient, Configuration, HealthApi

config = Configuration(api_key={"ApiKeyAuth": os.environ["BELLATOR_API_KEY"]})

with ApiClient(config) as client:
    result = HealthApi(client).health_score(
        {
            "tasks": [
                {"id": "A", "name": "Mobilize", "duration_days": 5, "predecessors": []},
                {"id": "B", "name": "Foundations", "duration_days": 10, "predecessors": ["A"]},
                {"id": "C", "name": "Structure", "duration_days": 15, "predecessors": ["B"]},
            ]
        }
    )

print(result.score, result.grade, result.status)
for finding in result.findings or []:
    print(finding.code, finding.affected_tasks)

Configuration() uses https://api.bellatorsi.com. Pass host= to point at another environment, for example Configuration(host="http://localhost:8000", api_key=...).

Predecessors

Each item in predecessors can be any of these, mixed in one list:

from bellator_si import DependencyLink

predecessors = [
    "T1",                                                          # finish-to-start, no lag
    "T2SS+2d",                                                     # type and lag in the string
    {"task_id": "T3", "relationship_type": "FF", "lag_days": -1},  # object
    DependencyLink(task_id="T4"),                                  # model
]

Classes and methods

Method names are the API operation IDs.

Class Methods
HealthApi health_score, health_logic_audit, health_progress_audit, health_dcma_14_point, health_dcma_decm, health_planning_horizon, health_schedule_risk_index, and an _async variant of each
AnalysisApi analysis_validate, analysis_cpm, analysis_resources, analysis_cpm_async, analysis_resources_async
ForensicsApi forensics_delay_analysis, forensics_change_tracking, forensics_baseline_compare, forensics_as_planned_vs_as_built, and an _async variant of each
SimulationApi simulation_monte_carlo, simulation_what_if, and an _async variant of each
ImportApi import_mpp, import_xer
JobsApi jobs_get, jobs_cancel, jobs_delete
AccountApi, UsageQuotaApi, WebhooksApi account tier, usage, and webhook registration
SystemApi health_check (process liveness, not a schedule check)

Each method also has <name>_with_http_info (status code and headers) and <name>_without_preload_content (raw response). Per-model and per-method pages are in docs/.

Async jobs

Starter and above. Submit to an _async method, then poll the job.

import os
import time

from bellator_si import ApiClient, Configuration, HealthApi, JobsApi

config = Configuration(api_key={"ApiKeyAuth": os.environ["BELLATOR_API_KEY"]})
tasks = [
    {"id": "A", "duration_days": 5, "predecessors": []},
    {"id": "B", "duration_days": 3, "predecessors": ["A"]},
]

with ApiClient(config) as client:
    job = HealthApi(client).health_score_async({"tasks": tasks})
    while True:
        status = JobsApi(client).jobs_get(job.job_id)
        if status.status in ("completed", "failed", "cancelled"):
            break
        time.sleep(2)

print(status.status, status.result)

Errors

A non-2xx response raises bellator_si.ApiException (or a subclass such as BadRequestException). status is the HTTP code and body is an RFC 9457 problem document (application/problem+json): type, title, status, detail, code, instance, request_id, plus route fields such as required_tier or async_endpoint. Branch on code; type is the page that documents it.

import json
import os

from bellator_si import ApiClient, ApiException, Configuration, ForensicsApi

config = Configuration(api_key={"ApiKeyAuth": os.environ["BELLATOR_API_KEY"]})

with ApiClient(config) as client:
    try:
        ForensicsApi(client).forensics_delay_analysis(
            {"tasks": [{"id": "A", "duration_days": 5}], "status_date": "2026-03-15"}
        )
    except ApiException as error:
        problem = json.loads(error.body)
        print(error.status)              # 402 on a Free key: forensics needs Starter
        print(problem["code"])           # "TIER_REQUIRED"
        print(problem["required_tier"])  # "starter"

A schedule with a predecessor loop returns 400 CIRCULAR_DEPENDENCY from every endpoint that computes the critical path, with the loop in cycle. analysis_validate returns it as a CIRCULAR_DEPENDENCY finding instead.

Tiers

Tier Tasks per request Calls per month Payload Async
Free 1,000 100 5 MB No
Starter 2,000 500 5 MB Yes
Professional 5,000 2,000 25 MB Yes
Enterprise 50,000 10,000 100 MB Yes
Government 100,000 50,000 500 MB Yes

Free covers Health and Analysis. Starter adds Forensics, Import, and async. Simulation needs Professional. Requests over 1,000 tasks must use the _async methods.

Changes in 0.4.5

  • No client changes. The API contract is the same as 0.4.4. The release fixes the server so _async jobs report completion (see docs/releases/v0.4.5-async-job-status.md).

Changes in 0.4.4

  • No client changes. The API contract is the same as 0.4.3. The release fixes the server so _async jobs complete (see docs/releases/v0.4.4-async-jobs.md).

Changes in 0.4.3

  • Breaking. The health score uses method v2 (API spec 2.0.1):
    • ScheduleInput is replaced by HealthScoreRequest, which adds status_date, requirements and schedule_history. use_ml_scoring is removed.
    • The response data is the typed HealthScoreData (components, fix_first, logic_driven_share, confidence). Scores from before 0.4.3 are not comparable.
  • Breaking. ResourceManagementApi is removed, with allocate_resources and level_resources (they were placeholders).
  • Many responses are now named models instead of free-form objects.
  • Results change on most endpoints because the API corrects its calculations. See CHANGELOG.md and docs/releases/v0.4.3-calculation-accuracy.md.

Changes in 0.4.2

  • No interface changes. The API fixes results: async jobs accept dashboard keys, and delay analysis, as-planned vs as-built, planning horizon, resource analysis, and baseline-compare (spi_schedule) now report the measured values. See CHANGELOG.md.
  • Docs: examples import os and keep the API key.

Changes in 0.4.1

  • Schedule checks are on HealthApi. In 0.4.0 they were on Health0Api, and HealthApi held only the liveness probe, which is now SystemApi.health_check.
  • Method names are the operation IDs. For example calculate_health_score_api_v1_health_score_post is now health_score, and get_async_job_status_api_v1_jobs_job_id_get is now jobs_get.
  • Methods no longer take x_api_key, authorization, or x_bellator_internal_dispatch arguments. Set the key once on Configuration.
  • A plain request dict accepts string predecessors. In 0.4.0 "T1" failed client-side, and an object predecessor in a dict was sent as null.
  • Internal endpoints (sign-up, billing, contact, feedback, sandbox, ephemeral keys) are no longer in the package.

Metadata

Release files for bellator-si 0.4.5

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

Source distribution (sdist)

Source distribution for bellator-si 0.4.5
File Size Uploaded Provenance Actions
bellator_si-0.4.5.tar.gz 283.4 kB Without provenance Details for bellator_si-0.4.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bellator-si 0.4.5
File Interpreter ABI Platform Actions
bellator_si-0.4.5-py3-none-any.whl Python 3 none any Details for bellator_si-0.4.5-py3-none-any.whl

Total release size: 1.1 MB

Release files / bellator_si-0.4.5.tar.gz

Download URL bellator_si-0.4.5.tar.gz
Size 283.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9facfffcaafa59c63ef0450d3fd9556da617112b360475e0a7ee99decf1cd9ba
BLAKE2b-256 checksum
How to use checksums
03d212dfd092b3b1fd7358ff5ed9269f5543fea9d8d6cf855e99013729bb90bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / bellator_si-0.4.5-py3-none-any.whl

Download URL bellator_si-0.4.5-py3-none-any.whl
Size 832.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2bd6035faef9654a3052a62807d26f2d946fe110fb93fef44364c05721c938cb
BLAKE2b-256 checksum
How to use checksums
3ba501a9fe02dd67e7b9bec75b3605235aacba6006e8fb098f171f7d9409e88b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for bellator-si 0.4.5

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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