GithubHelp home page GithubHelp logo

web5design / python-yahoo-weather Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tupton/python-yahoo-weather

0.0 3.0 0.0 73 KB

A simple Python script that uses the Yahoo! RSS weather API.

Home Page: http://www.thomasupton.com/blog/2008/04/yahoo-weather-feeds-with-python/

python-yahoo-weather's Introduction

Python Yahoo Weather

Fetches weather reports from Yahoo! Weather.

Written by Thomas Upton with contributions from Chris Lasher.

This code is licensed under a BY-NC-SA Creative Commons license.

See the blog post for more information.

Usage: weather.py [options] location_code

$ weather.py --help

for options and their descriptions.

Weather data can be printed to an output file with the --output option.

$ weather.py 24060 --output='weather.txt'

If a weather report cannot be generated, the specified output file is not altered. This is useful when attempting to cache weather output while, for instance, on a flaky network connection. To attempt to update the weather file and output its contents, one could use the following command. If the weather could not be loaded, the previous contents of the file are shown.

$ weather.py 24060 --output='weather.txt' && cat weather.txt

Example Usage

Default output

$ weather.py 24060
25F and Partly Cloudy

Metric units

$ weather.py -m 24060
-4C and Partly Cloudy

Different delimiter

$ weather.py -d " / " 24060
50F / Mostly Cloudy

With two days' forecast

$ weather.py -lf2 24060
Blacksburg VA

25F and Partly Cloudy

  17 Jan 2009
    High: 30F
    Low: 22F
    Condition: Partly Cloudy
  18 Jan 2009
    High: 39F
    Low: 25F
    Condition: PM Snow Showers

With headers

$ weather.py -lvf2 24060
Location:
Blacksburg VA

Current conditions:
25F and Partly Cloudy

Forecast:
  17 Jan 2009
    High: 30F
    Low: 22F
    Condition: Partly Cloudy
  18 Jan 2009
    High: 39F
    Low: 25F
    Condition: PM Snow Showers

python-yahoo-weather's People

Contributors

tupton avatar

Watchers

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