async_asos_client
Async KMA ASOS (Automated Synoptic Observing System) API client.
This module provides a client for accessing the Korea Meteorological Administration's ASOS (종관기상관측) API for surface weather observations.
AsyncASOSClient
¶
Async client for KMA ASOS API.
The ASOS system collects atmospheric data at standardized times across all observation stations, measuring temperature, precipitation, pressure, humidity, wind direction/speed, solar radiation, sunshine duration, and snow depth.
Source code in python/src/kma_mcp/surface/async_asos_client.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | |
close()
async
¶
get_daily_data(tm, stn=0, disp=0)
async
¶
Get daily observation data for a single day.
Parameters:
-
tm(str | datetime) –Date in 'YYYYMMDD' format or datetime object
-
stn(int | str, default:0) –Station number (0 for all stations)
-
disp(int, default:0) –Display option (default: 0)
Returns:
Example
async with AsyncASOSClient('your_auth_key') ... data = await client.get_daily_data('20250101')
Source code in python/src/kma_mcp/surface/async_asos_client.py
get_daily_period(tm1, tm2, stn=0, obs='', mode=0)
async
¶
Get daily observation data for a time period.
Parameters:
-
tm1(str | datetime) –Start date in 'YYYYMMDD' format or datetime object
-
tm2(str | datetime) –End date in 'YYYYMMDD' format or datetime object
-
stn(int | str, default:0) –Station number (0 for all stations)
-
obs(str, default:'') –Observation element code (empty for all)
-
mode(int, default:0) –Mode option (default: 0)
Returns:
Example
async with AsyncASOSClient('your_auth_key') ... data = await client.get_daily_period('20250101', '20250131')
Source code in python/src/kma_mcp/surface/async_asos_client.py
get_element_data(tm1, tm2, obs, stn=0)
async
¶
Get specific element observation data for a time period.
Parameters:
-
tm1(str | datetime) –Start time in 'YYYYMMDDHHmm' format or datetime object
-
tm2(str | datetime) –End time in 'YYYYMMDDHHmm' format or datetime object
-
obs(str) –Observation element code
-
stn(int | str, default:0) –Station number (0 for all stations)
Returns:
Example
async with AsyncASOSClient('your_auth_key')
Get temperature data¶
... data = await client.get_element_data('202501010000', '202501020000', 'TA')
Source code in python/src/kma_mcp/surface/async_asos_client.py
get_hourly_data(tm, stn=0)
async
¶
Get hourly observation data for a single time.
Parameters:
-
tm(str | datetime) –Time in 'YYYYMMDDHHmm' format or datetime object
-
stn(int | str, default:0) –Station number (0 for all stations, or specific station number)
Returns:
Example
async with AsyncASOSClient('your_auth_key') ... data = await client.get_hourly_data('202501011200')
Or using datetime¶
from datetime import datetime ... data = await client.get_hourly_data(datetime(2025, 1, 1, 12, 0))
Source code in python/src/kma_mcp/surface/async_asos_client.py
get_hourly_period(tm1, tm2, stn=0)
async
¶
Get hourly observation data for a time period.
Parameters:
-
tm1(str | datetime) –Start time in 'YYYYMMDDHHmm' format or datetime object
-
tm2(str | datetime) –End time in 'YYYYMMDDHHmm' format or datetime object (maximum 31 days from tm1)
-
stn(int | str, default:0) –Station number (0 for all stations)
Returns:
Example
async with AsyncASOSClient('your_auth_key') ... data = await client.get_hourly_period('202501010000', '202501020000')
Source code in python/src/kma_mcp/surface/async_asos_client.py
get_normals(norm, tmst, mm1, dd1, mm2=None, dd2=None, stn=0)
async
¶
Get climate normal values for a period.
Documented endpoint: sfc_norm1.php Reference: API_ENDPOINT_Surface.md line 91-106
Parameters:
-
norm(Literal['D', 'S', 'M', 'Y']) –Normal period type: - 'D': Daily (일) - 'S': 10-day period (순) - 'M': Monthly (월) - 'Y': Yearly (연)
-
tmst(Literal[1991, 2001, 2011, 2021]) –Climate normal period: - 1991: 1961-1990 - 2001: 1971-2000 - 2011: 1981-2010 - 2021: 1991-2020
-
mm1(int) –Start month
-
dd1(int) –Start day (for 'S' type: 100=early, 200=middle, 300=late)
-
mm2(int | None, default:None) –End month (optional, defaults to mm1)
-
dd2(int | None, default:None) –End day (optional, defaults to dd1)
-
stn(int | str, default:0) –Station number (0 for all stations)
Returns:
Example
async with AsyncASOSClient('your_auth_key') as client: ... # Get daily normals for May 1-2 ... data = await client.get_normals('D', 2021, mm1=5, dd1=1, mm2=5, dd2=2) ... # Get monthly normals for May ... data = await client.get_normals('M', 2021, mm1=5, dd1=1) ... # Get 10-day period normals (early May) ... data = await client.get_normals('S', 2021, mm1=5, dd1=100)