meteocatpy 0.0.21 → 1.0.1
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/CHANGELOG.md +16 -0
- package/meteocatpy/lightning.py +2 -3
- package/meteocatpy/version.py +1 -1
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/tests/integration_test_lightning.py +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## [1.0.1](https://github.com/figorr/meteocatpy/compare/v1.0.0...v1.0.1) (2025-02-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* 1.0.1 ([fc92ac1](https://github.com/figorr/meteocatpy/commit/fc92ac1fe40ff31cb0c38c5864d53209f42e128d))
|
|
7
|
+
* fix lightning api call code ([9abc092](https://github.com/figorr/meteocatpy/commit/9abc092b6951051279887d8ab09e2551371ea3b8))
|
|
8
|
+
|
|
9
|
+
## [1.0.0](https://github.com/figorr/meteocatpy/compare/v0.0.20...v1.0.0) (2025-02-04)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* 1.0.0 ([c237e77](https://github.com/figorr/meteocatpy/commit/c237e7736f3504f19a1bb2e39ed7edd3264de115))
|
|
15
|
+
|
|
16
|
+
|
|
1
17
|
## [0.0.21](https://github.com/figorr/meteocatpy/compare/v0.0.20...v0.0.21) (2025-02-04)
|
|
2
18
|
|
|
3
19
|
|
package/meteocatpy/lightning.py
CHANGED
|
@@ -14,12 +14,12 @@ from .exceptions import (
|
|
|
14
14
|
|
|
15
15
|
_LOGGER = logging.getLogger(__name__)
|
|
16
16
|
|
|
17
|
-
class
|
|
17
|
+
class MeteocatLightning:
|
|
18
18
|
"""Clase para interactuar con los datos de rayos de la API de Meteocat."""
|
|
19
19
|
|
|
20
20
|
def __init__(self, api_key: str):
|
|
21
21
|
"""
|
|
22
|
-
Inicializa la clase
|
|
22
|
+
Inicializa la clase MeteocatLightning.
|
|
23
23
|
|
|
24
24
|
Args:
|
|
25
25
|
api_key (str): Clave de API para autenticar las solicitudes.
|
|
@@ -29,7 +29,6 @@ class MeteocatLightningData:
|
|
|
29
29
|
"Content-Type": "application/json",
|
|
30
30
|
"X-Api-Key": self.api_key,
|
|
31
31
|
}
|
|
32
|
-
self.variables = MeteocatVariables(api_key)
|
|
33
32
|
|
|
34
33
|
@staticmethod
|
|
35
34
|
def get_current_date():
|
package/meteocatpy/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# version.py
|
|
2
|
-
__version__ = "1.0.
|
|
2
|
+
__version__ = "1.0.1"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "meteocatpy",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "[](https://opensource.org/licenses/Apache-2.0)\r [](https://pypi.org/project/meteocatpy)\r [](https://gitlab.com/figorr/meteocatpy/commits/master)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"directories": {
|
package/pyproject.toml
CHANGED
|
@@ -2,7 +2,7 @@ import os
|
|
|
2
2
|
import pytest
|
|
3
3
|
import json
|
|
4
4
|
from dotenv import load_dotenv
|
|
5
|
-
from meteocatpy.lightning import
|
|
5
|
+
from meteocatpy.lightning import MeteocatLightning
|
|
6
6
|
|
|
7
7
|
# Cargar variables desde el archivo .env
|
|
8
8
|
load_dotenv()
|
|
@@ -18,7 +18,7 @@ assert REGION_CODI_TEST, "Region codi test is required"
|
|
|
18
18
|
@pytest.mark.asyncio
|
|
19
19
|
async def test_lightning():
|
|
20
20
|
# Crear una instancia de MeteocatLightningData con la API Key
|
|
21
|
-
lightning_client =
|
|
21
|
+
lightning_client = MeteocatLightning(API_KEY)
|
|
22
22
|
|
|
23
23
|
# Obtener los datos de rayos
|
|
24
24
|
lightning_data = await lightning_client.get_lightning_data(REGION_CODI_TEST)
|
|
@@ -29,7 +29,7 @@ async def test_lightning():
|
|
|
29
29
|
os.makedirs('tests/files', exist_ok=True)
|
|
30
30
|
|
|
31
31
|
# Guardar los datos de rayos en un archivo JSON
|
|
32
|
-
with open(f'tests/files/lightning_{REGION_CODI_TEST}
|
|
32
|
+
with open(f'tests/files/lightning_{REGION_CODI_TEST}.json', 'w', encoding='utf-8') as f:
|
|
33
33
|
json.dump(lightning_data, f, ensure_ascii=False, indent=4)
|
|
34
34
|
|
|
35
35
|
# Verificar que los datos de rayos sean una lista
|