Overview
Python package to access vehicle telemetry, map objects, combat events, and real-time flight logs in War Thunder air battles (NOT tanks). With recent additions, this framework also supports WGS84 spatial projections and Tacview ACMI 2.2 local logging & live TCP streaming.
Here are the key capabilities and features accessible through this package:
- Vehicle Telemetry:
- Available for both user and other match players: Location in latitude/longitude/altitude (via WGS84 NED-to-LLA conversions), heading angle, airspeed (IAS/TAS).
- Available exclusively for user's vehicle: Pitch angle, roll angle, flap state, gear state, altitude, and airframe identifier.
- Mini-Map & Battlefield Objects:
- Objects' locations in latitude/longitude (DD).
- Airfields include dual coordinate entries for both ends of the runway plus runway heading and length calculations.
- Faction identification (friendly or enemy) and specific entity classifications (fighter, bomber, heavy tank, artillery, AAA, etc.).
- Match Events & Communication:
- Chat comments (anything typed into chat) with automatic text sanitization.
- Robust match events and damage logs (crash, overheating, engine damage, kills) accumulated persistently without data loss.
- Tacview ACMI 2.2 & Real-Time Streaming:
AcmiWriter: Local\.acmifile generation compliant with Tacview 2.2 standards.AcmiTcpServer: Real-Time Telemetry TCP server (default port42674) for live telemetry streaming directly into Tacview.
This library makes use of War Thunder's localhost server pages (http://localhost:8111/indicators, http://localhost:8111/state, http://localhost:8111/map.img, http://localhost:8111/map_obj.json, http://localhost:8111/map_info.json, http://localhost:8111/hudmsg, http://localhost:8111/gamechat) served automatically during an active match.
Example Use-Case:
https://github.com/PowerBroker2/Thunder_Viewer
To Install
pip install WarThunder
Example Python Script (Telemetry & ACMI Bridge)
import time
from WarThunder import telemetry
from WarThunder import mapinfo
from WarThunder import acmi
from pprint import pprint
def main():
telem = telemetry.TelemInterface()
# Initialize Tacview local writer and live TCP streamer
writer = acmi.AcmiWriter("flight_recording.acmi", ref_lat=37.5, ref_lon=-120.0, ref_alt=0.0)
server = acmi.AcmiTcpServer(host='127.0.0.1', port=42674, ref_lat=37.5, ref_lon=-120.0, ref_alt=0.0)
writer.open()
server.start()
print("[STATUS] ACMI Local Logging & Live TCP Streamer Active.")
try:
while True:
# Poll telemetry and match events (events=True keeps persistent event logs)
in_flight = telem.get_telemetry(comments=True, events=True)
if not in_flight:
print("Waiting for active flight...", end="\r")
time.sleep(1.0)
continue
print(f"Airframe: {telem.airframe} | Alt: {telem.altitude:.1f}m | IAS: {telem.ias} km/h")
print(f"Events Logged: {len(telem.events.get('damage', []))}")
time.sleep(0.1)
except KeyboardInterrupt:
print("Closing...")
finally:
writer.close()
server.stop()
if __name__ == '__main__':
main()
Example Output:
------------------------------------------------------
Map Info:
Name: Ruhr
Size: 65km x 65km
------------------------------------------------------
Basic Telemetry:
{'IAS': 350.5,
'airframe': 'Bf 109 F',
'altitude': 592.21,
'flapState': 0.0,
'gearState': 0.0,
'heading': 40.64,
'lat': 51.428588,
'lon': 6.919188,
'pitch': 10.89,
'roll': 0.01}
------------------------------------------------------
Events:
{'damage': [{'enemy': False,
'id': 1,
'mode': '',
'msg': 'Bf 109 F has crashed.',
'sender': '',
'time': 1932}],
'events': []}
Metadata
Release files for WarThunder 2.4.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 |
|---|---|---|---|---|
| warthunder-2.4.0.tar.gz | 16.2 kB | Without provenance | Details for warthunder-2.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| warthunder-2.4.0-py3-none-any.whl | Python 3 | none | any | Details for warthunder-2.4.0-py3-none-any.whl |
Total release size: 31.3 kB
Release files / warthunder-2.4.0.tar.gz
| Download URL | warthunder-2.4.0.tar.gz |
|---|---|
| Size | 16.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9ea0ba44fb0b852e87b84f65339617ea61889294ec3d559f23f229762a55a06
|
|
BLAKE2b-256 checksum How to use checksums |
4a042a43a182eae9375c733910c0f870635b5d3d2306394822f4c88d0d0ff2c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Release files / warthunder-2.4.0-py3-none-any.whl
| Download URL | warthunder-2.4.0-py3-none-any.whl |
|---|---|
| Size | 15.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
90c5b3dfb417a3d335e9d3f8e3cfb057746b4241eda244c0522bf4514f69cffa
|
|
BLAKE2b-256 checksum How to use checksums |
bc5dfb04344ec4380f9569dfc1ed8efc2925e5791f27f35c9d7b385982c2d8eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Security for WarThunder 2.4.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.
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.