A lightweight, high-performance Python library for connecting to DCS-BIOS and DCS-INSIGHT in DCS World.
- Asynchronous: Built with asyncio for non-blocking operations
- Lightweight: Minimal overhead and memory footprint
- Easy to use: Simple API for connecting and listening to DCS data
- Event-driven: Register callbacks for specific controls or values
First, make sure you have Python 3.8 or higher installed.
Install dcs-link using pip:
pip install dcs_linkOr install in development mode:
pip install -e .To use this library, you need:
- DCS World installed
- DCS-BIOS installed and configured
- Download from: https://github.com/DCS-Skunkworks/dcs-bios
- Follow installation instructions in the DCS-BIOS documentation
- DCS-INSIGHT installed and configured (for advanced API calls)
- Download from: https://github.com/DCS-Skunkworks/DCS-INSIGHT
- Follow installation instructions in the DCS-INSIGHT documentation
Check the examples directory for usage examples:
- Basic example - Shows basic usage with both DCS-BIOS and DCS-INSIGHT
Main class for interacting with DCS-BIOS and DCS-INSIGHT.
bios, insight = DCSLink(config: Optional[LinkConfig] = None)Returns a tuple containing BiosClient and InsightClient instances.
Client for interacting with DCS-BIOS.
connect(timeout: Optional[float] = None)- Connect to DCS-BIOSon(event_name: str, handler: Callable)- Register listener for control changesoff(event_name: str)- Remove listenersend(command: str)- Send command to DCSclose()- Close connection
aircraft_name- Current aircraft nameevents- Set of all available events for the current aircraft
Client for interacting with DCS-INSIGHT.
connect(timeout: Optional[float] = None)- Connect to DCS-INSIGHTcall(command: str, timeout: float = 5.0, **kwargs)- Call DCS-INSIGHT API functionclose()- Close connection
apis- Set of all available API functions
Configuration class for DCSLink.
config = LinkConfig(
json_dir="", # Path to DCS-BIOS JSON files (auto-detected if empty)
log_enable=True, # Enable logging
log_level=20, # Logging level (default is INFO)
network=NetworkConfig() # Network configuration
)Network configuration for DCS-BIOS and DCS-INSIGHT connections.
network_config = NetworkConfig(
server_ip='127.0.0.1', # Server IP address
multicast_group='239.255.50.10', # Multicast group IP
loopback_interface="", # Loopback interface
receive_port=5010, # Port to receive data from DCS-BIOS
send_port=7778, # Port to send commands to DCS-BIOS
call_port=7790 # Port for DCS-INSIGHT API calls
)This project is licensed under the MIT License - see the LICENSE file for details.