Skip to Content
cwa
API reference

Climate

climate.daily

def daily(station: None = None) -> tuple[DailyClimate, ...]
def daily(station: str) -> DailyClimate
def daily(station: Sequence[str]) -> Mapping[str, DailyClimate]

Return hourly records and daily temperatures from the past day.

from cwa import climate

result = climate.daily("466920")
client.climate.daily(station: None = None) -> tuple[DailyClimate, ...]
client.climate.daily(station: str) -> DailyClimate
client.climate.daily(station: Sequence[str]) -> Mapping[str, DailyClimate]
await async_client.climate.daily(station: None = None) -> tuple[DailyClimate, ...]
await async_client.climate.daily(station: str) -> DailyClimate
await async_client.climate.daily(station: Sequence[str]) -> Mapping[str, DailyClimate]

climate.normals

def normals(station: None = None) -> tuple[ClimateNormals, ...]
def normals(station: str) -> ClimateNormals
def normals(station: Sequence[str]) -> Mapping[str, ClimateNormals]

Return monthly climate normals.

from cwa import climate

result = climate.normals("466920")
client.climate.normals(station: None = None) -> tuple[ClimateNormals, ...]
client.climate.normals(station: str) -> ClimateNormals
client.climate.normals(station: Sequence[str]) -> Mapping[str, ClimateNormals]
await async_client.climate.normals(station: None = None) -> tuple[ClimateNormals, ...]
await async_client.climate.normals(station: str) -> ClimateNormals
await async_client.climate.normals(station: Sequence[str]) -> Mapping[str, ClimateNormals]

climate.ozone

def ozone() -> tuple[OzoneSeries, ...]

Return total ozone series measured at Taipei, in Dobson units.

from cwa import climate

series = climate.ozone()
client.climate.ozone() -> tuple[OzoneSeries, ...]
await async_client.climate.ozone() -> tuple[OzoneSeries, ...]

climate.rainfall

def rainfall(station: None = None) -> tuple[RainfallRecord, ...]
def rainfall(station: str) -> RainfallRecord
def rainfall(station: Sequence[str]) -> Mapping[str, RainfallRecord]

Return this year’s daily and monthly precipitation.

from cwa import climate

result = climate.rainfall("466920")
client.climate.rainfall(station: None = None) -> tuple[RainfallRecord, ...]
client.climate.rainfall(station: str) -> RainfallRecord
client.climate.rainfall(station: Sequence[str]) -> Mapping[str, RainfallRecord]
await async_client.climate.rainfall(station: None = None) -> tuple[RainfallRecord, ...]
await async_client.climate.rainfall(station: str) -> RainfallRecord
await async_client.climate.rainfall(station: Sequence[str]) -> Mapping[str, RainfallRecord]

climate.stations

def stations(station: None = None, *, kind: StationKind = 'staffed') -> tuple[StationHistory, ...]
def stations(station: str, *, kind: StationKind = 'staffed') -> StationHistory
def stations(station: Sequence[str], *, kind: StationKind = 'staffed') -> Mapping[str, StationHistory]

Return current and past stations with their history.

from cwa import climate

result = climate.stations()
client.climate.stations(station: None = None, *, kind: StationKind = 'staffed') -> tuple[StationHistory, ...]
client.climate.stations(station: str, *, kind: StationKind = 'staffed') -> StationHistory
client.climate.stations(station: Sequence[str], *, kind: StationKind = 'staffed') -> Mapping[str, StationHistory]
await async_client.climate.stations(station: None = None, *, kind: StationKind = 'staffed') -> tuple[StationHistory, ...]
await async_client.climate.stations(station: str, *, kind: StationKind = 'staffed') -> StationHistory
await async_client.climate.stations(station: Sequence[str], *, kind: StationKind = 'staffed') -> Mapping[str, StationHistory]

climate.ClimateNormals

station: ClimateStation
first_year: int | None
last_year: int | None
months: tuple[MonthlyNormal, ...]

A station’s monthly normals over first_year to last_year.

climate.ClimateStation

id: str
name: str
name_en: Text
attribute: Text

A climate station. attribute is, for example, 署屬有人氣象站.

climate.DailyClimate

station: ClimateStation
hours: Annotated[tuple[HourlyClimate, ...], ordered(time)]
temperatures: Annotated[tuple[DailyTemperature, ...], ordered(date)]

A station’s hourly records and daily temperature statistics.

climate.DailyRainfall

date: Day
precipitation: Rainfall

Daily precipitation in mm; “T” (trace) is 0.0.

climate.DailyTemperature

date: Day
maximum: Number
minimum: Number
mean: Number

Daily maximum, minimum and mean air temperature in °C.

climate.HourlyClimate

time: Time
pressure: Number
temperature: Number
humidity: Number
wind_speed: Number
wind_direction: Text
precipitation: Rainfall
sunshine_hours: Number

An hourly record. Precipitation is in mm; “T” (trace) is 0.0.

wind_direction keeps CWA’s text, such as “X,X” when not observed.

climate.MonthlyNormal

month: int
pressure: Number
temperature: Number
max_temperature: Number
min_temperature: Number
days_max_at_least_30: Number
days_mean_at_least_25: Number
days_min_at_most_10: Number
humidity: Number
cloud_amount: Number
sunshine_hours: Number
precipitation: Number
days_precipitation_at_least_0_1: Number
wind_speed: Number

Average conditions for one calendar month.

Units: hPa, °C, %, tenths of sky (cloud), hours, mm and m/s. The days_ fields are the mean number of days per month meeting the threshold.

climate.MonthlyRainfall

year_month: str
total: Rainfall

Monthly precipitation total in mm. year_month is “YYYY-MM”.

climate.OzoneSeries

name: str
values: tuple[OzoneValue, ...]

A named ozone series, such as 累年臭氧全量月平均值.

climate.OzoneValue

period: str
value: Number

Total ozone in Dobson units. period is a year, “YYYY-MM” or a month “MM”.

climate.RainfallRecord

station: ClimateStation
days: Annotated[tuple[DailyRainfall, ...], ordered(date)]
months: Annotated[tuple[MonthlyRainfall, ...], ordered(year_month)]

A station’s daily and monthly precipitation.

climate.StationHistory

id: str
name: str
name_en: Text
status: Text
altitude: Number
latitude: Number
longitude: Number
county: CountyName
address: Text
started: OptionalDay
ended: OptionalDay
notes: Text
original_id: Text
new_id: Text

A current or past station. status is 現存測站 or 已撤銷.

climate.StationKind

type StationKind = Literal['staffed', 'automatic']