Skip to content

Nobatek/openweathermap-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openweathermap-client

Build status

Code coverage

About

OpenWeatherMap API client to retrieve current weather and forecasts for cities over the world, and concentrating on free access datas.

Examples

from openweathermap_client import OpenWeatherMapClient
from openweathermap_client.exceptions import OWMClientAccessLimitationError

# Init client with your personal API key
client = OpenWeatherMapClient('api_key_here')

try:
    # Get forecast data by city ID
    result_data = client.get_forecast_by_city_id('city_id')
    # Response contains information about 5 day / 3 hour forecast,
    #  see https://openweathermap.org/forecast5#parameter
except OWMClientAccessLimitationError as exc:
    # Remember to catch exceptions when sending requests...
    pass

Installation

pip install setup.py

Development

Use a virtual environnement to debug or develop

# Create virtual environment
$ virtualenv -p /usr/bin/python3 $VIRTUALENVS_DIR/openweathermap-client

# Activate virtualenv
$ source $VIRTUALENVS_DIR/openweathermap-client/bin/activate

Tests

# Install test dependencies
$ pip install -e .[test]

# Run tests
$ py.test

# Skip slow tests
$ py.test -m 'not slow'

# Run tests with coverage
$ py.test --cov=openweathermap_client --cov-report term-missing

About

OpenWeatherMap API client in Python 3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages