Check for local low tides from NOAA within your day schedule. python, lxml, xpath
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
flask_lowtides.py
tides.py
tides.xml

README.md

Display the times of low tide in your area, and only within your open schedule.


Updated: included a fully self-contained Flask web app.

This is my quick solution to display the times of low tide so I know when I could bring my dog out for a walk on the beach.  See my blog post about this.  Since I can go only in the morning or early evening, this script shows low tides only during these two windows of time.

Thanks to taxpayers' money, NOAA provides annual daily predictions of tides at different spots across the country.  You can download your local tides data in XML format at: http://tidesandcurrents.noaa.gov/tide_predictions.html

Note: lxml and xpath is used for fast and simple XML processing / filtering

If using Ubuntu: sudo apt-get install python3-lxml

Set your available schedule using the morning/evenings start/end arguments.

The script accepts an argument --daydeltas so you can receive 'x' number of days worth of tide predictions that are within your open schedule.

tides.py -xf tides.xml -d 0 1 2 -ms 7:00am -me 10:30am -es 4:00pm -ee 8:30pm

Subject: Low Tides
Upcoming low tides within your available schedule:

      Today   2016/03/26  09:29 AM   0.5

Tomorrow  2016/03/27  09:52 AM   0.6 Future     2016/03/28  10:17 AM   0.7

python3 tides.py -h
usage: tides.py [-h] [-d N [N ...]] [-xf XMLFILE] [-ms MORNING_START]
                [-me MORNING_END] [-es EVENING_START] [-ee EVENING_END]

Get low tides for your available schedule

optional arguments: -h, --help show this help message and exit -d N [N ...], --daydeltas N [N ...] Day deltas to process, i.e. 0 1 2 3 4 -xf XMLFILE, --xmlfile XMLFILE Your local tides XML file -ms MORNING_START, --morning_start MORNING_START Your morning start time. -me MORNING_END, --morning_end MORNING_END Your morning end time. -es EVENING_START, --evening_start EVENING_START Your evening start time. -ee EVENING_END, --evening_end EVENING_END Your evening end time.