allanbutler / pysurfline

Python Surfline API

Home Page:https://giocaizzi.github.io/pysurfline/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pysurfline

SurfReport plot

Get the surf forecast for any spot listed on Surfline.

Quickly get the forecast data as a pandas Dataframe and plot surf forecast with matplotlib to visualize the conditions of your favorite surf spot.

  • Surf (surf min, surf max)
  • Wind (speed, direction)
  • Swell (height, period, direction)
  • Tide (height, direction)
  • sunlightTimes (sunrise, sunset)
Distribution PyPI PyPI - Python Version Downloads
Builds macOSUbuntuWindows
Tests codecov
Documentation Documentation build

Installation

Install with pip

pip install pysurfline

Example

  • Get the surf forecasts for a given SpotId and get data as a pandas Dataframe. Control forecast timespan with days and intervalHours.

    Go to full example.

    import pysurfline
    
    spotId = "5842041f4e65fad6a7708cfd"
    
    spotforecasts = pysurfline.get_spot_forecasts(
        spotId,
        days = 2,
        intervalHours = 3,
    )
    
    df = spotforecasts.get_dataframe()
  • Visualize the surf report for a given SpotId.

    Go to full example.

    import pysurfline
    
    spotId = "5842041f4e65fad6a7708cfd"
    
    spotforecasts = pysurfline.get_spot_forecasts(spotId)
    
    pysurfline.plot_surf_report(
        spotforecasts,
        barLabels = True,
        )

Documentation

The documentation can be found here.

Disclaimer

This package is not official and not affiliated with Surfline in any way.

API responses may change at any time and the developement of this package may not be able to keep up with those changes.

If you find any issues, please open an issue or submit a pull request.

About

Python Surfline API

https://giocaizzi.github.io/pysurfline/

License:MIT License


Languages

Language:Python 100.0%