meteocatpy 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/release.yml +33 -33
- package/.gitlab-ci.yml +46 -46
- package/.pre-commit-config.yaml +37 -37
- package/.releaserc +23 -23
- package/.releaserc.toml +14 -14
- package/AUTHORS.md +12 -12
- package/CHANGELOG.md +187 -171
- package/README.md +61 -61
- package/filetree.py +48 -48
- package/filetree.txt +48 -48
- package/meteocatpy/README.md +61 -61
- package/meteocatpy/__init__.py +27 -27
- package/meteocatpy/const.py +10 -10
- package/meteocatpy/data.py +93 -93
- package/meteocatpy/exceptions.py +35 -35
- package/meteocatpy/forecast.py +137 -137
- package/meteocatpy/helpers.py +46 -46
- package/meteocatpy/stations.py +71 -71
- package/meteocatpy/symbols.py +89 -89
- package/meteocatpy/town.py +61 -61
- package/meteocatpy/townstations.py +99 -99
- package/meteocatpy/variables.py +77 -77
- package/meteocatpy/version.py +2 -2
- package/package.json +23 -23
- package/poetry.lock +3313 -3313
- package/pyproject.toml +72 -72
- package/releaserc.json +17 -17
- package/requirements.test.txt +3 -3
- package/setup.cfg +64 -64
- package/setup.py +10 -10
- package/tests/data_test.py +122 -122
- package/tests/import_test.py +18 -18
- package/tests/integration_test_complete.py +76 -76
- package/tests/integration_test_forecast.py +54 -54
- package/tests/integration_test_station_data.py +33 -33
- package/tests/integration_test_stations.py +31 -31
- package/tests/integration_test_symbols.py +68 -68
- package/tests/integration_test_town.py +32 -32
- package/tests/integration_test_town_stations.py +36 -36
- package/tests/integration_test_variables.py +32 -32
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import pytest
|
|
3
|
-
import json
|
|
4
|
-
from dotenv import load_dotenv
|
|
5
|
-
from meteocatpy.townstations import MeteocatTownStations
|
|
6
|
-
|
|
7
|
-
# Cargar variables desde el archivo .env
|
|
8
|
-
load_dotenv()
|
|
9
|
-
|
|
10
|
-
# Obtener los valores del archivo .env
|
|
11
|
-
API_KEY = os.getenv("METEOCAT_API_KEY")
|
|
12
|
-
MUNICIPI_CODI_TEST = os.getenv("MUNICIPI_CODI_TEST")
|
|
13
|
-
VARIABLE_CODI_TEST = os.getenv("VARIABLE_CODI_TEST")
|
|
14
|
-
|
|
15
|
-
# Asegúrate de que las variables estén definidas
|
|
16
|
-
assert API_KEY, "API Key is required"
|
|
17
|
-
assert MUNICIPI_CODI_TEST, "Municipi codi test is required"
|
|
18
|
-
assert VARIABLE_CODI_TEST, "Variable codi test is required"
|
|
19
|
-
|
|
20
|
-
@pytest.mark.asyncio
|
|
21
|
-
async def test_town_stations():
|
|
22
|
-
# Crear una instancia de MeteocatTownStations con la API Key
|
|
23
|
-
town_stations_client = MeteocatTownStations(API_KEY)
|
|
24
|
-
|
|
25
|
-
# Obtener la lista de estaciones del municipio usando el código de municipio de prueba y la variable de prueba
|
|
26
|
-
town_stations_data = await town_stations_client.get_town_stations(MUNICIPI_CODI_TEST, VARIABLE_CODI_TEST)
|
|
27
|
-
|
|
28
|
-
# Crear la carpeta si no existe
|
|
29
|
-
os.makedirs('tests/files', exist_ok=True)
|
|
30
|
-
|
|
31
|
-
# Guardar la lista de estaciones del municipio en un archivo JSON
|
|
32
|
-
with open(f'tests/files/stations_{MUNICIPI_CODI_TEST}_{VARIABLE_CODI_TEST}.json', 'w', encoding='utf-8') as f:
|
|
33
|
-
json.dump(town_stations_data, f, ensure_ascii=False, indent=4)
|
|
34
|
-
|
|
35
|
-
# Verificar que la lista de estaciones del municipio no esté vacía
|
|
36
|
-
assert town_stations_data, "Estaciones data is empty"
|
|
1
|
+
import os
|
|
2
|
+
import pytest
|
|
3
|
+
import json
|
|
4
|
+
from dotenv import load_dotenv
|
|
5
|
+
from meteocatpy.townstations import MeteocatTownStations
|
|
6
|
+
|
|
7
|
+
# Cargar variables desde el archivo .env
|
|
8
|
+
load_dotenv()
|
|
9
|
+
|
|
10
|
+
# Obtener los valores del archivo .env
|
|
11
|
+
API_KEY = os.getenv("METEOCAT_API_KEY")
|
|
12
|
+
MUNICIPI_CODI_TEST = os.getenv("MUNICIPI_CODI_TEST")
|
|
13
|
+
VARIABLE_CODI_TEST = os.getenv("VARIABLE_CODI_TEST")
|
|
14
|
+
|
|
15
|
+
# Asegúrate de que las variables estén definidas
|
|
16
|
+
assert API_KEY, "API Key is required"
|
|
17
|
+
assert MUNICIPI_CODI_TEST, "Municipi codi test is required"
|
|
18
|
+
assert VARIABLE_CODI_TEST, "Variable codi test is required"
|
|
19
|
+
|
|
20
|
+
@pytest.mark.asyncio
|
|
21
|
+
async def test_town_stations():
|
|
22
|
+
# Crear una instancia de MeteocatTownStations con la API Key
|
|
23
|
+
town_stations_client = MeteocatTownStations(API_KEY)
|
|
24
|
+
|
|
25
|
+
# Obtener la lista de estaciones del municipio usando el código de municipio de prueba y la variable de prueba
|
|
26
|
+
town_stations_data = await town_stations_client.get_town_stations(MUNICIPI_CODI_TEST, VARIABLE_CODI_TEST)
|
|
27
|
+
|
|
28
|
+
# Crear la carpeta si no existe
|
|
29
|
+
os.makedirs('tests/files', exist_ok=True)
|
|
30
|
+
|
|
31
|
+
# Guardar la lista de estaciones del municipio en un archivo JSON
|
|
32
|
+
with open(f'tests/files/stations_{MUNICIPI_CODI_TEST}_{VARIABLE_CODI_TEST}.json', 'w', encoding='utf-8') as f:
|
|
33
|
+
json.dump(town_stations_data, f, ensure_ascii=False, indent=4)
|
|
34
|
+
|
|
35
|
+
# Verificar que la lista de estaciones del municipio no esté vacía
|
|
36
|
+
assert town_stations_data, "Estaciones data is empty"
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import pytest
|
|
3
|
-
import json
|
|
4
|
-
from dotenv import load_dotenv
|
|
5
|
-
from meteocatpy.variables import MeteocatVariables
|
|
6
|
-
|
|
7
|
-
# Cargar variables desde el archivo .env
|
|
8
|
-
load_dotenv()
|
|
9
|
-
|
|
10
|
-
# Obtener los valores del archivo .env
|
|
11
|
-
API_KEY = os.getenv("METEOCAT_API_KEY")
|
|
12
|
-
|
|
13
|
-
# Asegúrate de que las variables estén definidas
|
|
14
|
-
assert API_KEY, "API Key is required"
|
|
15
|
-
|
|
16
|
-
@pytest.mark.asyncio
|
|
17
|
-
async def test_variables():
|
|
18
|
-
# Crear una instancia de MeteocatVariables con la API Key
|
|
19
|
-
variables_client = MeteocatVariables(API_KEY)
|
|
20
|
-
|
|
21
|
-
# Obtener las variables
|
|
22
|
-
variables_data = await variables_client.get_variables()
|
|
23
|
-
|
|
24
|
-
# Crear la carpeta si no existe
|
|
25
|
-
os.makedirs('tests/files', exist_ok=True)
|
|
26
|
-
|
|
27
|
-
# Guardar los datos de las variables en un archivo JSON
|
|
28
|
-
with open('tests/files/variables.json', 'w', encoding='utf-8') as f:
|
|
29
|
-
json.dump(variables_data, f, ensure_ascii=False, indent=4)
|
|
30
|
-
|
|
31
|
-
# Verificar que las variables no estén vacías
|
|
32
|
-
assert variables_data, "Variables data is empty"
|
|
1
|
+
import os
|
|
2
|
+
import pytest
|
|
3
|
+
import json
|
|
4
|
+
from dotenv import load_dotenv
|
|
5
|
+
from meteocatpy.variables import MeteocatVariables
|
|
6
|
+
|
|
7
|
+
# Cargar variables desde el archivo .env
|
|
8
|
+
load_dotenv()
|
|
9
|
+
|
|
10
|
+
# Obtener los valores del archivo .env
|
|
11
|
+
API_KEY = os.getenv("METEOCAT_API_KEY")
|
|
12
|
+
|
|
13
|
+
# Asegúrate de que las variables estén definidas
|
|
14
|
+
assert API_KEY, "API Key is required"
|
|
15
|
+
|
|
16
|
+
@pytest.mark.asyncio
|
|
17
|
+
async def test_variables():
|
|
18
|
+
# Crear una instancia de MeteocatVariables con la API Key
|
|
19
|
+
variables_client = MeteocatVariables(API_KEY)
|
|
20
|
+
|
|
21
|
+
# Obtener las variables
|
|
22
|
+
variables_data = await variables_client.get_variables()
|
|
23
|
+
|
|
24
|
+
# Crear la carpeta si no existe
|
|
25
|
+
os.makedirs('tests/files', exist_ok=True)
|
|
26
|
+
|
|
27
|
+
# Guardar los datos de las variables en un archivo JSON
|
|
28
|
+
with open('tests/files/variables.json', 'w', encoding='utf-8') as f:
|
|
29
|
+
json.dump(variables_data, f, ensure_ascii=False, indent=4)
|
|
30
|
+
|
|
31
|
+
# Verificar que las variables no estén vacías
|
|
32
|
+
assert variables_data, "Variables data is empty"
|