Giter VIP home page Giter VIP logo

daily-briefings-py's Introduction

Daily Briefings App (Python)

Sends you a customized email every morning, with information of interest, such as the upcoming weather forecast for your zip code.

Installation

Fork this repo, then clone or download the forked repo onto your local computer (for example to the Desktop), then navigate there from the command-line:

cd ~/Desktop/daily-briefings-py/

Use Anaconda to create and activate a new virtual environment, perhaps called "briefings-env":

conda create -n briefings-env python=3.8
conda activate briefings-env

Then, within an active virtual environment, install package dependencies:

pip install -r requirements.txt

Configuration

Follow these SendGrid setup instructions to sign up for a SendGrid account, configure your account's email address (i.e. SENDER_EMAIL_ADDRESS), and obtain an API key (i.e. SENDGRID_API_KEY).

Create a new file called ".env" in the root directory of this repo, and paste the following contents inside, using your own values as appropriate:

# these are example contents for the ".env" file:

# required vars:
SENDGRID_API_KEY="_______________"
SENDER_EMAIL_ADDRESS="_______________"

# optional vars:
#APP_ENV="development"
#COUNTRY_CODE="US"
#ZIP_CODE="10017"
#USER_NAME="Jon Snow"

Usage

Printing today's weather forecast (to test the Weather.gov API):

python -m app.weather_service

# in production mode:
APP_ENV="production" COUNTRY_CODE="US" ZIP_CODE="20057" python -m app.weather_service

Sending an example email (to test the SendGrid service):

python -m app.email_service

NOTE: the SendGrid emails might first start showing up in spam, until you designate them as coming from a trusted source (i.e. "Looks Safe")

Sending the weather forecast in an email:

python -m app.daily_briefing

# in production mode:
APP_ENV="production" COUNTRY_CODE="US" ZIP_CODE="20057" python -m app.daily_briefing

Testing

Running tests:

pytest

# in CI mode:
CI=true pytest

Follow the deployment instructions to deploy the app to a remote server and schedule the server to send you the weather forecast email every day.

daily-briefings-py's People

Contributors

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