Package: weather-au
Australian Weather Data (using bom.gov.au)Access to the AustralianBureau of Meteorologyweather data.Currently a work in progress subject to breaking changes!PurposeThe purpose of these modules is to fetch weather data from various Australian Bureau of Meteorology websites.Weather APIFetches data from the API's atapi.weather.bom.gov.au(e.g.Parkville 3-hourly forecast).This information has been reverse engineered from thebeta websitewith no information about future access arrangements, content or availability.Example usingWeatherApiimportsysfromweather_auimportapiw=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).iflocationisNone:sys.exit('Search failed for location '+loc)print(f"\nLocation:{location['name']}{location['state']}, timezone:{location['timezone']}\n")forwarninw.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:')forfinw.forecasts_3hourly():print(f"{f['time']}temp:{f['temp']:2},{f['icon_descriptor']}")Example usingSummaryfromweather_auimportsummaryprint(summary.Summary(search='parkville+vic'))XML and ScrapingModules: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 basedpages.Where possible WeatherApi, should be used as it uses an API rather than scraping the web page.Sample for Parkville in Melbourne Vic Australiafromweatherimportplace,observations,uv_index# Parse http://www.bom.gov.au/places/vic/parkvilleplace_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)DisclaimerThis project is not related to or endorsed by the Australian Bureau of Meteorology (BOM).From the BOMcopyright 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.UsageAdditional examples are in theexamplesfolder.URL'sBase for anon FTP dataftp://ftp.bom.gov.au/anon/gen/Capital City Observations - VIC - Melbourne (Olympic Park)http://www.bom.gov.au/fwo/IDV60901/IDV60901.95936.jsonwhereIDV60901is the product, and95936is the weather station id.Weather Observations - VIC - Melbourne (Olympic Park)http://www.bom.gov.au/fwo/IDV60910/IDV60910.95936.jsonhttp://www.bom.gov.au/places/vic/parkville/ResourcesNew weather pageFTP public productsWeather Data ServicesHow to use BOM API for weather, tide and swellGithub has a number of projects using bom.gov.au data256 km Melbourne Radar LoopCatalogue of RSS Feeds