{"id":24031,"library":"metar-taf-parser-mivek","title":"METAR TAF Parser (mivek)","description":"A Python library for parsing METAR and TAF aviation weather messages. Version 1.11.0 supports runway visual range units and operates on Python >=3.9. The library parses raw METAR/TAF strings into structured model objects with weather phenomena, clouds, wind, visibility, etc. Released on PyPI as metar-taf-parser-mivek, with a development cadence of approximately 2-3 releases per year.","status":"active","version":"1.11.0","language":"python","source_language":"en","source_url":"https://github.com/mivek/python-metar-taf-parser","tags":["metar","taf","aviation","weather","parser"],"install":[{"cmd":"pip install metar-taf-parser-mivek","lang":"bash","label":"PyPI install"}],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"MetarParser","correct":"from metar_taf_parser.parser.metar import MetarParser"},{"note":"Top-level does not expose TafParser directly; must import from submodule.","wrong":"from metar_taf_parser import TafParser","symbol":"TafParser","correct":"from metar_taf_parser.parser.taf import TafParser"},{"note":"","wrong":"","symbol":"Metar","correct":"from metar_taf_parser.model.metar import Metar"},{"note":"","wrong":"","symbol":"Wind","correct":"from metar_taf_parser.model.metar import Wind"}],"quickstart":{"code":"from metar_taf_parser.parser.metar import MetarParser\n\nraw = \"LFPG 251300Z AUTO 23012KT 9999 -RA SCT025 BKN035 12/10 Q1015 NOSIG\"\nparser = MetarParser()\ntry:\n    metar = parser.parse(raw)\n    print(metar.wind.speed, metar.wind.direction)\n    # 12 230\nexcept Exception as e:\n    print(f\"Parse error: {e}\")","lang":"python","description":"Parse a METAR string and access wind data."},"warnings":[{"fix":"Wrap parser.parse() in try/except Exception.","message":"The parser raises ValueError or ParseException on malformed input; always wrap in try/except.","severity":"gotcha","affected_versions":"all"},{"fix":"Check metar.wind.direction is not None or use metar.wind.unit. For variable wind, direction returns 0 with variable flag.","message":"Wind direction is 0 when variable or calm; do not assume 0 means north.","severity":"gotcha","affected_versions":"all"},{"fix":"Always confirm unit property (e.g., metar.visibility.unit) before interpreting values.","message":"Cloud height is in feet; visibility may be in meters or statute miles, check unit field.","severity":"gotcha","affected_versions":"all"},{"fix":"Use explicit submodule imports (e.g., from metar_taf_parser.parser.metar import MetarParser).","message":"In v1.8.0, the top-level __init__.py exports were reduced; importing from 'metar_taf_parser' directly may break in future versions.","severity":"deprecated","affected_versions":">=1.8.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Check if metar.wind is not None before accessing .speed or .direction.","cause":"Accessing wind attributes when wind is None (e.g., on TAF without wind or when parsing fails).","error":"AttributeError: 'NoneType' object has no attribute 'speed'"},{"fix":"Use metar.wind.speed, metar.wind.direction instead of flat attributes.","cause":"Using old attribute names from earlier versions; model attributes changed to nested objects.","error":"metar_taf_parser.model.metar.Metar object has no attribute 'wind_speed'"},{"fix":"from metar_taf_parser.parser.taf import TafParser","cause":"TafParser is not in the top-level module; must import from parser submodule.","error":"ImportError: cannot import name 'TafParser' from 'metar_taf_parser'"},{"fix":"Ensure raw string starts with a valid ICAO code and does not have leading/trailing garbage. Trim whitespace and validate format.","cause":"Parser expects strict METAR format; extra whitespace or invalid prefix causes failure.","error":"ValueError: No METAR found"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}