Python library to parse IATA MVT flight movement messages
Project description
mvt-parser
Python library for parsing IATA MVT flight movement messages.
What is MVT?
MVT (Movement), MVA (Movement Advice), and DIV (Diversion) are standardised plain-text telegrams exchanged between airlines, airports, and handling agents to communicate real-time flight events.
They are used to:
- Control punctual and regular operation of all flights
- Form the basis for aircraft and crew rotation planning
- Alert operations control centres to diversions and unplanned routing changes
A typical MVT message looks like this:
MVT
BA100/27.PPVMU.LHR
AD1200/1210 EA1300 CDG
DL72/0015
PX145/12
SI DEICING
Every message has the same structure:
- Header line — message type (
MVT,MVA, orDIV) with optionalCOR(correction) orREV(revision) flag - Flight line — flight number, scheduled day, aircraft registration, and airport of movement
- Body lines — one or more lines carrying movement data using two- or three-letter tokens
Tokens
| Token | Meaning | Example |
|---|---|---|
AD |
Actual departure (off-block / airborne) | AD1200/1210 |
AA |
Actual arrival (touchdown / on-block) | AA1515/1520 |
EA |
Estimated arrival (touchdown) + airport | EA1300 CDG |
ED |
Estimated departure | ED041630 |
EB |
Estimated on-block time | EB1320 |
DL |
Delay — reason code(s) and duration(s) | DL72/0015 |
PX |
Passengers on board / infants | PX145/12 |
RC |
Reclearance time and airport | RC1200 LTN |
DR |
Diversion reason code | DR71 |
FR |
Forced return from airborne | FR1215/1235 |
NI |
Next information time (indefinite delay) | NI052215 |
FLD |
Flight leg date | FLD16 |
CRT |
Crew report time | CRT1530 |
MAP |
Movement after pushback | MAP1015 |
TOF |
Take-off fuel | TOF6400 |
TOW |
Take-off weight | TOW63452 |
ZFW |
Zero fuel weight | ZFW132500 |
EO |
Estimated take-off time | EO1120 |
RR |
Return to ramp | RR1130/1145 |
DLA |
Sub delay code | DLA93A |
EDL |
Extra delay information | EDL AWAITING CREW |
SI |
Supplementary free-text information | SI DEICING |
All times are UTC in HHMM (4-digit) or DDHHMM (6-digit) format.
Install
pip install mvt-parser
Quick start
from mvt_parser import MVTParser
parser = MVTParser()
msg = parser.parse("""
MVT
BA100/27.PPVMU.LHR
AD1200/1210 EA1300 CDG
DL72/0015
PX145/12
SI DEICING
""")
print(msg.flight_number) # BA100
print(msg.actual_departure) # 1200/1210
print(msg.estimated_arrival) # 1300
print(msg.delays[0].reason_codes) # ['72']
print(msg.passenger_info.total) # 145
Supported message types
| Type | Description |
|---|---|
MVT |
Movement — actual departure or arrival |
MVA |
Movement Advice — estimated time update |
DIV |
Diversion — flight redirected to another airport |
All three support optional COR (correction) and REV (revision) flags.
Parsed fields
msg.flight_number # "BA100"
msg.scheduled_day # "27"
msg.aircraft_registration # "PPVMU"
msg.airport_of_movement # "LHR"
msg.is_correction # False
msg.is_revision # False
msg.actual_departure # MovementTime(primary="1200", secondary="1210")
msg.actual_arrival # MovementTime(primary="1515", secondary=None)
msg.estimated_departure # "1100"
msg.estimated_arrival # "1300"
msg.estimated_onblock # "1320"
msg.delays # [Delay(reason_codes=["72"], durations=["0015"])]
msg.passenger_info # PassengerInfo(total=145, infants=12)
msg.destination_airport # "CDG"
msg.reclearance # "0945"
msg.reclearance_airport # "LHR"
msg.takeoff_fuel # 6400
msg.takeoff_weight # 70000
msg.zero_fuel_weight # 60000
msg.diversion_reason # "71"
msg.return_from_airborne # MovementTime(primary="1400", secondary="1420")
msg.return_to_ramp # MovementTime(primary="1130", secondary="1145")
msg.estimated_takeoff # "1120"
msg.sub_delay_code # "93A"
msg.extra_delay_info # "AWAITING CREW"
msg.supplementary_info # ["DEICING"]
msg.next_info # "221150"
Multi-leg flights
When a message contains multiple departure lines each line is captured as a FlightLeg:
msg = parser.parse("""
MVT
BA100/27.PPVMU.LHR
AD1200/1210 EA1300 CDG
AD1400/1415 EA1600 FRA
""")
for leg in msg.legs:
print(leg.actual_departure, "->", leg.destination)
# 1200/1210 -> CDG
# 1400/1415 -> FRA
Serialize back to MVT
to_mvt() reconstructs the original wire format from parsed data — useful for forwarding or storing messages:
msg = parser.parse(raw)
# modify a field
msg.estimated_arrival = "1400"
# serialize back
print(msg.to_mvt())
Output:
MVT
BA100/27.PPVMU.LHR
AD1200/1210 EA1400 CDG
DL72/0015
PX145/12
SI DEICING
The result is always valid and parseable back by MVTParser.
Export to dict / JSON
msg.to_dict() # plain Python dict
msg.to_json() # pretty-printed JSON string
Error handling
All parse failures raise MVTParseError:
from mvt_parser import MVTParser, MVTParseError
try:
msg = parser.parse(raw)
except MVTParseError as e:
print(f"Invalid message: {e}")
References
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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.
Copy a direct link to the current filters
File details
Details for the file mvt_parser-1.0.0.tar.gz.
File metadata
- Download URL: mvt_parser-1.0.0.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88bfb864f0e527548f253371fa17818ef96516e5350b318a28cffa5db7c739b3
|
|
| MD5 |
68583e24debfee42b5a6172363458cc7
|
|
| BLAKE2b-256 |
bcaa77c8d4517bd1b1a831cfe16b7a6a499f201e3ae39f86f5f4416ca335377a
|
Provenance
The following attestation bundles were made for mvt_parser-1.0.0.tar.gz:
Publisher:
publish.yml on noredgaras/mvt_parser_lib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mvt_parser-1.0.0.tar.gz -
Subject digest:
88bfb864f0e527548f253371fa17818ef96516e5350b318a28cffa5db7c739b3 - Sigstore transparency entry: 1226339097
- Sigstore integration time:
-
Permalink:
noredgaras/mvt_parser_lib@cac3a51acfad4253cadfc28a1f2d5e54f02a00af -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/noredgaras
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cac3a51acfad4253cadfc28a1f2d5e54f02a00af -
Trigger Event:
release
-
Statement type:
File details
Details for the file mvt_parser-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mvt_parser-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b14b6b87a1653e07fd39cdad83d310bc8c4e029009c70c2654baeb9860eb342f
|
|
| MD5 |
023a386ac102dceb8aa323a81a848528
|
|
| BLAKE2b-256 |
94629c858550ef04910b7b826632f3f402a2c4015510f6fd3049d5ac8d58d947
|
Provenance
The following attestation bundles were made for mvt_parser-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on noredgaras/mvt_parser_lib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mvt_parser-1.0.0-py3-none-any.whl -
Subject digest:
b14b6b87a1653e07fd39cdad83d310bc8c4e029009c70c2654baeb9860eb342f - Sigstore transparency entry: 1226339241
- Sigstore integration time:
-
Permalink:
noredgaras/mvt_parser_lib@cac3a51acfad4253cadfc28a1f2d5e54f02a00af -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/noredgaras
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cac3a51acfad4253cadfc28a1f2d5e54f02a00af -
Trigger Event:
release
-
Statement type: