Giter VIP home page Giter VIP logo

wx-mail's Introduction

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. 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. ...

wx-mail's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.