ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0.6 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://pypi.org/project/SimConnect/ |
| Last Crawled | 2026-03-29 22:08:59 (18 days ago) |
| First Indexed | 2020-09-25 22:24:24 (5 years ago) |
| HTTP Status Code | 200 |
| Meta Title | SimConnect · PyPI |
| Meta Description | Adds a pythonic wrapper for SimConnect SDK. |
| Meta Canonical | null |
| Boilerpipe Text | Python-SimConnect
Python interface for Microsoft Flight Simulator 2020 (MSFS2020) using SimConnect
This library allows Python scripts to read and set variables within MSFS2020 and trigger events within the simulation.
It also includes, as an example, "Cockpit Companion", a flask mini http server which runs locally. It provides a web UI with a moving map and simulation variables. It also provides simulation data in JSON format in response to REST API requests.
Full documentation for this example can be found at
https://msfs2020.cc
and it is included in a standalone repo here on Github as
MSFS2020-cockpit-companion
.
Mobiflight Simconnect events:
Yes this supports the new
SimConnect commands that DocMoebiuz
of
MobiFlight
developed.
A full list of
commands and install instructions
At this time MobiFlight SimConnect commands are not include in the AircraftEvents class and as so the AircraftEvents.find() and AircraftEvents.get() will not work. You will need to pass the Event ID to a new Event class as the Example below shows.
from
SimConnect
import
*
# Create SimConnect link
sm
=
SimConnect
()
# Creat a function to call the MobiFlight AS1000_MFD_SOFTKEYS_3 event.
Sk3
=
Event
(
b
'MobiFlight.AS1000_MFD_SOFTKEYS_3'
,
sm
)
# Call the Event.
Sk3
()
sm
.
exit
()
quit
()
Python interface example
from
SimConnect
import
*
# Create SimConnect link
sm
=
SimConnect
()
# Note the default _time is 2000 to be refreshed every 2 seconds
aq
=
AircraftRequests
(
sm
,
_time
=
2000
)
# Use _time=ms where ms is the time in milliseconds to cache the data.
# Setting ms to 0 will disable data caching and always pull new data from the sim.
# There is still a timeout of 4 tries with a 10ms delay between checks.
# If no data is received in 40ms the value will be set to None
# Each request can be fine tuned by setting the time param.
# To find and set timeout of cached data to 200ms:
altitude
=
aq
.
find
(
"PLANE_ALTITUDE"
)
altitude
.
time
=
200
# Get the aircraft's current altitude
altitude
=
aq
.
get
(
"PLANE_ALTITUDE"
)
altitude
=
altitude
+
1000
# Set the aircraft's current altitude
aq
.
set
(
"PLANE_ALTITUDE"
,
altitude
)
ae
=
AircraftEvents
(
sm
)
# Trigger a simple event
event_to_trigger
=
ae
.
find
(
"AP_MASTER"
)
# Toggles autopilot on or off
event_to_trigger
()
# Trigger an event while passing a variable
target_altitude
=
15000
event_to_trigger
=
ae
.
find
(
"AP_ALT_VAR_SET_ENGLISH"
)
# Sets AP autopilot hold level
event_to_trigger
(
target_altitude
)
sm
.
exit
()
quit
()
HTTP interface example
Run
glass_server.py
using Python 3.
http://localhost:5000
Method: GET
Variables: None
Output: Web interface with moving map and aircraft information
http://localhost:5000/dataset/<dataset_name>
Method: GET
Arguments to pass:
Argument
Location
Description
dataset_name
in path
can be navigation, airspeed compass, vertical_speed, fuel, flaps, throttle, gear, trim, autopilot, cabin
Description: Returns set of variables from simulator in JSON format
http://localhost:5000/datapoint/<datapoint_name>/get
Method: GET
Arguments to pass:
Argument
Location
Description
datapoint_name
in path
any variable name from MS SimConnect documentation
Description: Returns individual variable from simulator in JSON format
http://localhost:5000/datapoint/<datapoint_name>/set
Method: POST
Arguments to pass:
Argument
Location
Description
datapoint_name
in path
any variable name from MS SimConnect documentation
index (optional)
form or json
the relevant index if required (eg engine number) - if not passed defaults to None
value_to_use (optional)
value to set variable to - if not passed defaults to 0
Description: Sets datapoint in the simulator
http://localhost:5000/event/<event_name>/trigger
Method: POST
Arguments to pass:
Argument
Location
Description
event_name
in path
any event name from MS SimConnect documentation
value_to_use (optional)
value to pass to the event
Description: Triggers an event in the simulator
Running SimConnect on a separate system.
Note: At this time SimConnect can only run on Windows hosts.
Create a file called SimConnect.cfg in the same folder as your script.
Sample SimConnect.cfg:
; Example SimConnect client configurations
[SimConnect]
Protocol
=
IPv4
Address
=
<ip of server>
Port
=
500
To enable the host running the sim to share over network,
add <Address>0.0.0.0</Address>
under the <Port>500</Port> in SimConnect.xml
SimConnect.xml can be located at
%AppData%\Microsoft Flight Simulator\SimConnect.xml
Sample SimConnect.xml:
<?xml version="1.0" encoding="Windows-1252"?>
<SimBase.Document
Type=
"SimConnect"
version=
"1,0"
>
<Descr>
SimConnect
Server
Configuration
</Descr>
<Filename>
SimConnect.xml
</Filename>
<SimConnect.Comm>
<Descr>
Static
IP4
port
</Descr>
<Protocol>
IPv4
</Protocol>
<Scope>
local
</Scope>
<Port>
500
</Port>
<Address>
0.0.0.0
</Address>
<MaxClients>
64
</MaxClients>
<MaxRecvSize>
41088
</MaxRecvSize>
</SimConnect.Comm>
...
Notes:
Python 64-bit is needed. You may see this Error if running 32-bit python:
OSError: [WinError 193] %1 is not a valid Win32 application
Per mracko on COM_RADIO_SET:
MSFS uses the European COM frequency spacing of 8.33kHz for all default aircraft.
This means that in practice, you increment the frequency by 0.005 MHz and
skip x.x20, x.x45, x.x70, and x.x95 MHz frequencies.
Have a look here http://g3asr.co.uk/calculators/833kHz.htm
Events and Variables
Below are links to the Microsoft documentation
Function
Event IDs
Simulation Variables |
| Markdown | [Skip to main content](https://pypi.org/project/SimConnect/#content)
Switch to mobile version
Warning Some features may not work without JavaScript. Please try enabling it if you encounter problems.
[](https://pypi.org/)
- [Help](https://pypi.org/help/)
- [Docs](https://docs.pypi.org/)
- [Sponsors](https://pypi.org/sponsors/)
- [Log in](https://pypi.org/account/login/?next=https%3A%2F%2Fpypi.org%2Fproject%2FSimConnect%2F)
- [Register](https://pypi.org/account/register/)
Menu
- [Help](https://pypi.org/help/)
- [Docs](https://docs.pypi.org/)
- [Sponsors](https://pypi.org/sponsors/)
- [Log in](https://pypi.org/account/login/?next=https%3A%2F%2Fpypi.org%2Fproject%2FSimConnect%2F)
- [Register](https://pypi.org/account/register/)
# SimConnect 0.4.26
pip install SimConnect Copy PIP instructions
[Latest version](https://pypi.org/project/SimConnect/)
Released: Jun 15, 2022
Adds a pythonic wrapper for SimConnect SDK.
### Navigation
- [Project description](https://pypi.org/project/SimConnect/#description)
- [Release history](https://pypi.org/project/SimConnect/#history)
- [Download files](https://pypi.org/project/SimConnect/#files)
### Verified details
*These details have been [verified by PyPI](https://docs.pypi.org/project_metadata/#verified-details)*
###### Maintainers
[ odwdinc](https://pypi.org/user/odwdinc/)
### Unverified details
*These details have **not** been verified by PyPI*
###### Project links
- [Homepage](https://github.com/odwdinc/Python-SimConnect)
###### Meta
- **License:** GNU Affero General Public License v3 or later (AGPLv3+) (AGPL 3.0)
- **Author:** [Anthony Pray](mailto:anthony.pray@gmail.com)
- **Maintainer:** [Anthony Pray](mailto:anthony.pray@gmail.com)
- Tags ctypes , FlightSim , SimConnect , Flight , Simulator
- **Requires:** Python \>=3.6
###### Classifiers
- **Development Status**
- [2 - Pre-Alpha](https://pypi.org/search/?c=Development+Status+%3A%3A+2+-+Pre-Alpha)
- **Environment**
- [Console](https://pypi.org/search/?c=Environment+%3A%3A+Console)
- **Intended Audience**
- [Developers](https://pypi.org/search/?c=Intended+Audience+%3A%3A+Developers)
- **License**
- [OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)](https://pypi.org/search/?c=License+%3A%3A+OSI+Approved+%3A%3A+GNU+Affero+General+Public+License+v3+or+later+%28AGPLv3%2B%29)
- **Operating System**
- [OS Independent](https://pypi.org/search/?c=Operating+System+%3A%3A+OS+Independent)
- **Programming Language**
- [Python](https://pypi.org/search/?c=Programming+Language+%3A%3A+Python)
- [Python :: 3](https://pypi.org/search/?c=Programming+Language+%3A%3A+Python+%3A%3A+3)
- [Python :: 3.6](https://pypi.org/search/?c=Programming+Language+%3A%3A+Python+%3A%3A+3.6)
- [Python :: 3.7](https://pypi.org/search/?c=Programming+Language+%3A%3A+Python+%3A%3A+3.7)
- [Python :: 3.8](https://pypi.org/search/?c=Programming+Language+%3A%3A+Python+%3A%3A+3.8)
- [Python :: Implementation :: CPython](https://pypi.org/search/?c=Programming+Language+%3A%3A+Python+%3A%3A+Implementation+%3A%3A+CPython)
[Report project as malware](https://pypi.org/project/SimConnect/submit-malware-report/)
- [Project description](https://pypi.org/project/SimConnect/#description)
- [Project details](https://pypi.org/project/SimConnect/#data)
- [Release history](https://pypi.org/project/SimConnect/#history)
- [Download files](https://pypi.org/project/SimConnect/#files)
## Project description
[](https://badge.fury.io/py/SimConnect)
# Python-SimConnect
Python interface for Microsoft Flight Simulator 2020 (MSFS2020) using SimConnect
This library allows Python scripts to read and set variables within MSFS2020 and trigger events within the simulation.
It also includes, as an example, "Cockpit Companion", a flask mini http server which runs locally. It provides a web UI with a moving map and simulation variables. It also provides simulation data in JSON format in response to REST API requests.
Full documentation for this example can be found at <https://msfs2020.cc> and it is included in a standalone repo here on Github as [MSFS2020-cockpit-companion](https://github.com/hankhank10/MSFS2020-cockpit-companion).
## Mobiflight Simconnect events:
Yes this supports the new [SimConnect commands that DocMoebiuz](https://forums.flightsimulator.com/t/full-g1000-control-now-with-mobiflight/348509) of [MobiFlight](https://www.mobiflight.com/en/index.html) developed. A full list of [commands and install instructions](https://pastebin.com/fMdB7at2)
At this time MobiFlight SimConnect commands are not include in the AircraftEvents class and as so the AircraftEvents.find() and AircraftEvents.get() will not work. You will need to pass the Event ID to a new Event class as the Example below shows.
```
from SimConnect import *
# Create SimConnect link
sm = SimConnect()
# Creat a function to call the MobiFlight AS1000_MFD_SOFTKEYS_3 event.
Sk3 = Event(b'MobiFlight.AS1000_MFD_SOFTKEYS_3', sm)
# Call the Event.
Sk3()
sm.exit()
quit()
```
## Python interface example
```
from SimConnect import *
# Create SimConnect link
sm = SimConnect()
# Note the default _time is 2000 to be refreshed every 2 seconds
aq = AircraftRequests(sm, _time=2000)
# Use _time=ms where ms is the time in milliseconds to cache the data.
# Setting ms to 0 will disable data caching and always pull new data from the sim.
# There is still a timeout of 4 tries with a 10ms delay between checks.
# If no data is received in 40ms the value will be set to None
# Each request can be fine tuned by setting the time param.
# To find and set timeout of cached data to 200ms:
altitude = aq.find("PLANE_ALTITUDE")
altitude.time = 200
# Get the aircraft's current altitude
altitude = aq.get("PLANE_ALTITUDE")
altitude = altitude + 1000
# Set the aircraft's current altitude
aq.set("PLANE_ALTITUDE", altitude)
ae = AircraftEvents(sm)
# Trigger a simple event
event_to_trigger = ae.find("AP_MASTER") # Toggles autopilot on or off
event_to_trigger()
# Trigger an event while passing a variable
target_altitude = 15000
event_to_trigger = ae.find("AP_ALT_VAR_SET_ENGLISH") # Sets AP autopilot hold level
event_to_trigger(target_altitude)
sm.exit()
quit()
```
## HTTP interface example
Run `glass_server.py` using Python 3.
#### `http://localhost:5000`
Method: GET
Variables: None
Output: Web interface with moving map and aircraft information
#### `http://localhost:5000/dataset/<dataset_name>`
Method: GET
Arguments to pass:
| Argument | Location | Description |
|---|---|---|
| dataset\_name | in path | can be navigation, airspeed compass, vertical\_speed, fuel, flaps, throttle, gear, trim, autopilot, cabin |
Description: Returns set of variables from simulator in JSON format
#### `http://localhost:5000/datapoint/<datapoint_name>/get`
Method: GET
Arguments to pass:
| Argument | Location | Description |
|---|---|---|
| datapoint\_name | in path | any variable name from MS SimConnect documentation |
Description: Returns individual variable from simulator in JSON format
#### `http://localhost:5000/datapoint/<datapoint_name>/set`
Method: POST
Arguments to pass:
| Argument | Location | Description |
|---|---|---|
| datapoint\_name | in path | any variable name from MS SimConnect documentation |
| index (optional) | form or json | the relevant index if required (eg engine number) - if not passed defaults to None |
| value\_to\_use (optional) | value to set variable to - if not passed defaults to 0 | |
Description: Sets datapoint in the simulator
#### `http://localhost:5000/event/<event_name>/trigger`
Method: POST
Arguments to pass:
| Argument | Location | Description |
|---|---|---|
| event\_name | in path | any event name from MS SimConnect documentation |
| value\_to\_use (optional) | value to pass to the event | |
Description: Triggers an event in the simulator
## Running SimConnect on a separate system.
#### Note: At this time SimConnect can only run on Windows hosts.
Create a file called SimConnect.cfg in the same folder as your script.
#### Sample SimConnect.cfg:
```
; Example SimConnect client configurations
[SimConnect]
Protocol=IPv4
Address=<ip of server>
Port=500
```
To enable the host running the sim to share over network,
add \<Address\>0.0.0.0\</Address\>
under the \<Port\>500\</Port\> in SimConnect.xml
SimConnect.xml can be located at
#### `%AppData%\Microsoft Flight Simulator\SimConnect.xml`
#### Sample SimConnect.xml:
```
<?xml version="1.0" encoding="Windows-1252"?>
<SimBase.Document Type="SimConnect" version="1,0">
<Descr>SimConnect Server Configuration</Descr>
<Filename>SimConnect.xml</Filename>
<SimConnect.Comm>
<Descr>Static IP4 port</Descr>
<Protocol>IPv4</Protocol>
<Scope>local</Scope>
<Port>500</Port>
<Address>0.0.0.0</Address>
<MaxClients>64</MaxClients>
<MaxRecvSize>41088</MaxRecvSize>
</SimConnect.Comm>
...
```
## Notes:
Python 64-bit is needed. You may see this Error if running 32-bit python:
`OSError: [WinError 193] %1 is not a valid Win32 application`
Per mracko on COM\_RADIO\_SET:
```
MSFS uses the European COM frequency spacing of 8.33kHz for all default aircraft.
This means that in practice, you increment the frequency by 0.005 MHz and
skip x.x20, x.x45, x.x70, and x.x95 MHz frequencies.
Have a look here http://g3asr.co.uk/calculators/833kHz.htm
```
## Events and Variables
Below are links to the Microsoft documentation
[Function](https://docs.microsoft.com/en-us/previous-versions/microsoft-esp/cc526983\(v=msdn.10\))
[Event IDs](https://docs.microsoft.com/en-us/previous-versions/microsoft-esp/cc526980\(v=msdn.10\))
[Simulation Variables](https://docs.flightsimulator.com/html/Programming_Tools/SimVars/Simulation_Variables.htm)
## Project details
### Verified details
*These details have been [verified by PyPI](https://docs.pypi.org/project_metadata/#verified-details)*
###### Maintainers
[ odwdinc](https://pypi.org/user/odwdinc/)
### Unverified details
*These details have **not** been verified by PyPI*
###### Project links
- [Homepage](https://github.com/odwdinc/Python-SimConnect)
###### Meta
- **License:** GNU Affero General Public License v3 or later (AGPLv3+) (AGPL 3.0)
- **Author:** [Anthony Pray](mailto:anthony.pray@gmail.com)
- **Maintainer:** [Anthony Pray](mailto:anthony.pray@gmail.com)
- Tags ctypes , FlightSim , SimConnect , Flight , Simulator
- **Requires:** Python \>=3.6
###### Classifiers
- **Development Status**
- [2 - Pre-Alpha](https://pypi.org/search/?c=Development+Status+%3A%3A+2+-+Pre-Alpha)
- **Environment**
- [Console](https://pypi.org/search/?c=Environment+%3A%3A+Console)
- **Intended Audience**
- [Developers](https://pypi.org/search/?c=Intended+Audience+%3A%3A+Developers)
- **License**
- [OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)](https://pypi.org/search/?c=License+%3A%3A+OSI+Approved+%3A%3A+GNU+Affero+General+Public+License+v3+or+later+%28AGPLv3%2B%29)
- **Operating System**
- [OS Independent](https://pypi.org/search/?c=Operating+System+%3A%3A+OS+Independent)
- **Programming Language**
- [Python](https://pypi.org/search/?c=Programming+Language+%3A%3A+Python)
- [Python :: 3](https://pypi.org/search/?c=Programming+Language+%3A%3A+Python+%3A%3A+3)
- [Python :: 3.6](https://pypi.org/search/?c=Programming+Language+%3A%3A+Python+%3A%3A+3.6)
- [Python :: 3.7](https://pypi.org/search/?c=Programming+Language+%3A%3A+Python+%3A%3A+3.7)
- [Python :: 3.8](https://pypi.org/search/?c=Programming+Language+%3A%3A+Python+%3A%3A+3.8)
- [Python :: Implementation :: CPython](https://pypi.org/search/?c=Programming+Language+%3A%3A+Python+%3A%3A+Implementation+%3A%3A+CPython)
## Release history [Release notifications](https://pypi.org/help/#project-release-notifications) \| [RSS feed](https://pypi.org/rss/project/simconnect/releases.xml)
This version

[0\.4.26 Jun 15, 2022](https://pypi.org/project/SimConnect/0.4.26/)

[0\.4.25 Feb 13, 2022](https://pypi.org/project/SimConnect/0.4.25/)

[0\.4.24 Apr 18, 2021](https://pypi.org/project/SimConnect/0.4.24/)

[0\.4.23 Jan 2, 2021](https://pypi.org/project/SimConnect/0.4.23/)

[0\.4.22 Dec 29, 2020](https://pypi.org/project/SimConnect/0.4.22/)

[0\.4.21 Nov 15, 2020](https://pypi.org/project/SimConnect/0.4.21/)

[0\.4.20 Nov 1, 2020](https://pypi.org/project/SimConnect/0.4.20/)

[0\.4.19 Oct 24, 2020](https://pypi.org/project/SimConnect/0.4.19/)

[0\.4.18 Oct 16, 2020](https://pypi.org/project/SimConnect/0.4.18/)

[0\.4.17 Oct 16, 2020](https://pypi.org/project/SimConnect/0.4.17/)

[0\.4.16 Oct 10, 2020](https://pypi.org/project/SimConnect/0.4.16/)

[0\.4.15 Oct 4, 2020](https://pypi.org/project/SimConnect/0.4.15/)

[0\.4.14 Oct 1, 2020](https://pypi.org/project/SimConnect/0.4.14/)

[0\.4.13 Oct 1, 2020](https://pypi.org/project/SimConnect/0.4.13/)

[0\.4.12 Sep 26, 2020](https://pypi.org/project/SimConnect/0.4.12/)

[0\.4.11 Sep 21, 2020](https://pypi.org/project/SimConnect/0.4.11/)

[0\.4.10 Sep 21, 2020](https://pypi.org/project/SimConnect/0.4.10/)

[0\.4.9 Sep 20, 2020](https://pypi.org/project/SimConnect/0.4.9/)

[0\.4.8 Sep 19, 2020](https://pypi.org/project/SimConnect/0.4.8/)

[0\.4.7 Sep 19, 2020](https://pypi.org/project/SimConnect/0.4.7/)

[0\.4.6 Sep 18, 2020](https://pypi.org/project/SimConnect/0.4.6/)

[0\.4.5 Sep 16, 2020](https://pypi.org/project/SimConnect/0.4.5/)

[0\.4.4 Sep 15, 2020](https://pypi.org/project/SimConnect/0.4.4/)

[0\.4.3 Sep 13, 2020](https://pypi.org/project/SimConnect/0.4.3/)

[0\.4.2 Sep 11, 2020](https://pypi.org/project/SimConnect/0.4.2/)

[0\.4.1 Sep 10, 2020](https://pypi.org/project/SimConnect/0.4.1/)

[0\.4.0 Sep 10, 2020](https://pypi.org/project/SimConnect/0.4.0/)

[0\.3.73 Sep 10, 2020](https://pypi.org/project/SimConnect/0.3.73/)

[0\.3.72 Sep 10, 2020](https://pypi.org/project/SimConnect/0.3.72/)

[0\.3.71 Sep 10, 2020](https://pypi.org/project/SimConnect/0.3.71/)

[0\.3.8 Sep 10, 2020](https://pypi.org/project/SimConnect/0.3.8/)

[0\.3.7 Sep 10, 2020](https://pypi.org/project/SimConnect/0.3.7/)

[0\.3.6 Sep 10, 2020](https://pypi.org/project/SimConnect/0.3.6/)

[0\.3.5 Sep 9, 2020](https://pypi.org/project/SimConnect/0.3.5/)

[0\.3.4 Sep 9, 2020](https://pypi.org/project/SimConnect/0.3.4/)

[0\.3.3 Sep 8, 2020](https://pypi.org/project/SimConnect/0.3.3/)

[0\.3.2 Sep 7, 2020](https://pypi.org/project/SimConnect/0.3.2/)

[0\.3.1 Sep 7, 2020](https://pypi.org/project/SimConnect/0.3.1/)

[0\.3 Sep 6, 2020](https://pypi.org/project/SimConnect/0.3/)

[0\.2 Sep 6, 2020](https://pypi.org/project/SimConnect/0.2/)

[0\.1 Sep 4, 2020](https://pypi.org/project/SimConnect/0.1/)
## Download files
Download the file for your platform. If you're not sure which to choose, learn more about [installing packages](https://packaging.python.org/tutorials/installing-packages/ "External link").
### Source Distribution
[SimConnect-0.4.26.tar.gz](https://files.pythonhosted.org/packages/41/26/5481c132dcab9bbdd2fb85954d5608f87f387abed0dd3788353b05aa8cb3/SimConnect-0.4.26.tar.gz) (98.0 kB [view details](https://pypi.org/project/SimConnect/#SimConnect-0.4.26.tar.gz))
Uploaded Jun 15, 2022 `Source`
### Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about [wheel file names](https://packaging.python.org/en/latest/specifications/binary-distribution-format/ "External link").
The dropdown lists show the available interpreters, ABIs, and platforms.
Enable javascript to be able to filter the list of wheel files.
Copy a direct link to the current filters <https://pypi.org/project/SimConnect/#files> Copy
Showing 1 of 1 file.
File name
Interpreter
ABI
Platform
[SimConnect-0.4.26-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/76/bf/3baa88079144b6e5ab224b76725fa36f502554e95b9c27c42bac9c6de48f/SimConnect-0.4.26-py2.py3-none-any.whl) (96.1 kB [view details](https://pypi.org/project/SimConnect/#SimConnect-0.4.26-py2.py3-none-any.whl))
Uploaded Jun 15, 2022 `Python 2``Python 3`
## File details
Details for the file `SimConnect-0.4.26.tar.gz`.
### File metadata
- Download URL: [SimConnect-0.4.26.tar.gz](https://files.pythonhosted.org/packages/41/26/5481c132dcab9bbdd2fb85954d5608f87f387abed0dd3788353b05aa8cb3/SimConnect-0.4.26.tar.gz)
- Upload date:
Jun 15, 2022
- Size: 98.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
### File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | `9fb7574ed5dc9f407c290f47ba3fcc529946e7e728b2090c2b091f5f54c656b4` | Copy |
| MD5 | `0082b0a9717c06434668ca97afeb46d9` | Copy |
| BLAKE2b-256 | `41265481c132dcab9bbdd2fb85954d5608f87f387abed0dd3788353b05aa8cb3` | Copy |
[See more details on using hashes here.](https://pip.pypa.io/en/stable/topics/secure-installs/#hash-checking-mode "External link")
## File details
Details for the file `SimConnect-0.4.26-py2.py3-none-any.whl`.
### File metadata
- Download URL: [SimConnect-0.4.26-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/76/bf/3baa88079144b6e5ab224b76725fa36f502554e95b9c27c42bac9c6de48f/SimConnect-0.4.26-py2.py3-none-any.whl)
- Upload date:
Jun 15, 2022
- Size: 96.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
### File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | `b77ca43f52df236a34f1f6b1b7c7cfdb0ff5677f86f8a6fd2c1819078fe07d76` | Copy |
| MD5 | `1202c3be5b00397e888d3c48b4d7a741` | Copy |
| BLAKE2b-256 | `76bf3baa88079144b6e5ab224b76725fa36f502554e95b9c27c42bac9c6de48f` | Copy |
[See more details on using hashes here.](https://pip.pypa.io/en/stable/topics/secure-installs/#hash-checking-mode "External link")

## Help
- [Installing packages](https://packaging.python.org/tutorials/installing-packages/ "External link")
- [Uploading packages](https://packaging.python.org/tutorials/packaging-projects/ "External link")
- [User guide](https://packaging.python.org/ "External link")
- [Project name retention](https://www.python.org/dev/peps/pep-0541/ "External link")
- [FAQs](https://pypi.org/help/)
## About PyPI
- [PyPI Blog](https://blog.pypi.org/ "External link")
- [Infrastructure dashboard](https://dtdg.co/pypi "External link")
- [Statistics](https://pypi.org/stats/)
- [Logos & trademarks](https://pypi.org/trademarks/)
- [Our sponsors](https://pypi.org/sponsors/)
## Contributing to PyPI
- [Bugs and feedback](https://pypi.org/help/#feedback)
- [Contribute on GitHub](https://github.com/pypi/warehouse "External link")
- [Translate PyPI](https://hosted.weblate.org/projects/pypa/warehouse/ "External link")
- [Sponsor PyPI](https://pypi.org/sponsors/)
- [Development credits](https://github.com/pypi/warehouse/graphs/contributors "External link")
## Using PyPI
- [Terms of Service](https://policies.python.org/pypi.org/Terms-of-Service/ "External link")
- [Report security issue](https://pypi.org/security/)
- [Code of conduct](https://policies.python.org/python.org/code-of-conduct/ "External link")
- [Privacy Notice](https://policies.python.org/pypi.org/Privacy-Notice/ "External link")
- [Acceptable Use Policy](https://policies.python.org/pypi.org/Acceptable-Use-Policy/ "External link")
***
Status: [all systems operational](https://status.python.org/ "External link")
Developed and maintained by the Python community, for the Python community.
[Donate today\!](https://donate.pypi.org/)
"PyPI", "Python Package Index", and the blocks logos are registered [trademarks](https://pypi.org/trademarks/) of the [Python Software Foundation](https://www.python.org/psf-landing).
© 2026 [Python Software Foundation](https://www.python.org/psf-landing/ "External link")
[Site map](https://pypi.org/sitemap/)
Switch to desktop version
Supported by
[ AWS Cloud computing and Security Sponsor](https://aws.amazon.com/) [ Datadog Monitoring](https://www.datadoghq.com/) [ Depot Continuous Integration](https://depot.dev/) [ Fastly CDN](https://www.fastly.com/) [ Google Download Analytics](https://careers.google.com/) [ Pingdom Monitoring](https://www.pingdom.com/) [ Sentry Error logging](https://sentry.io/for/python/?utm_source=pypi&utm_medium=paid-community&utm_campaign=python-na-evergreen&utm_content=static-ad-pypi-sponsor-learnmore) [ StatusPage Status page](https://statuspage.io/) |
| Readable Markdown | [](https://badge.fury.io/py/SimConnect)
## Python-SimConnect
Python interface for Microsoft Flight Simulator 2020 (MSFS2020) using SimConnect
This library allows Python scripts to read and set variables within MSFS2020 and trigger events within the simulation.
It also includes, as an example, "Cockpit Companion", a flask mini http server which runs locally. It provides a web UI with a moving map and simulation variables. It also provides simulation data in JSON format in response to REST API requests.
Full documentation for this example can be found at [https://msfs2020.cc](https://msfs2020.cc/) and it is included in a standalone repo here on Github as [MSFS2020-cockpit-companion](https://github.com/hankhank10/MSFS2020-cockpit-companion).
## Mobiflight Simconnect events:
Yes this supports the new [SimConnect commands that DocMoebiuz](https://forums.flightsimulator.com/t/full-g1000-control-now-with-mobiflight/348509) of [MobiFlight](https://www.mobiflight.com/en/index.html) developed. A full list of [commands and install instructions](https://pastebin.com/fMdB7at2)
At this time MobiFlight SimConnect commands are not include in the AircraftEvents class and as so the AircraftEvents.find() and AircraftEvents.get() will not work. You will need to pass the Event ID to a new Event class as the Example below shows.
```
from SimConnect import *
# Create SimConnect link
sm = SimConnect()
# Creat a function to call the MobiFlight AS1000_MFD_SOFTKEYS_3 event.
Sk3 = Event(b'MobiFlight.AS1000_MFD_SOFTKEYS_3', sm)
# Call the Event.
Sk3()
sm.exit()
quit()
```
## Python interface example
```
from SimConnect import *
# Create SimConnect link
sm = SimConnect()
# Note the default _time is 2000 to be refreshed every 2 seconds
aq = AircraftRequests(sm, _time=2000)
# Use _time=ms where ms is the time in milliseconds to cache the data.
# Setting ms to 0 will disable data caching and always pull new data from the sim.
# There is still a timeout of 4 tries with a 10ms delay between checks.
# If no data is received in 40ms the value will be set to None
# Each request can be fine tuned by setting the time param.
# To find and set timeout of cached data to 200ms:
altitude = aq.find("PLANE_ALTITUDE")
altitude.time = 200
# Get the aircraft's current altitude
altitude = aq.get("PLANE_ALTITUDE")
altitude = altitude + 1000
# Set the aircraft's current altitude
aq.set("PLANE_ALTITUDE", altitude)
ae = AircraftEvents(sm)
# Trigger a simple event
event_to_trigger = ae.find("AP_MASTER") # Toggles autopilot on or off
event_to_trigger()
# Trigger an event while passing a variable
target_altitude = 15000
event_to_trigger = ae.find("AP_ALT_VAR_SET_ENGLISH") # Sets AP autopilot hold level
event_to_trigger(target_altitude)
sm.exit()
quit()
```
## HTTP interface example
Run `glass_server.py` using Python 3.
#### `http://localhost:5000`
Method: GET
Variables: None
Output: Web interface with moving map and aircraft information
#### `http://localhost:5000/dataset/<dataset_name>`
Method: GET
Arguments to pass:
| Argument | Location | Description |
|---|---|---|
| dataset\_name | in path | can be navigation, airspeed compass, vertical\_speed, fuel, flaps, throttle, gear, trim, autopilot, cabin |
Description: Returns set of variables from simulator in JSON format
#### `http://localhost:5000/datapoint/<datapoint_name>/get`
Method: GET
Arguments to pass:
| Argument | Location | Description |
|---|---|---|
| datapoint\_name | in path | any variable name from MS SimConnect documentation |
Description: Returns individual variable from simulator in JSON format
#### `http://localhost:5000/datapoint/<datapoint_name>/set`
Method: POST
Arguments to pass:
| Argument | Location | Description |
|---|---|---|
| datapoint\_name | in path | any variable name from MS SimConnect documentation |
| index (optional) | form or json | the relevant index if required (eg engine number) - if not passed defaults to None |
| value\_to\_use (optional) | value to set variable to - if not passed defaults to 0 | |
Description: Sets datapoint in the simulator
#### `http://localhost:5000/event/<event_name>/trigger`
Method: POST
Arguments to pass:
| Argument | Location | Description |
|---|---|---|
| event\_name | in path | any event name from MS SimConnect documentation |
| value\_to\_use (optional) | value to pass to the event | |
Description: Triggers an event in the simulator
## Running SimConnect on a separate system.
#### Note: At this time SimConnect can only run on Windows hosts.
Create a file called SimConnect.cfg in the same folder as your script.
#### Sample SimConnect.cfg:
```
; Example SimConnect client configurations
[SimConnect]
Protocol=IPv4
Address=<ip of server>
Port=500
```
To enable the host running the sim to share over network,
add \<Address\>0.0.0.0\</Address\>
under the \<Port\>500\</Port\> in SimConnect.xml
SimConnect.xml can be located at
#### `%AppData%\Microsoft Flight Simulator\SimConnect.xml`
#### Sample SimConnect.xml:
```
<?xml version="1.0" encoding="Windows-1252"?>
<SimBase.Document Type="SimConnect" version="1,0">
<Descr>SimConnect Server Configuration</Descr>
<Filename>SimConnect.xml</Filename>
<SimConnect.Comm>
<Descr>Static IP4 port</Descr>
<Protocol>IPv4</Protocol>
<Scope>local</Scope>
<Port>500</Port>
<Address>0.0.0.0</Address>
<MaxClients>64</MaxClients>
<MaxRecvSize>41088</MaxRecvSize>
</SimConnect.Comm>
...
```
## Notes:
Python 64-bit is needed. You may see this Error if running 32-bit python:
`OSError: [WinError 193] %1 is not a valid Win32 application`
Per mracko on COM\_RADIO\_SET:
```
MSFS uses the European COM frequency spacing of 8.33kHz for all default aircraft.
This means that in practice, you increment the frequency by 0.005 MHz and
skip x.x20, x.x45, x.x70, and x.x95 MHz frequencies.
Have a look here http://g3asr.co.uk/calculators/833kHz.htm
```
## Events and Variables
Below are links to the Microsoft documentation
[Function](https://docs.microsoft.com/en-us/previous-versions/microsoft-esp/cc526983\(v=msdn.10\))
[Event IDs](https://docs.microsoft.com/en-us/previous-versions/microsoft-esp/cc526980\(v=msdn.10\))
[Simulation Variables](https://docs.flightsimulator.com/html/Programming_Tools/SimVars/Simulation_Variables.htm) |
| Shard | 59 (laksa) |
| Root Hash | 7813724874982801459 |
| Unparsed URL | org,pypi!/project/SimConnect/ s443 |