Python program parsing METAR and TAF
This project provides METAR and TAF parsers.
pip install metar-taf-parser-mivek
This package contains the converter module. The module contains helper functions.
This package contains multiple modules
This package contains the parser module with the MetarParser
and TAFParser
classes.
Represents the wind part of a metar, taf or trend
int
. The speed of the windstr
. The cardinal direction of the windint
. The direction in degreesint
. The speed of gust if any, None otherwiseint
. The minimal degree variation of the windint
. The maximal degree variation of the windstr
. The unit of the speed of the wind.Represents a wind shear in TAF message. This class extends Wind.
int
. The height of the wind shear.Represents the visibility part of a METAR, TAF or trend.
str
. The distance in meters or nautical miles.int
. The minimal distance in meters if any.str
. The direction of the minimal distance if any.Represents the weather part of a METAR, TAF or trend.
Intensity
. The intensity of the weather condition if any, None
otherwise.Descriptive
. The descriptive of the weather condition if any, None
otherwise.[Phenomenon]
. Array of phenomenons of the weather condition.Represents the temperature part of a TAF.
int
. The temperature in celsius degrees.int
. Day of the occurrence.int
. Hour of the occurrence.Represents the visibility or the deposit on a runway.
str
. The name of the runway.int
. The minimal visibility distance on the runway.int
. The maximal visibility distance on the runway.str
. The trend of the visibility.str
. The indicator on the visual range. M
for less than and or P
for greater than.DepositType
. The type of deposit.DepositCoverage
. The percentage of coverage.str
. The thickness of the deposit.str
. The braking capacity on the runway.Represents a cloud layer in METAR, TAF or trend object.
int
. The height of the layer in feet.CloudQuantity
. The quantity of clouds.CloudType
. The type of cloud in the layer.Represents the icing in a TAF or TAFTrend object.
IcingIntensity
. The intensity of an icing.int
. The base height of an icing element in feet.int
. The icing layer depth in feet. Adding this to the base height determines the top limit of the icing.Represents the turbulence in a TAF or TAFTrend object.
TurbulenceIntensity
. The intensity of a turbulence.int
. The base height of a turbulence element in feet.int
. The turbulence layer depth in feet. Adding this to the base height determines the top limit of the turbulence.Class holding turbulence and icing elements.
[Icing]
. List of icing elements.[Turbulence]
. List of turbulence elements.This class is a parent class of TAF
and ITafGroups
.
Abstract class containing the basic fields of METAR, TAF or trend objects.
Wind
. The wind. Can be None
for trends.Visibility
. The visibility.int
. The vertical visibility, can be None
WindShear
. The wind shear object.bool
. Indicates whether the message is CAVOK (Ceiling and visibility OK)str
. The remark part of the message.list[str]
. List of remarks. Each element is a different remark or token[Cloud]
. Array of clouds elements.[WeatherCondition]
. Array of weather conditions.Abstract class representing the base of a Validity object.
int
. The starting day of the validity.int
. The starting hour of the validity.Class extending the AbstractWeatherContainer. Abstract parent class of METAR and TAF.
int
. The delivery day of the METAR or TAF.datetime.time
. The delivery time of the METAR/TAF.str
. The message of the METAR/TAF.str
. The station for which the message was issued.[TAFTrend/MetarTrend]
. Array of trends[Flag]
. Set of flags.bool
. Whether the METAR is automated.bool
. Whether the TAF is an amendment.bool
. Whether the METAR/TAF is null.bool
. Whether the METAR/TAF is canceled.bool
. Whether the METAR/TAF is a correction.Class representing a metar object.
int
. The temperature in celsius.int
. The dew_point in celsius.float
. The altimeter value in HPa.bool
. Whether the message is nosig: No significant changes to come.[RunwayInfo]
. Array of runway information.Class representing a TAF object.
Validity
. The validity of the TAF.TemperatureDated
. The maximum temperature during the validity of the TAF.TemperatureDated
. The minimum temperature during the validity of the TAF.bool
. Whether the TAF is an amendment.Abstract base class for trend.
WeatherChangeType
. The type of change.Class containing the time of the trend.
datetime.time
. Time of the trend's occurrence.TimeIndicator
. Type of time change of the trend.Represents a trend in a METAR object, this class extends AbstractTrend
.
[MetarTrendTime]
. The list of time change of the trend.Represent a trend in a TAF object, this class extends AbstractTrend
AbstractValidity
. The validity of the trend either Validity
or FMValidity
int
. The probability of a trend, can be None
.Represents the validity timespan of a TAF or TAFTrend, this class extends AbstractValidity
.
int
. The ending day of the validity.int
The ending hour of the validity.Represents the validity of a From trend, extends AbstractValidity
int
. The starting minute of the trend.Use the method parse(string)
of the MetarParser
to parse a metar.
from metar_taf_parser.parser.parser import MetarParser
metar = MetarParser().parse('KTTN 051853Z 04011KT 9999 VCTS SN FZFG BKN003 OVC010 M02/M02 A3006')
Use the method parse(string)
of the TAFParser to parse a TAF message.
The message must start with TAF
in order to be parsed.
from metar_taf_parser.parser.parser import TAFParser
taf = TAFParser().parse(
'TAF LFPG 150500Z 1506/1612 17005KT 6000 SCT012 TEMPO 1506/1509 3000 BR BKN006 PROB40 TEMPO 1506/1508 0400 BCFG BKN002 PROB40 TEMPO 1512/1516 4000 -SHRA FEW030TCU BKN040 BECMG 1520/1522 CAVOK TEMPO 1603/1608 3000 BR BKN006 PROB40 TEMPO 1604/1607 0400 BCFG BKN002 TX17/1512Z TN07/1605Z')
The following locales are supported:
To add or complete locales please see CONTRIBUTING