e-data 1.2.11__tar.gz → 1.2.12__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.
Files changed (25) hide show
  1. {e-data-1.2.11/e_data.egg-info → e-data-1.2.12}/PKG-INFO +1 -1
  2. {e-data-1.2.11 → e-data-1.2.12/e_data.egg-info}/PKG-INFO +1 -1
  3. {e-data-1.2.11 → e-data-1.2.12}/edata/helpers.py +13 -8
  4. {e-data-1.2.11 → e-data-1.2.12}/setup.py +1 -1
  5. {e-data-1.2.11 → e-data-1.2.12}/LICENSE +0 -0
  6. {e-data-1.2.11 → e-data-1.2.12}/MANIFEST.in +0 -0
  7. {e-data-1.2.11 → e-data-1.2.12}/README.md +0 -0
  8. {e-data-1.2.11 → e-data-1.2.12}/e_data.egg-info/SOURCES.txt +0 -0
  9. {e-data-1.2.11 → e-data-1.2.12}/e_data.egg-info/dependency_links.txt +0 -0
  10. {e-data-1.2.11 → e-data-1.2.12}/e_data.egg-info/requires.txt +0 -0
  11. {e-data-1.2.11 → e-data-1.2.12}/e_data.egg-info/top_level.txt +0 -0
  12. {e-data-1.2.11 → e-data-1.2.12}/edata/__init__.py +0 -0
  13. {e-data-1.2.11 → e-data-1.2.12}/edata/connectors/__init__.py +0 -0
  14. {e-data-1.2.11 → e-data-1.2.12}/edata/connectors/datadis.py +0 -0
  15. {e-data-1.2.11 → e-data-1.2.12}/edata/connectors/redata.py +0 -0
  16. {e-data-1.2.11 → e-data-1.2.12}/edata/const.py +0 -0
  17. {e-data-1.2.11 → e-data-1.2.12}/edata/definitions.py +0 -0
  18. {e-data-1.2.11 → e-data-1.2.12}/edata/processors/__init__.py +0 -0
  19. {e-data-1.2.11 → e-data-1.2.12}/edata/processors/base.py +0 -0
  20. {e-data-1.2.11 → e-data-1.2.12}/edata/processors/billing.py +0 -0
  21. {e-data-1.2.11 → e-data-1.2.12}/edata/processors/consumption.py +0 -0
  22. {e-data-1.2.11 → e-data-1.2.12}/edata/processors/maximeter.py +0 -0
  23. {e-data-1.2.11 → e-data-1.2.12}/edata/processors/utils.py +0 -0
  24. {e-data-1.2.11 → e-data-1.2.12}/edata/storage.py +0 -0
  25. {e-data-1.2.11 → e-data-1.2.12}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: e-data
3
- Version: 1.2.11
3
+ Version: 1.2.12
4
4
  Summary: Python library for managing spanish energy data from various web providers
5
5
  Home-page: https://github.com/uvejota/python-edata
6
6
  Author: VMG
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: e-data
3
- Version: 1.2.11
3
+ Version: 1.2.12
4
4
  Summary: Python library for managing spanish energy data from various web providers
5
5
  Home-page: https://github.com/uvejota/python-edata
6
6
  Author: VMG
@@ -58,6 +58,7 @@ class EdataHelper:
58
58
  self._date_from = datetime(1970, 1, 1)
59
59
  self._date_to = datetime.today()
60
60
  self._must_dump = True
61
+ self._incremental_update = True
61
62
 
62
63
  if data is not None:
63
64
  data = check_storage_integrity(data)
@@ -107,10 +108,12 @@ class EdataHelper:
107
108
  self,
108
109
  date_from: datetime = datetime(1970, 1, 1),
109
110
  date_to: datetime = datetime.today(),
111
+ incremental_update: bool = True,
110
112
  ):
111
113
  """Synchronous update."""
112
114
  self._date_from = date_from
113
115
  self._date_to = date_to
116
+ self._incremental_update = incremental_update
114
117
 
115
118
  # update datadis resources
116
119
  self.update_datadis(self._cups, date_from, date_to)
@@ -423,10 +426,12 @@ class EdataHelper:
423
426
  def process_consumptions(self):
424
427
  """Process consumptions data."""
425
428
  if len(self.data["consumptions"]) > 0:
426
- try:
427
- new_data_from = self.data["consumptions_monthly_sum"][-1]["datetime"]
428
- except Exception:
429
- new_data_from = self._date_from
429
+ new_data_from = self._date_from
430
+ if self._incremental_update:
431
+ with contextlib.suppress(Exception):
432
+ new_data_from = self.data["consumptions_monthly_sum"][-1][
433
+ "datetime"
434
+ ]
430
435
 
431
436
  proc = ConsumptionProcessor(
432
437
  {
@@ -624,10 +629,10 @@ class EdataHelper:
624
629
  def process_cost(self):
625
630
  """Process costs."""
626
631
  if self.enable_billing:
627
- try:
628
- new_data_from = self.data["cost_monthly_sum"][-1]["datetime"]
629
- except Exception:
630
- new_data_from = self._date_from
632
+ new_data_from = self._date_from
633
+ if self._incremental_update:
634
+ with contextlib.suppress(Exception):
635
+ new_data_from = self.data["cost_monthly_sum"][-1]["datetime"]
631
636
 
632
637
  proc = BillingProcessor(
633
638
  BillingInput(
@@ -20,7 +20,7 @@ URL = "https://github.com/uvejota/python-edata"
20
20
  EMAIL = "vmayorg@outlook.es"
21
21
  AUTHOR = "VMG"
22
22
  REQUIRES_PYTHON = ">=3.6.0"
23
- VERSION = "1.2.11"
23
+ VERSION = "1.2.12"
24
24
 
25
25
  # What packages are required for this module to be executed?
26
26
  REQUIRED = [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes