Skip to main content

TrackSim

TrackSim Python

PyPI Python versions CI License: MIT

The official Python client for the TrackSim API: manage your VTC's drivers, read job routes, work with the route planner and verify webhooks, with typed responses throughout.

Installation

pip install TrackSim

Requires Python 3.10 or newer.

Quick start

Generate an API key from the API tab of the integrations page. Keep it secret: load it from an environment variable or secrets manager rather than committing it.

import os
from tracksim import TrackSim

with TrackSim(api_key=os.environ["TRACKSIM_API_KEY"]) as tracksim:
    company = tracksim.me()
    print(company.name, company.driver_count.current)

Every response is a typed, immutable object. Use dot notation for fields, .to_dict() for plain JSON-compatible data, and print() for readable, indented JSON.

Drivers

driver = tracksim.add_driver("76561198171686422")
driver = tracksim.get_driver("76561198171686422")

print(driver.username)
print(driver.settings.eut2.truck.live_tracking)
print(driver.settings.ats.car.job_logging)

# Only the settings you pass are changed.
driver = tracksim.manage_driver(
    "76561198171686422",
    eut2_job_logging=True,  # ETS2 trucks
    eut2_live_tracking=True,
    eut2_coach_job_logging=True,  # ETS2 coaches
    ats_car_live_tracking=False,  # ATS cars
)

tracksim.remove_driver("76561198171686422")

Job routes

job_type is "truck", "car" or "bus".

route = tracksim.get_job_route(123, "truck")

for point in route:
    print(point.x, point.z, point.time)

bus_route = tracksim.get_job_route(456, "bus")
print(bus_route[0].speed_kmh, bus_route[0].satisfaction)

Route data rarely changes once a job is complete, so store it on your side if you need it often.

Route planner (maps)

Requires a TrackSim map and the Route Planner add-on. Limited to 60 requests a minute.

link = tracksim.create_map_link()  # plan a new route
link = tracksim.create_map_edit_link(route_id)  # edit an existing one
print(link.full_url)  # one-time link, expires after 24 hours: treat it as a secret

for route in tracksim.list_map_routes():
    print(route.id, route.game, route.name)

route = tracksim.get_map_route(route_id)
print(route.waypoints, route.tenant.name)

tracksim.delete_map_route(route_id)

Webhooks

Check the tracksim-signature header against the secret shown when you created the webhook before trusting a payload. For example, with Flask:

from flask import Flask, abort, request
from tracksim import verify_webhook_signature

app = Flask(__name__)


@app.post("/tracksim")
def tracksim_webhook():
    if not verify_webhook_signature(
        request.get_data(), request.headers.get("tracksim-signature"), WEBHOOK_SECRET
    ):
        abort(401)
    event = request.get_json()
    print(event["type"])
    return "", 204

Errors

Every exception inherits from TrackSimError.

Exception When
AuthenticationError 401: missing or invalid API key
PermissionDeniedError 403: not allowed (some endpoints also use this for an invalid key or unknown resource)
NotFoundError 404: resource not found
RateLimitError 429: too many requests
APIError any other error response, or a response the client did not expect
NetworkError TrackSim could not be reached

APIError and its subclasses carry message (the API's error code, such as max_driver_limit_reached), status_code and response_body.

from tracksim import APIError, NotFoundError

try:
    tracksim.add_driver("76561198171686422")
except APIError as error:
    if error.message == "steam_profile_private":
        print("Ask the driver to make their Steam profile public")
    else:
        raise

Configuration

TrackSim(
    api_key="...",
    timeout=30.0,  # seconds per request
    session=my_session,  # reuse your own requests.Session (proxies, retries, ...)
)

Contributing

Bug reports and pull requests are welcome. See CONTRIBUTING.md. To report a security issue, see SECURITY.md.

License

MIT © Omnibyte Technologies Limited

Metadata

Release files for TrackSim 1.0.1

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

Source distribution (sdist)

Source distribution for TrackSim 1.0.1
File Size Uploaded Provenance Actions
tracksim-1.0.1.tar.gz 14.3 kB With provenance Details for tracksim-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for TrackSim 1.0.1
File Interpreter ABI Platform Actions
tracksim-1.0.1-py3-none-any.whl Python 3 none any Details for tracksim-1.0.1-py3-none-any.whl

Total release size: 27.2 kB

Release files / tracksim-1.0.1.tar.gz

Download URL tracksim-1.0.1.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
daa135ba9dd57eadab397b7e078f705b7fee451f1b8eb8ca5cd8893927ca1830
BLAKE2b-256 checksum
How to use checksums
3a7a65aabdeeeafb31f0abfad1da39f7c4137d95e9b51c892e5a0b484c2cb772
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 Nov 25, 2026.

Transparency log

Release files / tracksim-1.0.1-py3-none-any.whl

Download URL tracksim-1.0.1-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d75a3d188c4ee1576b8b9ff9fd2b4455beec30e2b5d5409ca4b2c258839b81e0
BLAKE2b-256 checksum
How to use checksums
7938b85f275896a365758de15630c6a420dff4e04981b375816e5939c71975f9
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 Nov 25, 2026.

Transparency log

Security for TrackSim 1.0.1

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 tracksim-1.0.1.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 Nov 25, 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.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files Full provenance

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