Coder Social home page Coder Social logo

justingiffard / flask_weather Goto Github PK

View Code? Open in Web Editor NEW

This project forked from m0nica/flask_weather

0.0 1.0 0.0 444 KB

☀️ ☔️ Flask app to auto-detect local weather based off of user's IP address.

Home Page: https://clima-weather.herokuapp.com/

Python 59.65% HTML 40.35%

flask_weather's Introduction

Flask Weather App ☀️☔️

This is a Flask (Python) application that auto-detects local weather based off of user's external IP address.

Example screenshot of flask_weather application

Setup

  • Install dependencies
  • pip install -r requirements.txt
  • Add environment variables
    • weather_key="###############";. The weather_key is the API key received from registering at https://darksky.net/dev.
    • add secret_key="********". It should be a random string that is hard to guess.
  • Run
    • python app.py
  • Run Tests
    • python flask_weather_tests.py

Functionality

Gets a user's external IP address and then used http://freegeoip.net to get more specific location information to pass into Weather API (https://darksky.net/dev/). Weather information (current temperature and % chance of rain) is returned based on the location associated with the IP.

To work on this locally clone the repo, request and add an API key (locally) from darksky and then run app.py

weather.html displays the weather information and displays appropriate weather icon (https://erikflowers.github.io/weather-icons/) based on what the current weather is.

To display temperature in Celsius instead of Fahrenheit, set celsius = True environment variables.

Sample Output:

Today's Weather Forecast for Brooklyn, New York

Right now it is 41° and there is a 0% chance of rain.

Today's Weather Forecast for City, State

Right now it is X° and there is a Y% chance of rain.

flask_weather's People

Contributors

m0nica avatar psyonara avatar jcyktor avatar vayupranaditya avatar abhiagarwal192 avatar blitzh0t avatar byarmis avatar dillionverma avatar mtenmann avatar tekknolagi avatar tmarthal avatar ming060 avatar joviij 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.