-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
286 changed files
with
7,825 additions
and
11,657 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
include pyowm/pollutionapi30/xsd/*.xsd | ||
include pyowm/stationsapi30/xsd/*.xsd | ||
include pyowm/uvindexapi30/xsd/*.xsd | ||
include pyowm/weatherapi25/cityids/*.gz | ||
include pyowm/weatherapi25/xsd/*.xsd | ||
include pyowm/docs/*.md | ||
include pyowm/requirements.txt | ||
include pyowm/commons/cityids/*.bz2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
coverage | ||
coveralls | ||
Jinja2 | ||
pip>=18.0 | ||
pproxy==2.2.0 | ||
pytest | ||
recommonmark | ||
Sphinx | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,4 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
The PyOWM init file | ||
**Author**: Claudio Sparpaglione, @csparpa <csparpa@gmail.com> | ||
**Platform**: platform independent | ||
""" | ||
|
||
from pyowm import constants | ||
from pyowm.utils import timeutils, stringutils | ||
|
||
|
||
stringutils.check_if_running_with_python_2() | ||
|
||
|
||
def OWM(API_key=constants.DEFAULT_API_KEY, version=constants.LATEST_OWM_API_VERSION, | ||
config_module=None, language=None, subscription_type=None, use_ssl=None): | ||
""" | ||
A parametrized factory method returning a global OWM instance that | ||
represents the desired OWM Weather API version (or the currently supported one | ||
if no version number is specified) | ||
:param API_key: the OWM Weather API key (defaults to a test value) | ||
:type API_key: str | ||
:param version: the OWM Weather API version. Defaults to ``None``, which means | ||
use the latest web API version | ||
:type version: str | ||
:param config_module: 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! | ||
:type config_module: str (eg: 'mypackage.mysubpackage.myconfigmodule') | ||
:param language: 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. | ||
:type language: str | ||
:param subscription_type: the type of OWM Weather API subscription to be wrapped. | ||
Can be 'free' (free subscription) or 'pro' (paid subscription), | ||
Defaults to: 'free' | ||
:type subscription_type: str | ||
:param use_ssl: whether API calls should be made via SSL or not. | ||
Defaults to: False | ||
:type use_ssl: bool | ||
:returns: an instance of a proper *OWM* subclass | ||
:raises: *ValueError* when unsupported OWM API versions are provided | ||
""" | ||
if version == '2.5': | ||
if config_module is None: | ||
config_module = "pyowm.weatherapi25.configuration25" | ||
cfg_module = __import__(config_module, fromlist=['']) | ||
from pyowm.weatherapi25.owm25 import OWM25 | ||
if language is None: | ||
language = cfg_module.language | ||
if subscription_type is None: | ||
subscription_type = cfg_module.API_SUBSCRIPTION_TYPE | ||
if subscription_type not in ['free', 'pro']: | ||
subscription_type = 'free' | ||
if use_ssl is None: | ||
use_ssl = cfg_module.USE_SSL | ||
return OWM25(cfg_module.parsers, API_key, cfg_module.cache, | ||
language, subscription_type, use_ssl) | ||
raise ValueError("Unsupported OWM Weather API version") | ||
from pyowm.owm import OWM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
from pyowm import constants | ||
from pyowm.utils.strings import version_tuple_to_str | ||
|
||
__title__ = 'pyowm' | ||
__description__ = 'A Python wrapper around OpenWeatherMap web APIs' | ||
__url__ = 'https://github.com/csparpa/pyowm' | ||
__version__ = version_tuple_to_str(constants.PYOWM_VERSION) | ||
__author__ = 'Claudio Sparpaglione' | ||
__author_email__ = 'csparpa@gmail.com' | ||
__license__ = 'MIT' |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.