Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.2.1 #61

Merged
merged 7 commits into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .flake8

This file was deleted.

4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ updates:
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "pip"

- package-ecosystem: "pip"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
2 changes: 1 addition & 1 deletion .github/workflows/deployment-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
deploy-macos:
uses: giocaizzi/python-dev-actions/.github/workflows/deployment.yml@main
with:
os: 'macos-latest'
os: 'macos-latest'
2 changes: 1 addition & 1 deletion .github/workflows/deployment-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ on:

jobs:
deploy-ubuntu:
uses: giocaizzi/python-dev-actions/.github/workflows/deployment.yml@main
uses: giocaizzi/python-dev-actions/.github/workflows/deployment.yml@main
2 changes: 1 addition & 1 deletion .github/workflows/deployment-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
deploy-windows:
uses: giocaizzi/python-dev-actions/.github/workflows/deployment.yml@main
with:
os: 'windows-latest'
os: 'windows-latest'
109 changes: 104 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
.vscode
temp

# -- Default github Python --
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
Expand All @@ -23,6 +30,12 @@ share/python-wheels/
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt
Expand All @@ -41,12 +54,31 @@ coverage.xml
.hypothesis/
.pytest_cache/
cover/
*.lcov

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

#dataframes
*.csv
# Scrapy stuff:
.scrapy

# Sphinx documentation
docsrc/build/
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints
Expand All @@ -55,6 +87,45 @@ docsrc/build/
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
Expand All @@ -64,5 +135,33 @@ ENV/
env.bak/
venv.bak/

# personal
temp
# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
87 changes: 87 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# pre-commit configuration
# https://pre-commit.com/
# use pre-commit hooks to enforce code style
repos:
# ------------------------------
# General Code Style rules
# ------------------------------
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
# check credentials
- id: detect-private-key
# test names are correct
- id: name-tests-test
args: [--pytest-test-first]
# checks for files that contain merge conflict strings
- id: check-merge-conflict
# checks toml files for parseable syntax.
- id: check-toml
# checks yaml files for parseable syntax.
- id: check-yaml
# check JSON
- id: check-json
# ensures that a file is either empty, or ends with one newline.
- id: end-of-file-fixer
# trims trailing whitespace
- id: trailing-whitespace
# ------------------------------
# Python
# ------------------------------
# # Bandit
# - repo: https://github.com/PyCQA/bandit
# rev: 1.7.9
# hooks:
# - id: bandit
# autoflake : removes unused imports and unused variables
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
# ------------------------------
# isort: sorts imports
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
# ------------------------------
# Black: code formatter
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
# Black Jupyter
- id: black-jupyter
# blacken-docs: run black in python codeblocks
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
# ------------------------------
# mypy
# ------------------------------
# Flake8
- repo: https://github.com/pycqa/flake8
rev: 7.1.0
hooks:
- id: flake8
additional_dependencies:
# read config from pyproject.toml
- flake8-pyproject
# - flake8-simplify # help simplify code
# - flake8-bugbear # finds bugs
# - flake8-docstrings
- flake8-rst-docstrings # rst docstrings
# - flake8-spellcheck # spellcheck docstrings
# - flake8-datetimez # no naive datetime
# - flake8-annotations-complexity # check annotations complexity
# - flake8-expression-complexity # check expression complexity
# - flake8-black # enforce black formatting
# ------------------------------
# Markdown
# ------------------------------
# mdformat: format markdown files
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
7 changes: 0 additions & 7 deletions .vscode/settings.json

This file was deleted.

50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@ Quickly get the forecast data as a [pandas Dataframe](https://pandas.pydata.org/
- **Tide** (height, direction)
- **sunlightTimes** (sunrise, sunset)


| | |
| --- | --- |
| Distribution | ![PyPI](https://img.shields.io/pypi/v/pysurfline?color=blue) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pysurfline) [![Downloads](https://static.pepy.tech/badge/pysurfline)](https://pepy.tech/project/pysurfline)|
| Builds |[![macOS](https://github.com/giocaizzi/pysurfline/actions/workflows/deployment-macos.yml/badge.svg?branch=main)](https://github.com/giocaizzi/pysurfline/actions/workflows/deployment-macos.yml)[![Ubuntu](https://github.com/giocaizzi/pysurfline/actions/workflows/deployment-ubuntu.yml/badge.svg)](https://github.com/giocaizzi/pysurfline/actions/workflows/deployment-ubuntu.yml)[![Windows](https://github.com/giocaizzi/pysurfline/actions/workflows/deployment-windows.yml/badge.svg)](https://github.com/giocaizzi/pysurfline/actions/workflows/deployment-windows.yml) |
|Tests| [![codecov](https://codecov.io/gh/giocaizzi/pysurfline/branch/main/graph/badge.svg?token=48CPYKM5BR)](https://codecov.io/gh/giocaizzi/pysurfline) |
| Documentation | [![Documentation build](https://github.com/giocaizzi/pysurfline/actions/workflows/documentation.yml/badge.svg?branch=gh-pages)](https://github.com/giocaizzi/pysurfline/actions/workflows/documentation.yml) |


## Installation

Install with `pip`

```
pip install pysurfline
```
Expand All @@ -32,46 +31,47 @@ pip install pysurfline

- 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)
[Go to full example.](https://giocaizzi.github.io/pysurfline/examples/SpotForecasts.html)

```python
import pysurfline
```python
import pysurfline

spotId = "5842041f4e65fad6a7708cfd"
spotId = "5842041f4e65fad6a7708cfd"

spotforecasts = pysurfline.get_spot_forecasts(
spotId,
days = 2,
intervalHours = 3,
)
spotforecasts = pysurfline.get_spot_forecasts(
spotId,
days=2,
intervalHours=3,
)

df = spotforecasts.get_dataframe()
```
df = spotforecasts.get_dataframe()
```

- Visualize the surf report for a given `SpotId`.

[Go to full example.](https://giocaizzi.github.io/pysurfline/examples/SurfReport.html)
[Go to full example.](https://giocaizzi.github.io/pysurfline/examples/SurfReport.html)

```python
import pysurfline
```python
import pysurfline

spotId = "5842041f4e65fad6a7708cfd"
spotId = "5842041f4e65fad6a7708cfd"

spotforecasts = pysurfline.get_spot_forecasts(spotId)
spotforecasts = pysurfline.get_spot_forecasts(spotId)

pysurfline.plot_surf_report(
spotforecasts,
barLabels = True,
)
```
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.
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).
Loading
Loading