Package: metar-taf-parser-mivek
METAR TAF ParserThis project provides METAR and TAF parsers.Installpipinstallmetar-taf-parser-mivekStructureCommons packageThis package contains the converter module. The module contains helper functions.Model packageThis package contains multiple modulesenum: Contains the enumerations for the projectmodel: Contains the model classes for the projectParser packageThis package contains the parser module with theMetarParserandTAFParserclasses.ModelEnumerationsCloudQuantity: Represents the quantity in a cloud layerCloudType: Represents the type of cloud in a cloud layerDepositCoverage: Represents the percentage of a runway covered by the depositDepositType: Represents the type of deposit on a runwayDescriptive: Represents the descriptive part of a weather phenomenonIntensity: Represents the intensity of a weather phenomenonPhenomenon: Represents the phenomenon of a weather phenomenonTimeIndicator: Indicates the time trendWeatherChangeType: Indicate the type of trendIcingIntensity: Represents the intensity of an icing elementTurbulenceIntensity: Represents the intensity of a turbulence elementObjectsWindRepresents the wind part of a metar, taf or trendspeed:int. The speed of the winddirection:str. The cardinal direction of the winddegrees:int. The direction in degreesgust:int. The speed of gust if any, None otherwisemin_variation:int. The minimal degree variation of the windmax_variation:int. The maximal degree variation of the windunit:str. The unit of the speed of the wind.WindShearRepresents a wind shear in TAF message. This class extends Wind.height:int. The height of the wind shear.VisibilityRepresents the visibility part of a METAR, TAF or trend.distance:str. The distance in meters or nautical miles.min_distance:int. The minimal distance in meters if any.min_direction:str. The direction of the minimal distance if any.WeatherConditionRepresents the weather part of a METAR, TAF or trend.intensity:Intensity. The intensity of the weather condition if any,Noneotherwise.descriptive:Descriptive. The descriptive of the weather condition if any,Noneotherwise.phenomenons:[Phenomenon]. Array of phenomenons of the weather condition.TemperatureDatedRepresents the temperature part of a TAF.temperature:int. The temperature in celsius degrees.day:int. Day of the occurrence.hour:int. Hour of the occurrence.RunwayInfoRepresents the visibility or the deposit on a runway.name:str. The name of the runway.min_range:int. The minimal visibility distance on the runway.max_range:int. The maximal visibility distance on the runway.trend:str. The trend of the visibility.indicator:str. The indicator on the visual range.Mfor less than and orPfor greater than.deposit_type:DepositType. The type of deposit.coverage:DepositCoverage. The percentage of coverage.thickness:str. The thickness of the deposit.braking_capacity:str. The braking capacity on the runway.CloudRepresents a cloud layer in METAR, TAF or trend object.height:int. The height of the layer in feet.quantity:CloudQuantity. The quantity of clouds.type:CloudType. The type of cloud in the layer.IcingRepresents the icing in a TAF or TAFTrend object.intensity:IcingIntensity. The intensity of an icing.base_height:int. The base height of an icing element in feet.depth:int. The icing layer depth in feet. Adding this to the base height determines the top limit of the icing.TurbulenceRepresents the turbulence in a TAF or TAFTrend object.intensity:TurbulenceIntensity. The intensity of a turbulence.base_height:int. The base height of a turbulence element in feet.depth:int. The turbulence layer depth in feet. Adding this to the base height determines the top limit of the turbulence.ITafGroupsClass holding turbulence and icing elements.icings:[Icing]. List of icing elements.turbulence:[Turbulence]. List of turbulence elements.This class is a parent class ofTAFandITafGroups.AbstractWeatherContainerAbstract class containing the basic fields of METAR, TAF or trend objects.wind:Wind. The wind. Can beNonefor trends.visibility:Visibility. The visibility.vertical_visibility:int. The vertical visibility, can beNonewind_shear:WindShear. The wind shear object.cavok:bool. Indicates whether the message is CAVOK (Ceiling and visibility OK)remark:str. The remark part of the message.remarks:list[str]. List of remarks. Each element is a different remark or tokenclouds:[Cloud]. Array of clouds elements.weather_conditions:[WeatherCondition]. Array of weather conditions.AbstractValidityAbstract class representing the base of a Validity object.start_day:int. The starting day of the validity.start_hour:int. The starting hour of the validity.AbstractWeatherCodeClass extending the AbstractWeatherContainer. Abstract parent class of METAR and TAF.day:int. The delivery day of the METAR or TAF.time:datetime.time. The delivery time of the METAR/TAF.message:str. The message of the METAR/TAF.station:str. The station for which the message was issued.trends:[TAFTrend/MetarTrend]. Array of trendsflags:[Flag]. Set of flags.auto:bool. Whether the METAR is automated.amendment:bool. Whether the TAF is an amendment.nil:bool. Whether the METAR/TAF is null.canceled:bool. Whether the METAR/TAF is canceled.corrected:bool. Whether the METAR/TAF is a correction.MetarClass representing a metar object.temperature:int. The temperature in celsius.dew_point:int. The dew_point in celsius.altimeter:float. The altimeter value in HPa.nosig:bool. Whether the message is nosig: No significant changes to come.runway_info:[RunwayInfo]. Array of runway information.TAFClass representing a TAF object.validity:Validity. The validity of the TAF.max_temperature:TemperatureDated. The maximum temperature during the validity of the TAF.min_temperature:TemperatureDated. The minimum temperature during the validity of the TAF.amendment:bool. Whether the TAF is an amendment.AbstractTrendAbstract base class for trend.type:WeatherChangeType. The type of change.MetarTrendTimeClass containing the time of the trend.time:datetime.time. Time of the trend's occurrence.type:TimeIndicator. Type of time change of the trend.MetarTrendRepresents a trend in a METAR object, this class extendsAbstractTrend.times:[MetarTrendTime]. The list of time change of the trend.TAFTrendRepresent a trend in a TAF object, this class extendsAbstractTrendvalidity:AbstractValidity. The validity of the trend eitherValidityorFMValidityprobability:int. The probability of a trend, can beNone.ValidityRepresents the validity timespan of a TAF or TAFTrend, this class extendsAbstractValidity.end_day:int. The ending day of the validity.end_hour:intThe ending hour of the validity.FMValidityRepresents the validity of a From trend, extends AbstractValiditystart_minutes:int. The starting minute of the trend.ExampleParse a METARUse the methodparse(string)of theMetarParserto parse a metar.frommetar_taf_parser.parser.parserimportMetarParsermetar=MetarParser().parse('KTTN 051853Z 04011KT 9999 VCTS SN FZFG BKN003 OVC010 M02/M02 A3006')Parse a TAFUse the methodparse(string)of the TAFParser to parse a TAF message.
The message must start withTAFin order to be parsed.frommetar_taf_parser.parser.parserimportTAFParsertaf=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')InternationalizationThe following locales are supported:en (default)frdeplitruTo add or complete locales please seeCONTRIBUTING