{"id":9937,"library":"metar","title":"Metar - Python METAR report parser","description":"Metar is a Python package designed to parse METAR-coded weather reports, providing easy access to various meteorological data points such as wind, temperature, visibility, and cloud conditions. The project recently settled on the package name `metar` (previously `python-metar`). It is currently at version 2.0.1, with an active release cadence, and requires Python >=3.10.","status":"active","version":"2.0.1","language":"python","source_language":"en","source_url":"https://github.com/python-metar/python-metar/","tags":["weather","aviation","METAR","parser","meteorology"],"install":[{"cmd":"pip install metar","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"The package was historically known as `python-metar`. Ensure you use `metar` for imports with recent versions.","wrong":"from python_metar.Metar import Metar","symbol":"Metar","correct":"from metar.Metar import Metar"}],"quickstart":{"code":"from metar.Metar import Metar\n\n# Example METAR string\nmetar_string = \"METAR KSLK 200853Z AUTO 09006KT 10SM CLR 02/M01 A2999 RMK AO2\"\n\n# Parse the METAR report\nm = Metar(metar_string)\n\n# Access parsed data\nprint(f\"Station: {m.station_id}\")\nprint(f\"Time: {m.time}\")\nprint(f\"Wind: {m.wind_dir}{m.wind_speed}KT\")\nprint(f\"Temperature: {m.temp}°C\")\nprint(f\"Dew Point: {m.dewpt}°C\")\nprint(f\"Visibility: {m.vis.value}{m.vis.units}\")\n\n# Print a formatted report\nprint(\"\\n--- Formatted Report ---\")\nprint(m.string())\n","lang":"python","description":"Parse a sample METAR string and access its attributes, then print a human-readable summary."},"warnings":[{"fix":"Remove the `utcdelta` argument when instantiating `Metar`. The library now handles UTC offsets internally or expects UTC input.","message":"The `utcdelta` argument was removed from the `Metar` constructor in version 2.0.0. This was a breaking change.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"If you were using `position.getdistance`, you will need to implement custom distance calculation or find an alternative method. The library no longer provides this functionality.","message":"The `position.getdistance` API was removed in version 1.9.0 as it was unused and broken.","severity":"breaking","affected_versions":">=1.9.0"},{"fix":"Use `pip install metar` for installation and `from metar.Metar import Metar` for imports.","message":"The package name has officially settled on `metar`. While older versions might have been installed as `python-metar`, ensure your `pip install` command and `import` statements use `metar`.","severity":"gotcha","affected_versions":"All versions, especially when upgrading from legacy setups."},{"fix":"Ensure your environment uses Python 3.10 or a newer version.","message":"The library now officially requires Python 3.10 or newer. Installing on older Python versions will likely result in compatibility errors.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'2.0.1':53 '3.10':62 'access':21 'activ':56 'aviat':64 'cadenc':58 'cloud':33 'code':16 'condit':34 'current':50 'data':25 'design':11 'easi':20 'metar':1,3,6,15,43,47,65 'metar-cod':14 'meteorolog':24,67 'name':42 'packag':10,41 'pars':13 'parser':5,66 'point':26 'previous':44 'project':36 'provid':19 'python':2,9,46,61 'python-metar':45 'recent':37 'releas':57 'report':4,18 'requir':60 'settl':38 'temperatur':30 'various':23 'version':52 'visibl':31 'weather':17,63 'wind':29","created_at":"2026-04-17T01:21:32.873763+00:00","updated_at":"2026-04-17T01:21:32.873763+00:00","problems":[{"fix":"Ensure you have installed the correct package with `pip install metar` and update your import statements to `from metar.Metar import Metar`.","cause":"Attempting to import using the old package name after installing the new `metar` package, or not having the `metar` package installed.","error":"ModuleNotFoundError: No module named 'python_metar'"},{"fix":"Remove the `utcdelta` argument from the `Metar` constructor call. The library no longer uses this parameter.","cause":"You are passing the `utcdelta` argument to the `Metar` constructor, which was removed in version 2.0.0.","error":"TypeError: Metar() got an unexpected keyword argument 'utcdelta'"},{"fix":"This method is no longer available. You will need to implement a custom distance calculation if this functionality is required.","cause":"You are attempting to call the `getdistance` method on a `Position` object, which was removed in version 1.9.0.","error":"AttributeError: 'Position' object has no attribute 'getdistance'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.0.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/python-metar/python-metar","docs":null,"changelog":null,"pypi":"https://pypi.org/project/metar/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":null}}