Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anthonydb/wx-mail
A simple app to email yourself the weather forecast each day.
https://github.com/anthonydb/wx-mail
Last synced: 4 days ago
JSON representation
A simple app to email yourself the weather forecast each day.
- Host: GitHub
- URL: https://github.com/anthonydb/wx-mail
- Owner: anthonydb
- Created: 2015-08-12T15:02:22.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-03-17T03:07:47.000Z (over 5 years ago)
- Last Synced: 2023-03-13T06:25:26.478Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wx-mail
I'm a weather nerd. I also own a Raspberry Pi. So, what better coding project than a short Python script that lets the Pi email me the weather forecast every day? Because: Lazy. Also, I wanted to learn more about using Python to send emails.
## Usage
* Sign up for a free API key from [Dark Sky](https://darksky.net/dev). You won't be hitting the API much, so the free plan will work just fine.
* Find the latitude and longitude of the place you want for your forecast.
* Add those coordinates, your API key and your email information to `settings.py`. In there, you can also specify a list of the email addresses to send your forecast to.
* You'll probably want to edit the email HTML to suit your needs.
* Set this to run on a cron job and enjoy a fresh forecast in your inbox.## Requirements
You'll need two Python libraries:
```
pip install requests darkskylib
```## Results
The email text ends up looking like this (of course, you can customize it):
**Hello!**
Here's the weather forecast as of March 16, 2019, at 8:00 PM
**Today's Look Ahead**
Snow (< 1 in.) on Monday, with high temperatures bottoming out at 47°F on Monday.
**Your Big Weekly Forecast**
**Saturday, 3/16**
Partly cloudy until afternoon.
\* High 57; low 39.
\* Sunrise 7:21 am; set 7:19 pm.
**Sunday, 3/17**
Mostly cloudy starting in the evening.
\* High 51; low 32.
\* Sunrise 7:20 am; set 7:20 pm.
**Monday, 3/18**
Light snow (< 1 in.) in the morning.
\* High 47; low 33.
\* Sunrise 7:18 am; set 7:21 pm.
*etc. ...*