Skip to main content

Trakt System SDK

Client libraries for the Trakt System Integrations API: fleet predictions and maintenance forecasts, in a few lines of code.

Trakt System predicts which components on your fleet need attention, when, and what to do about them. This SDK gives you that data directly, with authentication, retries, and rate limits handled for you.

Full endpoint reference, including request and response schemas for every route: https://trakt.tech/api-documentation

Install

Python

pip install kquika-trakt              # core
pip install "kquika-trakt[pandas]"    # with DataFrame support

The distribution is named kquika-trakt and the import is trakt. That difference is normal: the package you install and the module you import do not have to share a name.

Node / TypeScript

npm install @kquika-inc/trakt

Requires Node 18 or newer. TypeScript types are included.

Quickstart

Python

from trakt import Trakt

trakt = Trakt(token="YOUR_API_KEY")   # or set TRAKT_TOKEN

# What can this token do?
cfg = trakt.config()
print(cfg.access_level, cfg.max_predictions, cfg.can_export)

# Per-component predictions, most urgent first
for c in trakt.components():
    print(c.name, c.aircraft_tail_number, c.health,
          c.failure_probability, c.recommended_action)

# The next 90 days of maintenance, soonest first
for item in trakt.forecast(days=90):
    if item.is_overdue:
        print("OVERDUE:", item.tail_number, item.component_name)

# Straight to a DataFrame for planning
df = trakt.components_dataframe()

# Fleet-level rollup that matches the dashboards: health, composite average
# confidence, prediction coverage, and 30-day survival
summary = trakt.fleet_summary()
print(summary.fleet_health, summary.avg_confidence, summary.survival_30d)

Node / TypeScript

import { Trakt } from "@kquika-inc/trakt";

const trakt = new Trakt({ token: process.env.TRAKT_TOKEN! });

const cfg = await trakt.config();
console.log(cfg.access_level, cfg.max_predictions);

// Per-component predictions, most urgent first
const components = await trakt.components();
for (const c of components) {
  console.log(c.name, c.aircraft_tail_number, c.health, c.recommended_action);
}

// The next 90 days of maintenance, soonest first
const forecast = await trakt.forecast({ days: 90 });
for (const item of forecast) {
  if (item.is_overdue) console.log("OVERDUE:", item.tail_number, item.component_name);
}

// Fleet-level rollup that matches the dashboards
const summary = await trakt.fleetSummary();
console.log(summary.fleet_health, summary.avg_confidence, summary.survival_30d);

Full endpoint coverage

Both clients cover every token-callable endpoint. The table maps each method to the route it calls, so a spec or a server log line ties back to a call site.

Method (Python / Node) Endpoint
config / config GET /api/integrations/config
health_check / healthCheck GET /api/health-check
token_info / tokenInfo GET /api/token/info
integration_status / integrationStatus GET /api/integrations/status
components / components GET /api/integrations/components/extended
available_predictions / availablePredictions GET /api/integrations/predictions/available
forecast / forecast GET /api/integrations/planner/forecast
planner_grid / plannerGrid GET /api/integrations/planner/grid
failure_windows / failureWindows GET /api/integrations/predictions/failure-windows
failure_instances / failureInstances GET /api/integrations/predictions/failure-instances
probability_between / probabilityBetween GET /api/integrations/predictions/probability-between
select_predictions / selectPredictions POST /api/integrations/predictions/select
export_predictions / exportPredictions POST /api/integrations/predictions/export
convert_prediction / convertPrediction POST /api/integrations/planner/convert-prediction
submit_optimizer_feedback / submitOptimizerFeedback POST /api/integrations/optimizer/feedback
aircraft / aircraft GET /api/integrations/aircraft/extended
fleet_export / fleetExport GET /api/integrations/fleet/export
fleet_summary / fleetSummary GET /api/integrations/fleet/summary
scenarios, create_scenario / scenarios, createScenario GET, POST /api/integrations/scenarios
asset_configurations, create_asset_configuration / assetConfigurations, createAssetConfiguration GET, POST /api/integrations/asset-configurations
maintenance_programs / maintenancePrograms GET /api/integrations/maintenance-programs
submit_sensor_data / submitSensorData POST /api/v1/sensor-data/batch
submit_aircraft / submitAircraft POST /api/v1/aircraft/batch
submit_components / submitComponents POST /api/v1/components/batch
submit_maintenance / submitMaintenance POST /api/v1/maintenance/batch
submit_work_orders / submitWorkOrders POST /api/v1/work-orders/batch

Sending data in

The five batch methods accept up to 1000 records per call and report a partial success rather than raising. A 200 does not mean every row landed, so read the counts:

result = trakt.submit_sensor_data([
    {"component_id": 1, "timestamp": "2026-08-13T09:00:00Z",
     "temperature": 85.2, "external_id": "fdr-abc-001"},
])

print(result["stored"], result["duplicates"], result["rejected"])
for error in result["errors"]:
    print(error["row"], error["reason"])

Rows that fail validation or that name a component outside your company are rejected on their own, with the index they occupied in your array, while the rest of the batch is stored. Supplying external_id makes retries idempotent: a repeat of the same identifier at the same timestamp comes back as a duplicate rather than being written twice.

Chunking above 1000 is left to you, so a partial failure stays attributable to a specific request instead of being hidden inside a loop the client ran for you.

Handling errors

Both clients raise typed errors, so you can catch the case you care about.

from trakt import AuthenticationError, PermissionError_, RateLimitError

try:
    components = trakt.components()
except AuthenticationError:
    print("The token was not accepted.")
except PermissionError_:
    print("This token's access level does not cover that call.")
except RateLimitError:
    print("Quota exhausted. The client already retried with backoff.")
import { AuthenticationError, PermissionError, RateLimitError } from "@kquika-inc/trakt";

try {
  const components = await trakt.components();
} catch (e) {
  if (e instanceof AuthenticationError) console.error("The token was not accepted.");
  else if (e instanceof PermissionError) console.error("Access level does not cover that call.");
  else if (e instanceof RateLimitError) console.error("Quota exhausted.");
  else throw e;
}

What the clients do for you

  • Auth. Set the token once; every request carries the bearer header.
  • Retries. A rate limit or a transient server failure is retried with exponential backoff and jitter, honoring Retry-After when it is sent. A rejected token or a permission error is not retried, because retrying will not fix it.
  • Typed errors. AuthenticationError, PermissionError, RateLimitError, NotFoundError, ServerError.
  • Flattened objects. The nested prediction, survival, and maintenance blocks are lifted onto the component, so health and recommended_action are one attribute away.
  • Useful ordering. Components come back most urgent first; forecast items come back soonest first.

Reading the fields

Field Meaning
health 0 to 100, where higher is healthier.
health_trend stable, declining, or critical.
predicted_rul_hours / predicted_rul_days Remaining useful life before attention is due.
failure_probability 0 to 1, the modeled chance of failure in the near term.
recommended_action do_nothing, monitor, inspect, repair, or replace.
priority The urgency band for planning.
task_reference The task identifier from your source system, so a row ties back to its task.
days_until_due Negative means the item is already past due.

Access levels

Your token is issued at one of three levels, which control both the endpoints it can reach and how many records a request returns:

  • read_only — read predictions and forecasts
  • read_write — read, plus the write endpoints
  • full — everything, including fleet export

A call outside your token's level raises a permission error. Call config() to see the level and limits for your token rather than guessing.

Need a client in another language?

The SDKs are generated from an OpenAPI specification, which the API serves directly, so the contract you generate from is always the one the service is running:

curl -O https://trakt.tech/api/openapi.yaml     # as authored
curl -O https://trakt.tech/api/openapi.json     # for tooling that wants JSON

Both are unauthenticated, because the spec describes the shape of the API rather than any data. Every endpoint it documents still needs a bearer token.

Point your generator of choice at it, for example:

openapi-generator-cli generate \
  -i https://trakt.tech/api/openapi.yaml \
  -g go -o ./trakt-go

Support

API reference: https://trakt.tech/api-documentation

Questions, a token, or a raised limit: support@kquika.com

License

MIT

Release files for kquika-trakt 1.1.7

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

Source distribution (sdist)

Source distribution for kquika-trakt 1.1.7
File Size Uploaded
kquika_trakt-1.1.7.tar.gz 17.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kquika-trakt 1.1.7
File Interpreter ABI Platform
kquika_trakt-1.1.7-py3-none-any.whl Python 3 none any Details

Total release size:35.8 kB

Release files / kquika_trakt-1.1.7.tar.gz

Download URL kquika_trakt-1.1.7.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4ef7567cd3412247836417a103ce724f70d9c73ef418e1dddbf16e8e94f31f54
BLAKE2b-256 checksum
How to use checksums
1a23fe586f0969bb133cbe8fd36349f2d4303dd69b83ed7cb1712a1c5233d90b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / kquika_trakt-1.1.7-py3-none-any.whl

Download URL kquika_trakt-1.1.7-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e81144a92d50d2f787bdc2712f4e2e0bfed869fe3ab305487b212375baf0c9e4
BLAKE2b-256 checksum
How to use checksums
9f3fc280b8541dc22995169b8963d95c2720d6e8dff93eb12f776cc0e32db3c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release history Release notifications | RSS feed

1.3.0

2 release files

1.2.0

2 release files

1.1.9

2 release files

1.1.8

2 release files

This release

1.1.7 This release

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.9

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