TrackSim Python
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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tracksim-1.0.0.tar.gz | 13.9 kB | With provenance | Details for tracksim-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tracksim-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for tracksim-1.0.0-py3-none-any.whl |
Total release size: 26.8 kB
Release files / tracksim-1.0.0.tar.gz
| Download URL | tracksim-1.0.0.tar.gz |
|---|---|
| Size | 13.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9b940bc23078c4c708bd822cabaf12326b10b96dcb827704c4d4f3f1b3d9826a
|
|
BLAKE2b-256 checksum How to use checksums |
773cb831a9729dc7c6bfc23d6c762fe0a82823862d969b9777d10f29f7cd78c5
|
| 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 logRelease files / tracksim-1.0.0-py3-none-any.whl
| Download URL | tracksim-1.0.0-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fec4ccf37666284c11378c72802e295d0a05428f9c354ad5053d484007c0b131
|
|
BLAKE2b-256 checksum How to use checksums |
bef14a8326976f540eb332eb5b40a47532adba7a5313dd53be8fc95051a90e40
|
| 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 logSecurity for TrackSim 1.0.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.
Attestation for tracksim-1.0.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 Nov 25, 2026.
Transparency logA 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.