Skip to Content
cwa
API reference

Tsunamis

tsunamis.latest

def latest() -> Tsunami | None

Return the newest tsunami report, or None when there is none.

client.tsunamis.latest() -> Tsunami | None
await async_client.tsunamis.latest() -> Tsunami | None

tsunamis.recent

def recent(*, limit: int = 20) -> tuple[Tsunami, ...]

Return tsunami reports, newest first.

from cwa import tsunamis

reports = tsunamis.recent(limit=5)
client.tsunamis.recent(*, limit: int = 20) -> tuple[Tsunami, ...]
await async_client.tsunamis.recent(*, limit: int = 20) -> tuple[Tsunami, ...]

tsunamis.Tsunami

number: int
report: Text
type: str
color: Text
text: Text
issued_at: Time
expires_at: OptionalTime
web: Text
earthquake: TsunamiEarthquake
areas: tuple[TsunamiArea, ...]
stations: tuple[TsunamiStation, ...]

A CWA tsunami report, warning or cancellation.

status is “observe” for measurements and “predict” for forecasts. wave_height keeps the published text, such as “小於0.3公尺” or “7公分”.

tsunamis.TsunamiArea

name: str
description: Text
color: Text
arrival_at: OptionalTime
wave_height: Text
status: Text

A coastal area and its predicted or observed arrival.

tsunamis.TsunamiEarthquake

occurred_at: Time
source: Text
depth_km: Number
location: Text
latitude: Number
longitude: Number
magnitude: Number

The earthquake that triggered the report.

tsunamis.TsunamiStation

id: str
name: str
latitude: Number
longitude: Number
arrival_at: OptionalTime
wave_height: Text
status: Text

A tide station and its predicted or observed tsunami wave.