Coder Social home page Coder Social logo

beachwatch's Introduction

beachwatch ๐Ÿ–๏ธ

Testing versions License

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."

beachwatch's People

Contributors

ben-n93 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.