Registry / data / metar
library2.0.1pypypi✓ verified 86d ago

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.

pip install metar
INSTALL
IMPORT
SIG · METAR
M
metar
datapythonv2.0.1
Install
1.8s avg
Import
46ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.048s · 18.4MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.8s · import 0.044s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Metar
from metar.Metar import Metar
from python_metar.Metar import Metar
The package was historically known as `python-metar`. Ensure you use `metar` for imports with recent versions.

Parse a sample METAR string and access its attributes, then print a human-readable summary.

from metar.Metar import Metar # Example METAR string metar_string = "METAR KSLK 200853Z AUTO 09006KT 10SM CLR 02/M01 A2999 RMK AO2" # Parse the METAR report m = Metar(metar_string) # Access parsed data print(f"Station: {m.station_id}") print(f"Time: {m.time}") print(f"Wind: {m.wind_dir}{m.wind_speed}KT") print(f"Temperature: {m.temp}°C") print(f"Dew Point: {m.dewpt}°C") print(f"Visibility: {m.vis.value}{m.vis.units}") # Print a formatted report print("\n--- Formatted Report ---") print(m.string())
Debug
Known issues
breakingThe `utcdelta` argument was removed from the `Metar` constructor in version 2.0.0. This was a breaking change.
fix
Remove the `utcdelta` argument when instantiating `Metar`. The library now handles UTC offsets internally or expects UTC input.
affects: >=2.0.0
breakingThe `position.getdistance` API was removed in version 1.9.0 as it was unused and broken.
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.
affects: >=1.9.0
gotchaThe 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`.
fix
Use `pip install metar` for installation and `from metar.Metar import Metar` for imports.
affects: All versions, especially when upgrading from legacy setups.
gotchaThe library now officially requires Python 3.10 or newer. Installing on older Python versions will likely result in compatibility errors.
fix
Ensure your environment uses Python 3.10 or a newer version.
affects: >=2.0.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'python_metar'
Attempting to import using the old package name after installing the new `metar` package, or not having the `metar` package installed.
fix
Ensure you have installed the correct package with `pip install metar` and update your import statements to `from metar.Metar import Metar`.
TypeError: Metar() got an unexpected keyword argument 'utcdelta'
You are passing the `utcdelta` argument to the `Metar` constructor, which was removed in version 2.0.0.
fix
Remove the `utcdelta` argument from the `Metar` constructor call. The library no longer uses this parameter.
AttributeError: 'Position' object has no attribute 'getdistance'
You are attempting to call the `getdistance` method on a `Position` object, which was removed in version 1.9.0.
fix
This method is no longer available. You will need to implement a custom distance calculation if this functionality is required.
Upgrade
Version history
2.0.1latest on PyPI · released Mar 20, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
2
Resources
metar — pip install metar · libregistry