Skip to main content

Australian Weather Data (from bom.gov.au)

Project description

Australian Weather Data (using bom.gov.au)

Access to the Australian Bureau of Meteorology weather data.

Actions Status PyPI

Currently a work in progress subject to breaking changes!

Purpose

The purpose of these modules is to fetch weather data from various Australian Bureau of Meteorology websites.

Weather API

Fetches data from the API's at api.weather.bom.gov.au (e.g. Parkville 3-hourly forecast).

This information has been reverse engineered from the beta website with no information about future access arrangements, content or availability.

Example using WeatherApi

import sys
from weather_au import api

w = api.WeatherApi(search='parkville+vic', debug=0)

location = w.location()

# check if the search produced a result (other methods will also return None if the search fails).
if location is None:
    sys.exit('Search failed for location ' + loc)

print(f"\nLocation: {location['name']} {location['state']}, timezone:{location['timezone']}\n")

for warn in w.warnings():
    print(f"Warning short title:  {warn['short_title']}")

    warning = w.warning(id=warn['id'])
    print(f"Warning title:        {warning['title']}")

observations = w.observations()
print(f"\nObservations (temp): {observations['temp']:2}")

forecast_rain = w.forecast_rain()
print(f"Forecast Rain:       amount:{forecast_rain['amount']}, chance:{forecast_rain['chance']}")

print('\n3 Hourly:')
for f in w.forecasts_3hourly():
    print(f"{f['time']} temp:{f['temp']:2}, {f['icon_descriptor']}")

Example using Summary

from weather_au import summary

print(summary.Summary(search='parkville+vic'))

XML and Scraping

Modules:

  • observations - fetch XML formatted data from the BOM FTP server.
  • uv_index - fetch the UV data from the XML encoded state based IDZ00107-IDZ00113 products.
  • place - scrape data from location based pages.

Where possible WeatherApi, should be used as it uses an API rather than scraping the web page.

Sample for Parkville in Melbourne Vic Australia

from weather import place, observations, uv_index

# Parse http://www.bom.gov.au/places/vic/parkville
place_data = place.Place('vic', 'parkville')
print(place_data.acknowedgment)

station_id = place_data.station_id()
print('Station ID',station_id)

air_temperature = place_data.air_temperature()
print('Air Temperature', air_temperature)

forecast = place_data.forecast()
print('Forecast', forecast)


uv_data = uv_index.UvIndex('Vic')
print('\n' + uv_data.acknowedgment)

location_name = 'Melbourne'
uv_message = uv_data.uv_message(uv_data.get_aac(location_name))

print('UV Message for', location_name, uv_message)

Disclaimer

This project is not related to or endorsed by the Australian Bureau of Meteorology (BOM).

From the BOM copyright notice: Where no terms of use are associated with a set of material, then you may download, use and copy that material for personal use, or use within your organisation but you may not supply that material to any other person or use it for any commercial purpose.

Usage

Additional examples are in the examples folder.

URL's

  • Base for anon FTP data ftp://ftp.bom.gov.au/anon/gen/
  • Capital City Observations - VIC - Melbourne (Olympic Park) http://www.bom.gov.au/fwo/IDV60901/IDV60901.95936.json
    • where IDV60901 is the product, and
    • 95936 is the weather station id.
  • Weather Observations - VIC - Melbourne (Olympic Park) http://www.bom.gov.au/fwo/IDV60910/IDV60910.95936.json
  • http://www.bom.gov.au/places/vic/parkville/

Resources

  1. New weather page
  2. FTP public products
  3. Weather Data Services
  4. How to use BOM API for weather, tide and swell
  5. Github has a number of projects using bom.gov.au data
  6. 256 km Melbourne Radar Loop
  7. Catalogue of RSS Feeds

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

weather-au-0.0.7.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

weather_au-0.0.7-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file weather-au-0.0.7.tar.gz.

File metadata

  • Download URL: weather-au-0.0.7.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.2

File hashes

Hashes for weather-au-0.0.7.tar.gz
Algorithm Hash digest
SHA256 68057ab011cfe1fb2bb9741e8317533c8f6bf649d0cd728ec7434c77d6b042c9
MD5 e3d87726debd2ce9a5ae9e4900267b83
BLAKE2b-256 211e2085da1363ce9a1b72e5e40658ea2e9e8d889467e254bd7aa97748060816

See more details on using hashes here.

File details

Details for the file weather_au-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: weather_au-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.2

File hashes

Hashes for weather_au-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 da86c1c463fa93b9c5383bcffd96174b0065bb2f8e1586233cc307062696f399
MD5 673a004f1a9f84d0c080901b273415a0
BLAKE2b-256 146664b84695fca1ba8b4f07c1ebefb52327c3144dd492a58ea78d43d68028af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page