Skip to Content
cwa
API reference

Health weather

health.cold_injury

def cold_injury(location: None = None, *, hourly: bool = False) -> tuple[HealthForecast, ...]
def cold_injury(location: TownshipInput, *, hourly: bool = False) -> HealthForecast
def cold_injury(location: Sequence[TownshipInput], *, hourly: bool = False) -> Mapping[Township, HealthForecast]

Return cold injury forecasts, daily or three-hourly.

from cwa import health

result = health.cold_injury("臺北市信義區")
client.health.cold_injury(location: None = None, *, hourly: bool = False) -> tuple[HealthForecast, ...]
client.health.cold_injury(location: TownshipInput, *, hourly: bool = False) -> HealthForecast
client.health.cold_injury(location: Sequence[TownshipInput], *, hourly: bool = False) -> Mapping[Township, HealthForecast]
await async_client.health.cold_injury(location: None = None, *, hourly: bool = False) -> tuple[HealthForecast, ...]
await async_client.health.cold_injury(location: TownshipInput, *, hourly: bool = False) -> HealthForecast
await async_client.health.cold_injury(location: Sequence[TownshipInput], *, hourly: bool = False) -> Mapping[Township, HealthForecast]

health.heat_injury

def heat_injury(location: None = None) -> tuple[HealthForecast, ...]
def heat_injury(location: TownshipInput) -> HealthForecast
def heat_injury(location: Sequence[TownshipInput]) -> Mapping[Township, HealthForecast]

Return five-day, three-hourly heat injury forecasts.

from cwa import health

result = health.heat_injury("臺北市信義區")
client.health.heat_injury(location: None = None) -> tuple[HealthForecast, ...]
client.health.heat_injury(location: TownshipInput) -> HealthForecast
client.health.heat_injury(location: Sequence[TownshipInput]) -> Mapping[Township, HealthForecast]
await async_client.health.heat_injury(location: None = None) -> tuple[HealthForecast, ...]
await async_client.health.heat_injury(location: TownshipInput) -> HealthForecast
await async_client.health.heat_injury(location: Sequence[TownshipInput]) -> Mapping[Township, HealthForecast]

health.temperature_difference

def temperature_difference(location: None = None, *, hourly: bool = False) -> tuple[HealthForecast, ...]
def temperature_difference(location: TownshipInput, *, hourly: bool = False) -> HealthForecast
def temperature_difference(location: Sequence[TownshipInput], *, hourly: bool = False) -> Mapping[Township, HealthForecast]

Return temperature difference forecasts, daily or three-hourly.

from cwa import health

result = health.temperature_difference("臺北市信義區")
client.health.temperature_difference(location: None = None, *, hourly: bool = False) -> tuple[HealthForecast, ...]
client.health.temperature_difference(location: TownshipInput, *, hourly: bool = False) -> HealthForecast
client.health.temperature_difference(location: Sequence[TownshipInput], *, hourly: bool = False) -> Mapping[Township, HealthForecast]
await async_client.health.temperature_difference(location: None = None, *, hourly: bool = False) -> tuple[HealthForecast, ...]
await async_client.health.temperature_difference(location: TownshipInput, *, hourly: bool = False) -> HealthForecast
await async_client.health.temperature_difference(location: Sequence[TownshipInput], *, hourly: bool = False) -> Mapping[Township, HealthForecast]

health.HealthForecast

name: str
township: TownshipCode
geocode: str
latitude: Number
longitude: Number
periods: Annotated[tuple[HealthPeriod, ...], ordered(start)]

A township and its health weather periods in time order.

health.HealthPeriod

start: OptionalTime
end: OptionalTime
index: Number
warning: Text
max_temperature: Number
min_temperature: Number

One forecast period.

Five-day products have start and end. Three-hourly products publish one time, stored as start, with end None. The index is None for the five-day temperature-difference product, which publishes only temperatures.