diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index b7634638..7da1c61b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -17,6 +17,7 @@ Code * [eumiro](https://github.com/eumiro) * [ggstuart](https://github.com/ggstuart) * [irahorecka](https://github.com/irahorecka) + * [JakeThomson](https://github.com/jakethomson) * [jwmelvin](https://github.com/jwmelvin) * [lardconcepts](https://github.com/lardconcepts) * [liato](https://github.com/liato) diff --git a/README.md b/README.md index ba7166ff..d5e5d5b2 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ PyOWM runs on Python 3.7+ ### What kind of data can I get with PyOWM ? With PyOWM you can integrate into your code any of the following OpenWeatherMap web APIs: - - **Weather API v2.5** + **OneCall API**, providing current weather data, weather forecasts, weather history + - **Weather API v3.0** + **OneCall API**, providing current weather data, weather forecasts, weather history - **Agro API v1.0**, providing soil data and satellite imagery search and download - **Air Pollution API v3.0**, providing data about CO, O3, NO2 and SO2 - **UV Index API v3.0**, providing data about Ultraviolet exposition diff --git a/pyowm/airpollutionapi30/airstatus.py b/pyowm/airpollutionapi30/airstatus.py index 3602c1b7..1573371f 100644 --- a/pyowm/airpollutionapi30/airstatus.py +++ b/pyowm/airpollutionapi30/airstatus.py @@ -3,7 +3,7 @@ from pyowm.commons import exceptions from pyowm.utils import formatting, timestamps -from pyowm.weatherapi25 import location +from pyowm.weatherapi30 import location class AirStatus: diff --git a/pyowm/airpollutionapi30/coindex.py b/pyowm/airpollutionapi30/coindex.py index e212a16e..9f95c787 100644 --- a/pyowm/airpollutionapi30/coindex.py +++ b/pyowm/airpollutionapi30/coindex.py @@ -3,7 +3,7 @@ from pyowm.commons import exceptions from pyowm.utils import formatting, timestamps -from pyowm.weatherapi25 import location +from pyowm.weatherapi30 import location class COIndex: diff --git a/pyowm/airpollutionapi30/no2index.py b/pyowm/airpollutionapi30/no2index.py index c7facd7a..f4f9d66c 100644 --- a/pyowm/airpollutionapi30/no2index.py +++ b/pyowm/airpollutionapi30/no2index.py @@ -3,7 +3,7 @@ from pyowm.commons import exceptions from pyowm.utils import formatting, timestamps -from pyowm.weatherapi25 import location +from pyowm.weatherapi30 import location class NO2Index: diff --git a/pyowm/airpollutionapi30/ozone.py b/pyowm/airpollutionapi30/ozone.py index cb23c491..324111c3 100644 --- a/pyowm/airpollutionapi30/ozone.py +++ b/pyowm/airpollutionapi30/ozone.py @@ -3,7 +3,7 @@ from pyowm.commons import exceptions from pyowm.utils import formatting, timestamps -from pyowm.weatherapi25 import location +from pyowm.weatherapi30 import location class Ozone: diff --git a/pyowm/airpollutionapi30/so2index.py b/pyowm/airpollutionapi30/so2index.py index 064b49e2..2fccf9f2 100644 --- a/pyowm/airpollutionapi30/so2index.py +++ b/pyowm/airpollutionapi30/so2index.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- from pyowm.commons import exceptions -from pyowm.weatherapi25 import location +from pyowm.weatherapi30 import location from pyowm.utils import formatting, timestamps diff --git a/pyowm/commons/cityidregistry.py b/pyowm/commons/cityidregistry.py index 86cdf0fb..bf8a3549 100644 --- a/pyowm/commons/cityidregistry.py +++ b/pyowm/commons/cityidregistry.py @@ -5,7 +5,7 @@ import sqlite3 import tempfile from pkg_resources import resource_filename -from pyowm.weatherapi25.location import Location +from pyowm.weatherapi30.location import Location CITY_ID_DB_PATH = 'cityids/cities.db.bz2' diff --git a/pyowm/geocodingapi10/geocoding_manager.py b/pyowm/geocodingapi10/geocoding_manager.py index 5e02efd8..85832649 100644 --- a/pyowm/geocodingapi10/geocoding_manager.py +++ b/pyowm/geocodingapi10/geocoding_manager.py @@ -2,7 +2,7 @@ from pyowm.commons.uris import ROOT_GEOCODING_API_URL, DIRECT_GEOCODING_URI, REVERSE_GEOCODING_URI from pyowm.constants import GEOCODING_API_VERSION from pyowm.utils import geo -from pyowm.weatherapi25.location import Location +from pyowm.weatherapi30.location import Location class GeocodingManager: diff --git a/pyowm/owm.py b/pyowm/owm.py index a5e90b3a..fda411e5 100644 --- a/pyowm/owm.py +++ b/pyowm/owm.py @@ -12,7 +12,7 @@ from pyowm.uvindexapi30 import uvindex_manager from pyowm.utils import config as cfg from pyowm.commons import cityidregistry -from pyowm.weatherapi25 import weather_manager +from pyowm.weatherapi30 import weather_manager class OWM: @@ -120,9 +120,9 @@ def uvindex_manager(self): def weather_manager(self): """ - Gives a `pyowm.weatherapi25.weather_manager.WeatherManager` instance that can be used to fetch air + Gives a `pyowm.weatherapi30.weather_manager.WeatherManager` instance that can be used to fetch air pollution data. - :return: a `pyowm.weatherapi25.weather_manager.WeatherManager` instance + :return: a `pyowm.weatherapi30.weather_manager.WeatherManager` instance """ return weather_manager.WeatherManager(self.api_key, self.config) diff --git a/pyowm/uvindexapi30/uvindex.py b/pyowm/uvindexapi30/uvindex.py index f84403c7..30f43d7d 100644 --- a/pyowm/uvindexapi30/uvindex.py +++ b/pyowm/uvindexapi30/uvindex.py @@ -3,7 +3,7 @@ from pyowm.commons import exceptions from pyowm.utils import formatting, timestamps -from pyowm.weatherapi25 import location +from pyowm.weatherapi30 import location def uv_intensity_to_exposure_risk(uv_intensity): diff --git a/pyowm/weatherapi25/__init__.py b/pyowm/weatherapi30/__init__.py similarity index 100% rename from pyowm/weatherapi25/__init__.py rename to pyowm/weatherapi30/__init__.py diff --git a/pyowm/weatherapi25/forecast.py b/pyowm/weatherapi30/forecast.py similarity index 97% rename from pyowm/weatherapi25/forecast.py rename to pyowm/weatherapi30/forecast.py index 18dd2d05..3ab93f62 100644 --- a/pyowm/weatherapi25/forecast.py +++ b/pyowm/weatherapi30/forecast.py @@ -5,8 +5,8 @@ from pyowm.commons import exceptions from pyowm.utils import timestamps, formatting -from pyowm.weatherapi25 import location -from pyowm.weatherapi25 import weather +from pyowm.weatherapi30 import location +from pyowm.weatherapi30 import weather class Forecast: @@ -89,7 +89,7 @@ def from_dict(cls, the_dict): if the_dict is None: raise exceptions.ParseAPIResponseError('JSON data is None') # Check if server returned errors: this check overcomes the lack of use - # of HTTP error status codes by the OWM API 2.5. This mechanism is + # of HTTP error status codes by the OWM API 3.0. This mechanism is # supposed to be deprecated as soon as the API fully adopts HTTP for # conveying errors to the clients if 'message' in the_dict and 'cod' in the_dict: diff --git a/pyowm/weatherapi25/forecaster.py b/pyowm/weatherapi30/forecaster.py similarity index 99% rename from pyowm/weatherapi25/forecaster.py rename to pyowm/weatherapi30/forecaster.py index e0362789..662c059b 100644 --- a/pyowm/weatherapi25/forecaster.py +++ b/pyowm/weatherapi30/forecaster.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- from pyowm.utils import formatting, weather -from pyowm.weatherapi25 import weathercoderegistry +from pyowm.weatherapi30 import weathercoderegistry class Forecaster: diff --git a/pyowm/weatherapi25/historian.py b/pyowm/weatherapi30/historian.py similarity index 100% rename from pyowm/weatherapi25/historian.py rename to pyowm/weatherapi30/historian.py diff --git a/pyowm/weatherapi25/location.py b/pyowm/weatherapi30/location.py similarity index 100% rename from pyowm/weatherapi25/location.py rename to pyowm/weatherapi30/location.py diff --git a/pyowm/weatherapi25/national_weather_alert.py b/pyowm/weatherapi30/national_weather_alert.py similarity index 100% rename from pyowm/weatherapi25/national_weather_alert.py rename to pyowm/weatherapi30/national_weather_alert.py diff --git a/pyowm/weatherapi25/observation.py b/pyowm/weatherapi30/observation.py similarity index 96% rename from pyowm/weatherapi25/observation.py rename to pyowm/weatherapi30/observation.py index c6b1414f..0e7ae860 100644 --- a/pyowm/weatherapi25/observation.py +++ b/pyowm/weatherapi30/observation.py @@ -4,8 +4,8 @@ import time from pyowm.commons import exceptions from pyowm.utils import formatting -from pyowm.weatherapi25 import location -from pyowm.weatherapi25 import weather +from pyowm.weatherapi30 import location +from pyowm.weatherapi30 import weather class Observation: @@ -67,7 +67,7 @@ def from_dict(cls, the_dict): raise exceptions.ParseAPIResponseError('JSON data is None') # Check if server returned errors: this check overcomes the lack of use - # of HTTP error status codes by the OWM API 2.5. This mechanism is + # of HTTP error status codes by the OWM API 3.0. This mechanism is # supposed to be deprecated as soon as the API fully adopts HTTP for # conveying errors to the clients if 'message' in the_dict and 'cod' in the_dict: @@ -120,7 +120,7 @@ def from_dict_of_lists(self, the_dict): raise exceptions.ParseAPIResponseError('JSON data is None') if 'cod' in the_dict: # Check if server returned errors: this check overcomes the lack of use - # of HTTP error status codes by the OWM API 2.5. This mechanism is + # of HTTP error status codes by the OWM API 3.0. This mechanism is # supposed to be deprecated as soon as the API fully adopts HTTP for # conveying errors to the clients if the_dict['cod'] == "200" or the_dict['cod'] == 200: diff --git a/pyowm/weatherapi25/one_call.py b/pyowm/weatherapi30/one_call.py similarity index 95% rename from pyowm/weatherapi25/one_call.py rename to pyowm/weatherapi30/one_call.py index 2e433936..8c8b39ac 100644 --- a/pyowm/weatherapi25/one_call.py +++ b/pyowm/weatherapi30/one_call.py @@ -2,8 +2,8 @@ from pyowm.commons import exceptions from pyowm.utils import geo -from pyowm.weatherapi25.weather import Weather -from pyowm.weatherapi25.national_weather_alert import NationalWeatherAlert +from pyowm.weatherapi30.weather import Weather +from pyowm.weatherapi30.national_weather_alert import NationalWeatherAlert class OneCall: @@ -69,7 +69,7 @@ def from_dict(cls, the_dict: dict): raise exceptions.ParseAPIResponseError('Data is None') # Check if server returned errors: this check overcomes the lack of use - # of HTTP error status codes by the OWM API 2.5. This mechanism is + # of HTTP error status codes by the OWM API 3.0. This mechanism is # supposed to be deprecated as soon as the API fully adopts HTTP for # conveying errors to the clients if 'message' in the_dict and 'cod' in the_dict: diff --git a/pyowm/weatherapi25/stationhistory.py b/pyowm/weatherapi30/stationhistory.py similarity index 100% rename from pyowm/weatherapi25/stationhistory.py rename to pyowm/weatherapi30/stationhistory.py diff --git a/pyowm/weatherapi25/uris.py b/pyowm/weatherapi30/uris.py similarity index 91% rename from pyowm/weatherapi25/uris.py rename to pyowm/weatherapi30/uris.py index 8dbd27dc..d00a0cec 100644 --- a/pyowm/weatherapi25/uris.py +++ b/pyowm/weatherapi30/uris.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- -ROOT_WEATHER_API = 'openweathermap.org/data/2.5' +ROOT_WEATHER_API = 'openweathermap.org/data/3.0' OBSERVATION_URI = 'weather' GROUP_OBSERVATIONS_URI = 'group' STATION_URI = 'station' diff --git a/pyowm/weatherapi25/weather.py b/pyowm/weatherapi30/weather.py similarity index 99% rename from pyowm/weatherapi25/weather.py rename to pyowm/weatherapi30/weather.py index 46b9f5bb..06c1e0af 100644 --- a/pyowm/weatherapi25/weather.py +++ b/pyowm/weatherapi30/weather.py @@ -5,7 +5,7 @@ from pyowm.commons import exceptions from pyowm.utils import formatting, measurables -from pyowm.weatherapi25.uris import ICONS_BASE_URI +from pyowm.weatherapi30.uris import ICONS_BASE_URI class Weather: @@ -508,7 +508,7 @@ def from_dict_of_lists(cls, the_dict): if the_dict is None: raise exceptions.ParseAPIResponseError('Data is None') # Check if server returned errors: this check overcomes the lack of use - # of HTTP error status codes by the OWM API 2.5. This mechanism is + # of HTTP error status codes by the OWM API 3.0. This mechanism is # supposed to be deprecated as soon as the API fully adopts HTTP for # conveying errors to the clients if 'message' in the_dict and 'cod' in the_dict: diff --git a/pyowm/weatherapi25/weather_manager.py b/pyowm/weatherapi30/weather_manager.py similarity index 99% rename from pyowm/weatherapi25/weather_manager.py rename to pyowm/weatherapi30/weather_manager.py index 03b04f0b..b389b46a 100644 --- a/pyowm/weatherapi25/weather_manager.py +++ b/pyowm/weatherapi30/weather_manager.py @@ -6,8 +6,8 @@ from pyowm.commons.http_client import HttpClient from pyowm.constants import WEATHER_API_VERSION from pyowm.utils import geo -from pyowm.weatherapi25 import forecaster, historian, observation, forecast, stationhistory, one_call -from pyowm.weatherapi25.uris import ROOT_WEATHER_API, OBSERVATION_URI, GROUP_OBSERVATIONS_URI, FIND_OBSERVATIONS_URI, \ +from pyowm.weatherapi30 import forecaster, historian, observation, forecast, stationhistory, one_call +from pyowm.weatherapi30.uris import ROOT_WEATHER_API, OBSERVATION_URI, GROUP_OBSERVATIONS_URI, FIND_OBSERVATIONS_URI, \ BBOX_CITY_URI, THREE_HOURS_FORECAST_URI, DAILY_FORECAST_URI, STATION_WEATHER_HISTORY_URI, ONE_CALL_URI, \ ONE_CALL_HISTORICAL_URI @@ -172,7 +172,7 @@ def weather_at_places(self, pattern, searchtype, limit=None): raise ValueError("'limit' must be None or greater than zero") params = {'q': pattern, 'type': searchtype} if limit is not None: - # fix for OWM 2.5 API bug! + # fix for OWM 3.0 API bug! params['cnt'] = limit - 1 _, json_data = self.http_client.get_json(FIND_OBSERVATIONS_URI, params=params) return observation.Observation.from_dict_of_lists(json_data) diff --git a/pyowm/weatherapi25/weathercoderegistry.py b/pyowm/weatherapi30/weathercoderegistry.py similarity index 100% rename from pyowm/weatherapi25/weathercoderegistry.py rename to pyowm/weatherapi30/weathercoderegistry.py diff --git a/sphinx/index.rst b/sphinx/index.rst index 2890f840..6c810a37 100644 --- a/sphinx/index.rst +++ b/sphinx/index.rst @@ -28,7 +28,7 @@ What APIs can I access with PyOWM? With PyOWM you can interact programmatically with the following OpenWeatherMap web APIs: - - **Weather API v2.5** + **OneCall API**, offering + - **Weather API v3.0** + **OneCall API**, offering + current weather data + weather forecasts + weather history diff --git a/sphinx/v3/global-pyowm-usage-examples.md b/sphinx/v3/global-pyowm-usage-examples.md index 18f33a00..ed492475 100644 --- a/sphinx/v3/global-pyowm-usage-examples.md +++ b/sphinx/v3/global-pyowm-usage-examples.md @@ -26,6 +26,6 @@ Most of PyOWM objects can be pretty-printed for a quick introspection: ```python from pyowm.owm import OWM owm = OWM('your-api-key') -print(owm) # +print(owm) # ``` diff --git a/tests/integration/commons/test_cityidregistry.py b/tests/integration/commons/test_cityidregistry.py index 35e1dfcf..0a7a0a34 100644 --- a/tests/integration/commons/test_cityidregistry.py +++ b/tests/integration/commons/test_cityidregistry.py @@ -3,7 +3,7 @@ import unittest from pyowm.commons.cityidregistry import CityIDRegistry from pyowm.utils.geo import Point -from pyowm.weatherapi25.location import Location +from pyowm.weatherapi30.location import Location class TestCityIDRegistryReadsFS(unittest.TestCase): diff --git a/tests/integration/geocodingapi10/test_integration_geocodingapi10.py b/tests/integration/geocodingapi10/test_integration_geocodingapi10.py index 5e12d93d..61f96fc4 100644 --- a/tests/integration/geocodingapi10/test_integration_geocodingapi10.py +++ b/tests/integration/geocodingapi10/test_integration_geocodingapi10.py @@ -4,7 +4,7 @@ import unittest import os from pyowm import owm -from pyowm.weatherapi25.location import Location +from pyowm.weatherapi30.location import Location class IntegrationTestsGeocodingAPI(unittest.TestCase): diff --git a/tests/integration/weatherapi25/test_integration.py b/tests/integration/weatherapi25/test_integration.py index f239adab..3e8b83e6 100644 --- a/tests/integration/weatherapi25/test_integration.py +++ b/tests/integration/weatherapi25/test_integration.py @@ -6,9 +6,9 @@ import pyowm.commons.exceptions from pyowm import owm -from pyowm.weatherapi25.one_call import OneCall -from pyowm.weatherapi25.weather import Weather -from pyowm.weatherapi25.national_weather_alert import NationalWeatherAlert +from pyowm.weatherapi30.one_call import OneCall +from pyowm.weatherapi30.weather import Weather +from pyowm.weatherapi30.national_weather_alert import NationalWeatherAlert class IntegrationTestsWebAPI25(unittest.TestCase): diff --git a/tests/proxy/test_integration_proxy.py b/tests/proxy/test_integration_proxy.py index 2902b35b..0df19317 100644 --- a/tests/proxy/test_integration_proxy.py +++ b/tests/proxy/test_integration_proxy.py @@ -5,7 +5,7 @@ import pathlib import unittest from pyowm import OWM -from pyowm.weatherapi25.observation import Observation +from pyowm.weatherapi30.observation import Observation from pyowm.utils import config diff --git a/tests/unit/airpollutionapi30/test_airstatus.py b/tests/unit/airpollutionapi30/test_airstatus.py index 700ee6bd..93641b90 100644 --- a/tests/unit/airpollutionapi30/test_airstatus.py +++ b/tests/unit/airpollutionapi30/test_airstatus.py @@ -5,7 +5,7 @@ import json from datetime import datetime import pyowm.commons.exceptions -from pyowm.weatherapi25.location import Location +from pyowm.weatherapi30.location import Location from pyowm.airpollutionapi30.airstatus import AirStatus diff --git a/tests/unit/airpollutionapi30/test_coindex.py b/tests/unit/airpollutionapi30/test_coindex.py index bf844575..d120a855 100644 --- a/tests/unit/airpollutionapi30/test_coindex.py +++ b/tests/unit/airpollutionapi30/test_coindex.py @@ -5,7 +5,7 @@ import json from datetime import datetime import pyowm.commons.exceptions -from pyowm.weatherapi25.location import Location +from pyowm.weatherapi30.location import Location from pyowm.airpollutionapi30.coindex import COIndex from pyowm.utils.formatting import datetime_to_UNIXtime diff --git a/tests/unit/airpollutionapi30/test_no2index.py b/tests/unit/airpollutionapi30/test_no2index.py index ee61d74a..16a129ce 100644 --- a/tests/unit/airpollutionapi30/test_no2index.py +++ b/tests/unit/airpollutionapi30/test_no2index.py @@ -4,7 +4,7 @@ import unittest import json from datetime import datetime -from pyowm.weatherapi25.location import Location +from pyowm.weatherapi30.location import Location from pyowm.commons.exceptions import ParseAPIResponseError from pyowm.airpollutionapi30.no2index import NO2Index from pyowm.utils.formatting import datetime_to_UNIXtime diff --git a/tests/unit/airpollutionapi30/test_ozone.py b/tests/unit/airpollutionapi30/test_ozone.py index 9381bf8f..3b3d389b 100644 --- a/tests/unit/airpollutionapi30/test_ozone.py +++ b/tests/unit/airpollutionapi30/test_ozone.py @@ -5,7 +5,7 @@ import json from datetime import datetime import pyowm.commons.exceptions -from pyowm.weatherapi25.location import Location +from pyowm.weatherapi30.location import Location from pyowm.airpollutionapi30.ozone import Ozone from pyowm.utils.formatting import datetime_to_UNIXtime diff --git a/tests/unit/airpollutionapi30/test_so2index.py b/tests/unit/airpollutionapi30/test_so2index.py index 97c8c4aa..a8143cf8 100644 --- a/tests/unit/airpollutionapi30/test_so2index.py +++ b/tests/unit/airpollutionapi30/test_so2index.py @@ -7,7 +7,7 @@ from pyowm.airpollutionapi30.so2index import SO2Index from pyowm.commons.exceptions import ParseAPIResponseError from pyowm.utils.formatting import datetime_to_UNIXtime -from pyowm.weatherapi25.location import Location +from pyowm.weatherapi30.location import Location SO2INDEX_JSON = '{"time":"2016-10-01T13:07:01Z","location":{"latitude":0,"longitude":9.2359},' \ '"data":[{"precision":-4.999999987376214e-07,"pressure":1000,"value":8.609262636127823e-08},' \ diff --git a/tests/unit/geocodingapi10/geocoding_manager.py b/tests/unit/geocodingapi10/geocoding_manager.py index 1bde58a9..a6a80a43 100644 --- a/tests/unit/geocodingapi10/geocoding_manager.py +++ b/tests/unit/geocodingapi10/geocoding_manager.py @@ -7,7 +7,7 @@ from pyowm.config import DEFAULT_CONFIG from pyowm.constants import GEOCODING_API_VERSION from pyowm.geocodingapi10.geocoding_manager import GeocodingManager -from pyowm.weatherapi25.location import Location +from pyowm.weatherapi30.location import Location class TestGeocodingManager(unittest.TestCase): diff --git a/tests/unit/test_owm.py b/tests/unit/test_owm.py index 0603e95a..14f27286 100644 --- a/tests/unit/test_owm.py +++ b/tests/unit/test_owm.py @@ -11,7 +11,7 @@ from pyowm.stationsapi30.stations_manager import StationsManager from pyowm.tiles.tile_manager import TileManager from pyowm.uvindexapi30.uvindex_manager import UVIndexManager -from pyowm.weatherapi25.weather_manager import WeatherManager +from pyowm.weatherapi30.weather_manager import WeatherManager class TestOWM(unittest.TestCase): diff --git a/tests/unit/utils/test_weather.py b/tests/unit/utils/test_weather.py index 31e8e0a7..0062c2f4 100644 --- a/tests/unit/utils/test_weather.py +++ b/tests/unit/utils/test_weather.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- import unittest -from pyowm.weatherapi25.weather import Weather +from pyowm.weatherapi30.weather import Weather from pyowm.utils import weather -from pyowm.weatherapi25.weathercoderegistry import WeatherCodeRegistry +from pyowm.weatherapi30.weathercoderegistry import WeatherCodeRegistry from pyowm.commons.exceptions import NotFoundError diff --git a/tests/unit/uvindexapi30/test_uvindex.py b/tests/unit/uvindexapi30/test_uvindex.py index 46767766..6669bca8 100644 --- a/tests/unit/uvindexapi30/test_uvindex.py +++ b/tests/unit/uvindexapi30/test_uvindex.py @@ -6,7 +6,7 @@ from datetime import datetime import pyowm.commons.exceptions from pyowm.uvindexapi30 import uvindex -from pyowm.weatherapi25.location import Location +from pyowm.weatherapi30.location import Location from unittest.mock import patch diff --git a/tests/unit/weatherapi25/__init__.py b/tests/unit/weatherapi30/__init__.py similarity index 100% rename from tests/unit/weatherapi25/__init__.py rename to tests/unit/weatherapi30/__init__.py diff --git a/tests/unit/weatherapi25/json_test_responses.py b/tests/unit/weatherapi30/json_test_responses.py similarity index 100% rename from tests/unit/weatherapi25/json_test_responses.py rename to tests/unit/weatherapi30/json_test_responses.py diff --git a/tests/unit/weatherapi25/test_forecast.py b/tests/unit/weatherapi30/test_forecast.py similarity index 97% rename from tests/unit/weatherapi25/test_forecast.py rename to tests/unit/weatherapi30/test_forecast.py index 44b5d46d..15171660 100644 --- a/tests/unit/weatherapi25/test_forecast.py +++ b/tests/unit/weatherapi30/test_forecast.py @@ -1,11 +1,11 @@ import unittest import json from datetime import datetime -from pyowm.weatherapi25.location import Location -from pyowm.weatherapi25.weather import Weather -from pyowm.weatherapi25.forecast import Forecast +from pyowm.weatherapi30.location import Location +from pyowm.weatherapi30.weather import Weather +from pyowm.weatherapi30.forecast import Forecast from pyowm.commons.exceptions import APIResponseError, ParseAPIResponseError -from tests.unit.weatherapi25.json_test_responses import ( +from tests.unit.weatherapi30.json_test_responses import ( THREE_HOURS_FORECAST_JSON, FORECAST_NOT_FOUND_JSON, INTERNAL_SERVER_ERROR_JSON, FORECAST_MALFORMED_JSON) diff --git a/tests/unit/weatherapi25/test_forecaster.py b/tests/unit/weatherapi30/test_forecaster.py similarity index 98% rename from tests/unit/weatherapi25/test_forecaster.py rename to tests/unit/weatherapi30/test_forecaster.py index 232d80e4..54e7c535 100644 --- a/tests/unit/weatherapi25/test_forecaster.py +++ b/tests/unit/weatherapi30/test_forecaster.py @@ -3,10 +3,10 @@ import unittest from datetime import datetime, timezone -from pyowm.weatherapi25.location import Location -from pyowm.weatherapi25.weather import Weather -from pyowm.weatherapi25.forecast import Forecast -from pyowm.weatherapi25.forecaster import Forecaster +from pyowm.weatherapi30.location import Location +from pyowm.weatherapi30.weather import Weather +from pyowm.weatherapi30.forecast import Forecast +from pyowm.weatherapi30.forecaster import Forecaster class TestForecaster(unittest.TestCase): diff --git a/tests/unit/weatherapi25/test_historian.py b/tests/unit/weatherapi30/test_historian.py similarity index 98% rename from tests/unit/weatherapi25/test_historian.py rename to tests/unit/weatherapi30/test_historian.py index 1f22085e..ce98ce64 100644 --- a/tests/unit/weatherapi25/test_historian.py +++ b/tests/unit/weatherapi30/test_historian.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*-e for historian.py module import unittest -from pyowm.weatherapi25.stationhistory import StationHistory -from pyowm.weatherapi25.historian import Historian +from pyowm.weatherapi30.stationhistory import StationHistory +from pyowm.weatherapi30.historian import Historian from pyowm.utils import measurables diff --git a/tests/unit/weatherapi25/test_location.py b/tests/unit/weatherapi30/test_location.py similarity index 98% rename from tests/unit/weatherapi25/test_location.py rename to tests/unit/weatherapi30/test_location.py index d4046ada..3df1580e 100644 --- a/tests/unit/weatherapi25/test_location.py +++ b/tests/unit/weatherapi30/test_location.py @@ -4,7 +4,7 @@ import unittest import json from pyowm.commons import exceptions -from pyowm.weatherapi25.location import Location +from pyowm.weatherapi30.location import Location from pyowm.utils.geo import Point diff --git a/tests/unit/weatherapi25/test_national_weather_alert.py b/tests/unit/weatherapi30/test_national_weather_alert.py similarity index 98% rename from tests/unit/weatherapi25/test_national_weather_alert.py rename to tests/unit/weatherapi30/test_national_weather_alert.py index a5ddc175..4c28794f 100644 --- a/tests/unit/weatherapi25/test_national_weather_alert.py +++ b/tests/unit/weatherapi30/test_national_weather_alert.py @@ -3,7 +3,7 @@ import unittest import json -from pyowm.weatherapi25.national_weather_alert import NationalWeatherAlert +from pyowm.weatherapi30.national_weather_alert import NationalWeatherAlert from pyowm.commons.exceptions import APIResponseError, ParseAPIResponseError diff --git a/tests/unit/weatherapi25/test_observation.py b/tests/unit/weatherapi30/test_observation.py similarity index 96% rename from tests/unit/weatherapi25/test_observation.py rename to tests/unit/weatherapi30/test_observation.py index 961d00dd..ea25cfe5 100644 --- a/tests/unit/weatherapi25/test_observation.py +++ b/tests/unit/weatherapi30/test_observation.py @@ -4,13 +4,13 @@ import unittest import json from datetime import datetime -from pyowm.weatherapi25.location import Location -from pyowm.weatherapi25.weather import Weather -from pyowm.weatherapi25.observation import Observation +from pyowm.weatherapi30.location import Location +from pyowm.weatherapi30.weather import Weather +from pyowm.weatherapi30.observation import Observation from pyowm.commons.exceptions import APIResponseError, ParseAPIResponseError -from tests.unit.weatherapi25.json_test_responses import ( +from tests.unit.weatherapi30.json_test_responses import ( OBSERVATION_JSON, OBSERVATION_NOT_FOUND_JSON, OBSERVATION_MALFORMED_JSON) -from tests.unit.weatherapi25.json_test_responses import ( +from tests.unit.weatherapi30.json_test_responses import ( SEARCH_RESULTS_JSON, SEARCH_WITH_NO_RESULTS_1_JSON, SEARCH_WITH_NO_RESULTS_2_JSON, INTERNAL_SERVER_ERROR_JSON) diff --git a/tests/unit/weatherapi25/test_one_call.py b/tests/unit/weatherapi30/test_one_call.py similarity index 99% rename from tests/unit/weatherapi25/test_one_call.py rename to tests/unit/weatherapi30/test_one_call.py index ff2b62d8..81db0118 100644 --- a/tests/unit/weatherapi25/test_one_call.py +++ b/tests/unit/weatherapi30/test_one_call.py @@ -6,9 +6,9 @@ from pyowm.commons.exceptions import ParseAPIResponseError, APIResponseError from pyowm.utils import geo -from pyowm.weatherapi25.one_call import OneCall -from pyowm.weatherapi25.weather import Weather -from pyowm.weatherapi25.national_weather_alert import NationalWeatherAlert +from pyowm.weatherapi30.one_call import OneCall +from pyowm.weatherapi30.weather import Weather +from pyowm.weatherapi30.national_weather_alert import NationalWeatherAlert class TestOneCall(unittest.TestCase): diff --git a/tests/unit/weatherapi25/test_stationhistory.py b/tests/unit/weatherapi30/test_stationhistory.py similarity index 97% rename from tests/unit/weatherapi25/test_stationhistory.py rename to tests/unit/weatherapi30/test_stationhistory.py index 9ab073b9..58d586be 100644 --- a/tests/unit/weatherapi25/test_stationhistory.py +++ b/tests/unit/weatherapi30/test_stationhistory.py @@ -5,8 +5,8 @@ import unittest from datetime import datetime from pyowm.commons.exceptions import APIResponseError, ParseAPIResponseError -from pyowm.weatherapi25.stationhistory import StationHistory -from tests.unit.weatherapi25.json_test_responses import ( +from pyowm.weatherapi30.stationhistory import StationHistory +from tests.unit.weatherapi30.json_test_responses import ( STATION_TICK_WEATHER_HISTORY_JSON, STATION_WEATHER_HISTORY_NOT_FOUND_JSON, INTERNAL_SERVER_ERROR_JSON) diff --git a/tests/unit/weatherapi25/test_weather.py b/tests/unit/weatherapi30/test_weather.py similarity index 99% rename from tests/unit/weatherapi25/test_weather.py rename to tests/unit/weatherapi30/test_weather.py index f3479f56..beaa4bc8 100644 --- a/tests/unit/weatherapi25/test_weather.py +++ b/tests/unit/weatherapi30/test_weather.py @@ -6,9 +6,9 @@ from datetime import datetime from pyowm.commons.exceptions import APIResponseError, ParseAPIResponseError -from pyowm.weatherapi25.uris import ICONS_BASE_URI -from pyowm.weatherapi25.weather import Weather -from tests.unit.weatherapi25.json_test_responses import (CITY_WEATHER_HISTORY_JSON, +from pyowm.weatherapi30.uris import ICONS_BASE_URI +from pyowm.weatherapi30.weather import Weather +from tests.unit.weatherapi30.json_test_responses import (CITY_WEATHER_HISTORY_JSON, CITY_WEATHER_HISTORY_NO_RESULTS_JSON, CITY_WEATHER_HISTORY_NOT_FOUND_JSON, INTERNAL_SERVER_ERROR_JSON) diff --git a/tests/unit/weatherapi25/test_weather_manager.py b/tests/unit/weatherapi30/test_weather_manager.py similarity index 98% rename from tests/unit/weatherapi25/test_weather_manager.py rename to tests/unit/weatherapi30/test_weather_manager.py index ea9a7fb5..623faecf 100644 --- a/tests/unit/weatherapi25/test_weather_manager.py +++ b/tests/unit/weatherapi30/test_weather_manager.py @@ -3,19 +3,19 @@ import json import unittest -from pyowm.weatherapi25.weather_manager import WeatherManager +from pyowm.weatherapi30.weather_manager import WeatherManager from pyowm.commons.http_client import HttpClient from pyowm.constants import WEATHER_API_VERSION from pyowm.config import DEFAULT_CONFIG -from pyowm.weatherapi25.historian import Historian -from pyowm.weatherapi25.forecast import Forecast -from pyowm.weatherapi25.forecaster import Forecaster -from pyowm.weatherapi25.location import Location -from pyowm.weatherapi25.observation import Observation -from pyowm.weatherapi25.one_call import OneCall -from pyowm.weatherapi25.stationhistory import StationHistory -from pyowm.weatherapi25.weather import Weather -from tests.unit.weatherapi25.json_test_responses import ( +from pyowm.weatherapi30.historian import Historian +from pyowm.weatherapi30.forecast import Forecast +from pyowm.weatherapi30.forecaster import Forecaster +from pyowm.weatherapi30.location import Location +from pyowm.weatherapi30.observation import Observation +from pyowm.weatherapi30.one_call import OneCall +from pyowm.weatherapi30.stationhistory import StationHistory +from pyowm.weatherapi30.weather import Weather +from tests.unit.weatherapi30.json_test_responses import ( OBSERVATION_JSON, SEARCH_RESULTS_JSON, THREE_HOURS_FORECAST_JSON, DAILY_FORECAST_JSON, THREE_HOURS_FORECAST_AT_COORDS_JSON, DAILY_FORECAST_AT_COORDS_JSON, THREE_HOURS_FORECAST_AT_ID_JSON, DAILY_FORECAST_AT_ID_JSON, diff --git a/tests/unit/weatherapi25/test_weathercoderegistry.py b/tests/unit/weatherapi30/test_weathercoderegistry.py similarity index 93% rename from tests/unit/weatherapi25/test_weathercoderegistry.py rename to tests/unit/weatherapi30/test_weathercoderegistry.py index ef91523f..4926396d 100644 --- a/tests/unit/weatherapi25/test_weathercoderegistry.py +++ b/tests/unit/weatherapi30/test_weathercoderegistry.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- import unittest -from pyowm.weatherapi25.weathercoderegistry import WeatherCodeRegistry +from pyowm.weatherapi30.weathercoderegistry import WeatherCodeRegistry class TestWeatherCodeRegistry(unittest.TestCase):