Skip to main content

GitHub version PyPI version

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 \.acmi file generation compliant with Tacview 2.2 standards.
    • AcmiTcpServer: Real-Time Telemetry TCP server (default port 42674) 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)

Source distribution for WarThunder 2.4.0
File Size Uploaded
warthunder-2.4.0.tar.gz 16.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for WarThunder 2.4.0
File Interpreter ABI Platform
warthunder-2.4.0-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

2.4.0 This release

2 release files

2.3.4

2 release files

2.3.3

1 release file

2.3.2

1 release file

2.3.1

1 release file

2.2.4

1 release file

2.2.3

1 release file

2.2.2

1 release file

2.2.1

2 release files

2.2.0

1 release file

2.1.13

1 release file

2.1.12

1 release file

2.1.11

1 release file

2.1.10

1 release file

2.1.9

1 release file

2.1.8

1 release file

2.1.7

1 release file

2.1.6

1 release file

2.1.5

1 release file

2.1.4

1 release file

2.1.3

1 release file

2.1.2

1 release file

2.1.1

1 release file

2.1.0

1 release file

2.0.12

1 release file

2.0.11

1 release file

2.0.10

1 release file

2.0.9

1 release file

2.0.8

1 release file

2.0.7

1 release file

2.0.6

1 release file

2.0.5

1 release file

2.0.4

1 release file

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