pyowm package



pyowm.constants module

Constants for the PyOWM library

Module contents

The PyOWM init file

Author: Claudio Sparpaglione, @csparpa <>

Platform: platform independent

pyowm.OWM(API_key='b1b15e88fa797225412429c1c50c122a', version='2.5', config_module=None, language=None, subscription_type=None)[source]

A parametrized factory method returning a global OWM instance that represents the desired OWM web API version (or the currently supported one if no version number is specified)

  • API_key (str) – the OWM web API key (defaults to a test value)
  • version (str) – the OWM web API version. Defaults to None, which means use the latest web API version
  • config_module (str (eg: 'mypackage.mysubpackage.myconfigmodule')) – the Python path of the configuration module you want to provide for instantiating the library. Defaults to None, which means use the default configuration values for the web API version support you are currently requesting. Please be aware that malformed user-defined configuration modules can lead to unwanted behaviour!
  • language (str) – the language in which you want text results to be returned. It’s a two-characters string, eg: “en”, “ru”, “it”. Defaults to: None, which means use the default language.
  • subscription_type (str) – the type of OWM web API subscription to be wrapped. Can be ‘free’ (free subscription) or ‘pro’ (paid subscription), Defaults to: ‘free’

an instance of a proper OWM subclass


ValueError when unsupported OWM API versions are provided