e-data 2.0.0.dev125__tar.gz → 2.0.1.dev127__tar.gz
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.
- {e_data-2.0.0.dev125/e_data.egg-info → e_data-2.0.1.dev127}/PKG-INFO +2 -2
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127/e_data.egg-info}/PKG-INFO +2 -2
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/e_data.egg-info/requires.txt +1 -1
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/services/data_service.py +3 -1
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/tests/test_services.py +21 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/pyproject.toml +2 -2
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/LICENSE +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/MANIFEST.in +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/README.md +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/e_data.egg-info/SOURCES.txt +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/e_data.egg-info/dependency_links.txt +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/e_data.egg-info/top_level.txt +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/__init__.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/cli.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/core/__init__.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/core/const.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/core/utils.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/database/__init__.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/database/controller.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/database/models.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/database/queries.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/database/utils.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/models/__init__.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/models/bill.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/models/data.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/models/supply.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/providers/__init__.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/providers/datadis.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/providers/redata.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/services/bill_service.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/tests/__init__.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/tests/test_datadis_connector.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/edata/tests/test_redata_connector.py +0 -0
- {e_data-2.0.0.dev125 → e_data-2.0.1.dev127}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: e-data
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.1.dev127
|
|
4
4
|
Summary: Python library for managing spanish energy data from various web providers
|
|
5
5
|
Author-email: VMG <vmayorg@outlook.es>
|
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
|
@@ -696,7 +696,7 @@ Requires-Dist: Jinja2<4,>=3.1
|
|
|
696
696
|
Requires-Dist: pydantic<3,>=2.10
|
|
697
697
|
Requires-Dist: python_dateutil<3,>=2.8
|
|
698
698
|
Requires-Dist: Requests<3,>=2.31
|
|
699
|
-
Requires-Dist: SQLAlchemy<3,>=2.0
|
|
699
|
+
Requires-Dist: SQLAlchemy[asyncio]<3,>=2.0
|
|
700
700
|
Requires-Dist: sqlmodel<0.1,>=0.0.22
|
|
701
701
|
Requires-Dist: typer<1,>=0.12
|
|
702
702
|
Requires-Dist: aiosqlite<1,>=0.21
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: e-data
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.1.dev127
|
|
4
4
|
Summary: Python library for managing spanish energy data from various web providers
|
|
5
5
|
Author-email: VMG <vmayorg@outlook.es>
|
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
|
@@ -696,7 +696,7 @@ Requires-Dist: Jinja2<4,>=3.1
|
|
|
696
696
|
Requires-Dist: pydantic<3,>=2.10
|
|
697
697
|
Requires-Dist: python_dateutil<3,>=2.8
|
|
698
698
|
Requires-Dist: Requests<3,>=2.31
|
|
699
|
-
Requires-Dist: SQLAlchemy<3,>=2.0
|
|
699
|
+
Requires-Dist: SQLAlchemy[asyncio]<3,>=2.0
|
|
700
700
|
Requires-Dist: sqlmodel<0.1,>=0.0.22
|
|
701
701
|
Requires-Dist: typer<1,>=0.12
|
|
702
702
|
Requires-Dist: aiosqlite<1,>=0.21
|
|
@@ -316,7 +316,9 @@ class DataService:
|
|
|
316
316
|
# end date out of bounds
|
|
317
317
|
return False
|
|
318
318
|
if _pvpc_dt := await self._get_last_pvpc_dt():
|
|
319
|
-
|
|
319
|
+
# keep within the fetchable window even if the last stored price is
|
|
320
|
+
# older than a month, otherwise REData rejects the range with a 400
|
|
321
|
+
start = max(_pvpc_dt + timedelta(hours=1), min_date)
|
|
320
322
|
if start >= end:
|
|
321
323
|
_LOGGER.info("%s pvpc prices are already synced", self._scups)
|
|
322
324
|
# data is already synced
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from datetime import datetime, timedelta
|
|
1
2
|
import json
|
|
2
3
|
import os
|
|
3
4
|
from tempfile import gettempdir
|
|
@@ -7,6 +8,7 @@ import pytest
|
|
|
7
8
|
import pytest_asyncio
|
|
8
9
|
from syrupy.assertion import SnapshotAssertion
|
|
9
10
|
|
|
11
|
+
from edata.core.utils import get_day
|
|
10
12
|
from edata.models.bill import BillingRules
|
|
11
13
|
from edata.models.data import Energy, Power
|
|
12
14
|
from edata.models.supply import Contract, Supply
|
|
@@ -211,3 +213,22 @@ async def test_clear_bills(populated_data_service, energy, storage_dir):
|
|
|
211
213
|
assert len(await bs.get_bills("hour")) == 0
|
|
212
214
|
assert len(await bs.get_bills(type_="day")) == 0
|
|
213
215
|
assert len(await bs.get_bills(type_="month")) == 0
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
@pytest.mark.asyncio
|
|
219
|
+
async def test_update_pvpc_clamps_range_to_min_date(populated_data_service):
|
|
220
|
+
ds = populated_data_service
|
|
221
|
+
now = datetime.now()
|
|
222
|
+
stale_dt = now - timedelta(days=90)
|
|
223
|
+
|
|
224
|
+
with (
|
|
225
|
+
patch.object(ds, "_get_last_pvpc_dt", AsyncMock(return_value=stale_dt)),
|
|
226
|
+
patch.object(
|
|
227
|
+
ds.redata, "async_get_realtime_prices", AsyncMock(return_value=[])
|
|
228
|
+
) as mock_fetch,
|
|
229
|
+
):
|
|
230
|
+
await ds.update_pvpc(now - timedelta(days=365), now)
|
|
231
|
+
|
|
232
|
+
mock_fetch.assert_awaited_once()
|
|
233
|
+
called_start = mock_fetch.await_args.args[0]
|
|
234
|
+
assert called_start >= get_day(now) - timedelta(days=28)
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "e-data"
|
|
7
|
-
version = "2.0.
|
|
7
|
+
version = "2.0.1.dev127"
|
|
8
8
|
description = "Python library for managing spanish energy data from various web providers"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
|
@@ -29,7 +29,7 @@ dependencies = [
|
|
|
29
29
|
"pydantic>=2.10,<3",
|
|
30
30
|
"python_dateutil>=2.8,<3",
|
|
31
31
|
"Requests>=2.31,<3",
|
|
32
|
-
"SQLAlchemy>=2.0,<3",
|
|
32
|
+
"SQLAlchemy[asyncio]>=2.0,<3",
|
|
33
33
|
"sqlmodel>=0.0.22,<0.1",
|
|
34
34
|
"typer>=0.12,<1",
|
|
35
35
|
"aiosqlite>=0.21,<1",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|