earthkit-meteo
raw JSON → 1.0.0rc1 verified Fri May 01 auth: no python
Meteorological computations library developed by ECMWF. Provides unit conversion, thermodynamics, and diagnostics for weather and climate data. Current stable version is 0.6.2, with release candidate 1.0.0rc1 available. Active development with frequent releases.
pip install earthkit-meteo Common errors
error ModuleNotFoundError: No module named 'earthkit.meteo' ↓
cause Installed only 'earthkit' base package, not 'earthkit-meteo'.
fix
Run
pip install earthkit-meteo error AttributeError: module 'earthkit' has no attribute 'meteo' ↓
cause Namespace package not imported correctly. Commonly due to incorrect import statement.
fix
Use
import earthkit.meteo as em instead of import earthkit error TypeError: convert() got an unexpected keyword argument 'from_unit' ↓
cause Changed function signature in version 1.0.0rc: `convert(value, source_unit, target_unit)` became `convert(value, from_unit, to_unit)` or similar.
fix
Check latest docs; adjust keyword arguments accordingly.
Warnings
gotcha The library uses namespace packages; import as `import earthkit.meteo as em`, not `from earthkit import meteo`. ↓
fix Use `import earthkit.meteo` or `from earthkit.meteo import ...`
deprecated Some functions from v0.x are deprecated in 1.0.0rc, like `em.unitis.convert` may be replaced by a new API. ↓
fix Check changelog and use new function names (e.g., `em.unitis.convert_temperature`)
breaking API signatures for thermodynamics functions may change between 0.6.x and 1.0.0rc (e.g., parameter order). ↓
fix Refer to the latest documentation for function arguments.
Install
pip install earthkit-meteo==1.0.0rc1 Imports
- earthkit.meteo wrong
from earthkit import meteocorrectimport earthkit.meteo as em - unitis wrong
import unitiscorrectfrom earthkit.meteo import unitis - thermo wrong
import thermocorrectfrom earthkit.meteo import thermo
Quickstart
import earthkit.meteo as em
# Temperature unit conversion
temp_k = 300.15
temp_c = em.unitis.convert(temp_k, 'K', 'degC')
print(f"{temp_k} K = {temp_c:.2f} °C")
# Compute dewpoint using Magnus formula
import numpy as np
t = np.array([20.0, 25.0, 30.0])
rh = np.array([50.0, 60.0, 70.0])
td = em.thermo.dewpoint_magnus(t, rh)
print(td)