Introduction

This is the documentation for yweather. yweather is a Python module that provides an interface to the Yahoo! Weather RSS feed

Prerequisites

yweather requires Python 2.6, 2.7, or 3 to run.

Installation

There are multiple ways to install yweather. If you are unsure about which method to use, try pip.

Tarball Release

  1. Download the most recent release from yweather’s PyPi page.
  2. Unpack the tarball.
  3. From inside the yweather-0.X directory, run python setup.py install

This will install yweather in your Python’s site-packages directory.

Install the Development Version

yweather’s code is hosted at GitHub. To install the development version, do the following:

  1. Make sure Git is installed. Test if it’s installed by running git --version
  2. git clone git://github.com/tsroten/yweather.git
  3. pip install -e yweather

This will link the yweather directory into your site-packages directory. You can find out where your site-packages directory is by running:

python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"

Basic Usage

>>> import yweather
>>> client = yweather.Client()
>>> client.fetch_woeid("Oslo, Norway")
'862592'
>>> oslo_weather = client.fetch_weather("862592")
>>> oslo_weather["atmosphere"]["pressure"]
'30.24'
>>> oslo_weather["condition"]["text"]
'Mostly Cloudy'

This code creates a yweather.Client instance that allows you to fetch a location’s WOEID and weather. The weather data is returned as a dict.

Project Versions

Table Of Contents

Previous topic

Welcome to yweather’s documentation!

Next topic

Usage

This Page