Code Monkey home page Code Monkey logo

py-weather-forecast-email's Introduction

py-weather-forecast-email

This is a Python3 command-line app that will send the current weather forecast and the listed day's schedule to a list of emails.

Project Requirements

You must have Python 3.4+ installed to run this application. The development test site used Python 3.6.3, but I believe that 3.4+ will be fine.

To clone this app, enter these commands:

git clone https://github.com/SHoar/py-weather-forecast-email.git && cd py-weather-forecast-email

This email smtp handler sends email with TLS encryption. If you are using GMail to send your emails, you must either change your sender email account to 'allow less secure apps' or use App Passwords, but this application repo is using the former method.

In order to use this applications, there are three required files you will need:

  1. emails.txt - This file must list the emails that will be sent to, in order of email_address , name on each line. This file has not been included, and you must create it on your own.
  2. schedule.txt - This file will have a list of events and times, with each line being one event. You may use the file included, but I suggest putting in your own real schedule.
  3. secrets.py - This application utilizes the OpenWeatherMaps Current Weather API. You will need to sign up for an API key, if you have not already done so, and use it as the APP_ID for the query string inside weather.py

The application will ask you what city you want to look up. Once the query is made, this city's weather will be sent to each email in the emails.txt file, along with the schedule that is in schedule.txt.

The command-line tool will ask you for your email password, but it uses the python library getpass to prompt the user, so the password will not be seen in the terminal as it is typed.

To run the program, there are a couple different ways to do it. If you like typing alot, type: python3 emailer.py and hit enter to run.

If you prefer shortcuts, I've created a Windows batch file (weather.bat), or weather.sh if you prefer bash/linux shell.

So, to execute--

On Windows:

  1. double-click weather.bat from the File Explorer, or run it from the commmand prompt in Powershell or the MS-DOS prompt.
On Linux/ MacOS:
  1. From the terminal, run bash weather.sh or sh weather.sh

You should be confirmed with a count of how many emails have been sent when the process has finished.

py-weather-forecast-email's People

Contributors

shoar avatar

Watchers

James Cloos avatar

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.