climate_client
KMA Climate Statistics API client.
This module provides a client for accessing the Korea Meteorological Administration's Climate Statistics (기후통계) API for climate normal values and long-term statistics.
Climate normals are calculated over standard 30-year periods and provide reference values for temperature, precipitation, and other meteorological elements.
ClimateClient
¶
Client for KMA Climate Statistics API.
The Climate Statistics API provides long-term climate normal values calculated over 30-year reference periods (e.g., 1991-2020). Available data includes temperature, precipitation, humidity, wind, and more.
Source code in python/src/kma_mcp/surface/climate_client.py
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 | |
close()
¶
get_annual_normals(stn=0)
¶
Get annual climate normal values.
Parameters:
Returns:
Example
client = ClimateClient('your_auth_key') data = client.get_annual_normals()
Source code in python/src/kma_mcp/surface/climate_client.py
get_daily_normals(start_month, start_day, end_month, end_day, stn=0)
¶
Get daily climate normal values for a date range.
Parameters:
-
start_month(int) –Start month (1-12)
-
start_day(int) –Start day (1-31)
-
end_month(int) –End month (1-12)
-
end_day(int) –End day (1-31)
-
stn(int | str, default:0) –Station number (0 for all stations)
Returns:
Example
client = ClimateClient('your_auth_key')
Get normals for January 1-31¶
data = client.get_daily_normals(1, 1, 1, 31)
Source code in python/src/kma_mcp/surface/climate_client.py
get_monthly_normals(start_month, end_month, stn=0)
¶
Get monthly climate normal values.
Parameters:
-
start_month(int) –Start month (1-12)
-
end_month(int) –End month (1-12)
-
stn(int | str, default:0) –Station number (0 for all stations)
Returns:
Example
client = ClimateClient('your_auth_key')
Get normals for entire year¶
data = client.get_monthly_normals(1, 12)
Source code in python/src/kma_mcp/surface/climate_client.py
get_normals_by_period(period_type, start_month=None, start_day=None, end_month=None, end_day=None, stn=0)
¶
Get climate normals with flexible period specification.
Parameters:
-
period_type(str) –Type of period ('daily', 'tenday', 'monthly', 'annual')
-
start_month(int | None, default:None) –Start month (required for daily, tenday, monthly)
-
start_day(int | None, default:None) –Start day (required for daily) or period (1-3 for tenday)
-
end_month(int | None, default:None) –End month (required for daily, tenday, monthly)
-
end_day(int | None, default:None) –End day (required for daily) or period (1-3 for tenday)
-
stn(int | str, default:0) –Station number (0 for all stations)
Returns:
Raises:
-
ValueError–If required parameters are missing for the period type
Example
client = ClimateClient('your_auth_key') data = client.get_normals_by_period('monthly', 1, None, 12, None)
Source code in python/src/kma_mcp/surface/climate_client.py
get_ten_day_normals(start_month, start_period, end_month, end_period, stn=0)
¶
Get 10-day (dekad) climate normal values.
Each month is divided into three 10-day periods: - Period 1: Days 1-10 - Period 2: Days 11-20 - Period 3: Days 21-end of month
Parameters:
-
start_month(int) –Start month (1-12)
-
start_period(int) –Start period (1-3)
-
end_month(int) –End month (1-12)
-
end_period(int) –End period (1-3)
-
stn(int | str, default:0) –Station number (0 for all stations)
Returns:
Example
client = ClimateClient('your_auth_key')
Get normals for first 10-day period of January¶
data = client.get_ten_day_normals(1, 1, 1, 1)