A Python wrapper for the NSW Government's Beachwatch API.
Project description
beachwatch 🏖️
beachwatch
is a Python wrapper for the NSW Government's Beachwatch API.
In their own words:
"Beachwatch and our partners monitor water quality at swim sites to ensure that recreational water environments are managed as safely as possible so that as many people as possible can benefit from using the water."
With this package you can retrieve data about a NSW beach's water pollution forecast, water quality rating, coordinates and more.
Installation
pip install beachwatch
Usage
There is only one function - get_beaches()
function, which returns Beach
objects:
>>> get_beaches() # Returns a list of all Beach objects.
>>> get_beaches("Bondi Beach") # Returns a list with the specified beach.
>>> get_beaches("Bondi Beach", "Whale Beach") # Returns a list with the specifies beaches.
The Beach
object:
class Beach:
"""A NSW beach.
Attributes
----------
identifier : str
Unknown but likely a unique ID within the Beachwatch database.
name : str
The name of the beach.
pollution_forecast : str
The latest water quality pollution forecast.
pollution_forecast_timestamp : datetime.datetime
What time the forecast was issued by Beachwatch.
latest_result : str
A water quality rating based on the number of bacteria (enterococci)
in the most recent water sample.
latest_result_rating : int
The latest water quality result, rated from 1 to 4 to indicate
suitability for swimming.
latest_result_observation_timestamp : datetime.datetime
The most recent sampling date.
geometry : dict
A GeoJSON feature with the coordinates of the beach.
"""
Note that the Beach
object is not meant to be instantiated directly.
Example
>>> bondi = get_beaches("Bondi Beach")[0]
>>> bondi.pollution_forecast
'Good'
Important
Beachwatch notes on their website that forecasts "are predictions of water quality only and are not 100% accurate. Beachwatch cannot guarantee the accuracy of any of the results or outputs from this model. Any reliance you place on such information is strictly at your own risk."
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
Built Distribution
File details
Details for the file beachwatch-0.1.4.tar.gz
.
File metadata
- Download URL: beachwatch-0.1.4.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06f92d391fa739f4badb149a46fbe9298a651a7a6b8f180753313159dc13abb1 |
|
MD5 | 05650dc3fb30b778243e8b80c69f2e21 |
|
BLAKE2b-256 | b421ad7715e60ea1d1e6651e860faa22f6ad063ad21e4e32669b4bbca9803487 |
File details
Details for the file beachwatch-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: beachwatch-0.1.4-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc458d092e945f77bba4b33768ccebdd036744ff88a60fa914e7aae87dc9b3df |
|
MD5 | d125ebb7fde25fa4c7c6ae850f048fd7 |
|
BLAKE2b-256 | c771cc779cb4910e9ae2e29051a3d6dd7133aee437978278179e44c5c165e9bb |