https://github.com/giocaizzi/pysurfline
Python Surfline API
https://github.com/giocaizzi/pysurfline
forecast python surf surfline v2
Last synced: about 2 months ago
JSON representation
Python Surfline API
- Host: GitHub
- URL: https://github.com/giocaizzi/pysurfline
- Owner: giocaizzi
- License: mit
- Created: 2022-02-12T11:56:04.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-29T09:57:33.000Z (9 months ago)
- Last Synced: 2024-10-14T00:06:53.603Z (7 months ago)
- Topics: forecast, python, surf, surfline, v2
- Language: Python
- Homepage: https://giocaizzi.github.io/pysurfline/
- Size: 5.9 MB
- Stars: 18
- Watchers: 2
- Forks: 7
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pysurfline

**Get the surf forecast** for any spot listed on [Surfline](https://www.surfline.com/).
Quickly get the forecast data as a [pandas Dataframe](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) and plot surf forecast with [matplotlib](https://matplotlib.org/stable/) 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 |   [](https://pepy.tech/project/pysurfline)|
| Builds |[](https://github.com/giocaizzi/pysurfline/actions/workflows/deployment-macos.yml)[](https://github.com/giocaizzi/pysurfline/actions/workflows/deployment-ubuntu.yml)[](https://github.com/giocaizzi/pysurfline/actions/workflows/deployment-windows.yml) |
|Tests| [](https://codecov.io/gh/giocaizzi/pysurfline) |
| Documentation | [](https://github.com/giocaizzi/pysurfline/actions/workflows/documentation.yml) |## 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.](https://giocaizzi.github.io/pysurfline/examples/SpotForecasts.html)
```python
import pysurflinespotId = "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.](https://giocaizzi.github.io/pysurfline/examples/SurfReport.html)
```python
import pysurflinespotId = "5842041f4e65fad6a7708cfd"
spotforecasts = pysurfline.get_spot_forecasts(spotId)
pysurfline.plot_surf_report(
spotforecasts,
barLabels=True,
)
```## Documentation
The documentation can be found [here](https://giocaizzi.github.io/pysurfline/).
## 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](https://github.com/giocaizzi/pysurfline/issues) or submit a [pull request](https://github.com/giocaizzi/pysurfline/pulls).