Bom Weather
Get the Australian Bureau of Meteorology's 9-day forecast for any suburb or town, plus current observations, a 72-hour hourly forecast and active warnings — and know exactly when to poll for the next revision. WHAT IT DOES
Resolves a location from any one of five selectors — name, postcode, state, geohash or id — then reads from the Bureau's public API: the 9-day daily forecast (min/max temperature, rain chance and range, UV, fire danger, sunrise/sunset, précis text), the latest station observations (temperature, feels-like, humidity, wind, gust, rain since 9am), the 72-hour hourly forecast (wind, dew point, humidity, UV per hour), and active weather warnings with their full text. The daily response's own issue_time and next_issue_time are captured, so a scheduled workflow can poll on the Bureau's real cadence (a new forecast roughly every six hours) instead of a guessed interval, and can print today and tomorrow on demand.
INSTALL
swamp extension pull @svendowideit/bom-weatherDEPENDENCIES
None — it needs only the swamp CLI and outbound network access to api.weather.bom.gov.au.
RUN
# End-to-end: sync the daily forecast, observations, hourly forecast and
# warnings, then print a consolidated view — today/tomorrow with the
# issue cadence, the latest reading, the next hours and any warnings.
# Override the location per run with --input.
swamp workflow run @svendowideit/bom-weather \
--input name=Bathurst --input state=NSW
# Log all 72 hours and each warning's full message text.
swamp workflow run @svendowideit/bom-weather \
--input hourlyHours=0 --input warningsDetail=true
# Read one source on its own — observations, hourly or warnings.
swamp model @svendowideit/bom-weather method run observe bom \
--input postcode=2750
# Every active warning nationally, filtered to one state by the caller
# (the API ignores query filters, so this model filters client-side).
swamp model @svendowideit/bom-weather method run warnings bom \
--input scope=national --input state=NSW
# Just resolve a selector, to see how an ambiguous name maps to a place.
swamp model @svendowideit/bom-weather method run resolve bom \
--input postcode=2750CONFIGURE
All selectors are optional and resolved in the order geohash > id >
postcode > name; state narrows a search and disambiguates places that
share a name. Each selector can be set either as a model global argument
(the default a direct model call uses) or as a workflow input (a per-run
override). Pass a selector as --input on any command to override the
global:
# Create the model with Penrith, NSW as its default location.
swamp model create @svendowideit/bom-weather bom \
--global-arg name=Penrith --global-arg state=NSW
# One run against a different location, without changing the default.
swamp model @svendowideit/bom-weather method run sync bom \
--input name=Bathurst --input state=NSWOn the bundled workflow, the same selectors are workflow inputs:
swamp workflow run @svendowideit/bom-weather \
--input geohash=r1r0fup IMPORTANT — the bundled workflow's cron trigger carries its own location
(default Penrith, NSW) and passes it to the model on every run, so a model
global does NOT change what the scheduled sync fetches. To point the
schedule at your own location, set a trigger override, then apply it with
swamp serve reload (needs --hot-reload) or a serve restart:
# Poll Bathurst, NSW on the built-in 4x-daily cadence.
swamp workflow trigger set @svendowideit/bom-weather \
--schedule "30 6,12,18,0 * * *" \
--input name=Bathurst --input state=NSW
# Inspect built-in vs override vs effective.
swamp workflow trigger get @svendowideit/bom-weatherUPGRADE
bom-weather installs nothing on the host, so there is no in-place rebuild to run. Upgrade by updating the extension; model instances keep their stored configuration and cached snapshots, and the new version applies automatically on the next method run.
swamp extension update @svendowideit/bom-weatherWHAT IT INSTALLS
Nothing on the host. The bundled workflow declares a cron trigger
(four times daily) that fires when the workflow is run under
swamp serve; it writes no services, files, or webhooks. The trigger
carries a default location (Penrith, NSW) — override it for your own
location with swamp workflow trigger set (see CONFIGURE).
Global Arguments
| Argument | Type | Description |
|---|---|---|
| apiUrl? | string | BOM weather API base URL (versioned root). |
| userAgent? | string | User-Agent header sent with every request. |
| name? | string | Default suburb/town name to search for (e.g. 'Penrith'). |
| postcode? | string | Default Australian postcode to search for (e.g. '2750'). |
| state? | string | Default state/territory code (NSW, VIC, QLD, SA, WA, TAS, NT, ACT) |
| geohash? | string | Default six-character BOM geohash (e.g. 'r650hv8'). |
| id? | string | Default BOM location id (e.g. 'Penrith-r650hv8'). The trailing |
| Argument | Type | Description |
|---|---|---|
| dataName? | string | Resource instance holding the forecast to print (sync writes |
| hourlyHours? | number | How many hourly entries to log when an `hourly` snapshot exists |
| warningsDetail? | boolean | Include each warning's full HTML message text in the log when a |
Resources
Fetch and print the 9-day BOM forecast for one location, plus the current observations, the 72-hour hourly forecast and any active warnings. The final step prints today and tomorrow with the issue_time / next_issue_time. Location is chosen by any one of name, postcode, state, geohash or id — set the defaults on the `bom` model, or override per run with --input. The cron trigger polls four times daily, and the daily sync records the Bureau's own issue_time so callers can detect a genuinely new f
Modified 1 behaviors
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License1/2partial
no SPDX license declared
- Verified public repository2/2earned