# dronekit/dronekit-python architecture

> Architecture diagram of the GitHub repository dronekit/dronekit-python, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dronekit/dronekit-python
- Repository: https://github.com/dronekit/dronekit-python

## Overview

DroneKit-Python is a Python API for applications that communicate with UAVs over MAVLink. The main workflow is an application connecting to a vehicle, receiving its telemetry and state, then managing missions or issuing direct control operations. The README documents these capabilities; sampled source shows vehicle initialization, message-driven attribute updates, and MAVLink transport threads. The central API is concentrated in one large module, so several domain responsibilities share its path. Unsampled capabilities are represented from README descriptions, without asserting unverified internal call paths.

Main entry points: [`dronekit/__init__.py`](https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py) (Vehicle API), [`dronekit/mavlink.py`](https://github.com/dronekit/dronekit-python/blob/master/dronekit/mavlink.py) (MAVLink handler), [`dronekit/util.py`](https://github.com/dronekit/dronekit-python/blob/master/dronekit/util.py) (Logging utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Vehicle API"]
  node_connect["Connection setup<br/>[__init__.py]"]
  node_vehicle["Vehicle API<br/>[__init__.py]"]
  node_listeners["Message listeners<br/>[__init__.py]"]
  node_util["Logging utilities<br/>[util.py]"]
end

subgraph group_domains["Vehicle Capabilities"]
  node_telemetry["Telemetry locations<br/>[__init__.py]"]
  node_state["Vehicle state<br/>[__init__.py]"]
  node_parameters["Parameters<br/>[__init__.py]"]
  node_missions["Mission management<br/>[__init__.py]"]
  node_control["Movement control<br/>[__init__.py]"]
  node_gimbal["Gimbal status<br/>[__init__.py]"]
end

subgraph group_transport["MAVLink Transport"]
  node_handler["MAVLink handler<br/>[mavlink.py]"]
end

node_developer(("App developer"))
node_application["Python application"]
node_pymavlink["pymavlink"]

node_developer -->|"creates"| node_application
node_application -->|"connects through"| node_connect
node_connect -->|"returns"| node_vehicle
node_application -->|"queries state"| node_vehicle
node_application -->|"manages missions"| node_missions
node_application -->|"controls movement"| node_control
node_vehicle -->|"uses transport"| node_handler
node_handler -->|"uses MAVLink"| node_pymavlink
node_handler -->|"dispatches messages"| node_listeners
node_listeners -->|"updates attributes"| node_telemetry
node_listeners -->|"updates status"| node_gimbal
node_vehicle -->|"exposes state"| node_state
node_vehicle -->|"exposes parameters"| node_parameters
node_vehicle -->|"exposes missions"| node_missions
node_vehicle -->|"exposes control"| node_control
node_vehicle -.->|"logs through"| node_util

click node_connect "https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py"
click node_vehicle "https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py"
click node_telemetry "https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py"
click node_state "https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py"
click node_parameters "https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py"
click node_missions "https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py"
click node_control "https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py"
click node_gimbal "https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py"
click node_listeners "https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py"
click node_handler "https://github.com/dronekit/dronekit-python/blob/master/dronekit/mavlink.py"
click node_util "https://github.com/dronekit/dronekit-python/blob/master/dronekit/util.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_connect,node_vehicle,node_listeners,node_util toneBlue
class node_telemetry,node_state,node_parameters,node_missions,node_control,node_gimbal toneAmber
class node_handler toneMint
class node_developer,node_application,node_pymavlink toneIndigo
```

## Components

### Vehicle API

- [Connection setup](https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py): `dronekit/__init__.py`
- [Vehicle API](https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py): `dronekit/__init__.py`
- [Message listeners](https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py): `dronekit/__init__.py`
- [Logging utilities](https://github.com/dronekit/dronekit-python/blob/master/dronekit/util.py): `dronekit/util.py`

### Vehicle Capabilities

- [Telemetry locations](https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py): `dronekit/__init__.py`
- [Vehicle state](https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py): `dronekit/__init__.py`
- [Parameters](https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py): `dronekit/__init__.py`
- [Mission management](https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py): `dronekit/__init__.py`
- [Movement control](https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py): `dronekit/__init__.py`
- [Gimbal status](https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py): `dronekit/__init__.py`

### MAVLink Transport

- [MAVLink handler](https://github.com/dronekit/dronekit-python/blob/master/dronekit/mavlink.py): `dronekit/mavlink.py`

### Other components

- **App developer**
- **Python application**
- **pymavlink**

## Connections

- App developer → Python application: creates (evidence: `README.md`)
- Python application → Connection setup: connects through (evidence: `README.md`)
- Connection setup → Vehicle API: returns (evidence: `dronekit/__init__.py`)
- Python application → Vehicle API: queries state (evidence: `README.md`)
- Python application → Mission management: manages missions (evidence: `README.md`)
- Python application → Movement control: controls movement (evidence: `README.md`)
- Vehicle API → MAVLink handler: uses transport (evidence: `dronekit/__init__.py`)
- MAVLink handler → pymavlink: uses MAVLink (evidence: `dronekit/mavlink.py`)
- MAVLink handler → Message listeners: dispatches messages (evidence: `dronekit/mavlink.py`)
- Message listeners → Telemetry locations: updates attributes (evidence: `dronekit/__init__.py`)
- Message listeners → Gimbal status: updates status (evidence: `dronekit/__init__.py`)
- Vehicle API → Vehicle state: exposes state (evidence: `README.md`)
- Vehicle API → Parameters: exposes parameters (evidence: `README.md`)
- Vehicle API → Mission management: exposes missions (evidence: `README.md`)
- Vehicle API → Movement control: exposes control (evidence: `README.md`)
- Vehicle API → Logging utilities: logs through (evidence: `dronekit/__init__.py`)
