pygazpar 1.3.0a11__tar.gz → 1.3.0a13__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. {pygazpar-1.3.0a11/pygazpar.egg-info → pygazpar-1.3.0a13}/PKG-INFO +14 -2
  2. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/pygazpar/datasource.py +7 -7
  3. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/pygazpar/excelparser.py +1 -1
  4. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/pygazpar/jsonparser.py +1 -1
  5. pygazpar-1.3.0a13/pygazpar/version.py +1 -0
  6. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13/pygazpar.egg-info}/PKG-INFO +14 -2
  7. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/pygazpar.egg-info/entry_points.txt +1 -0
  8. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/tests/test_client.py +14 -0
  9. pygazpar-1.3.0a11/pygazpar/version.py +0 -1
  10. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/LICENSE.md +0 -0
  11. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/MANIFEST.in +0 -0
  12. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/README.md +0 -0
  13. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/pygazpar/__init__.py +0 -0
  14. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/pygazpar/__main__.py +0 -0
  15. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/pygazpar/client.py +0 -0
  16. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/pygazpar/enum.py +0 -0
  17. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/pygazpar/resources/daily_data_sample.json +0 -0
  18. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/pygazpar/resources/hourly_data_sample.json +0 -0
  19. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/pygazpar/resources/monthly_data_sample.json +0 -0
  20. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/pygazpar/resources/weekly_data_sample.json +0 -0
  21. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/pygazpar/resources/yearly_data_sample.json +0 -0
  22. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/pygazpar.egg-info/SOURCES.txt +0 -0
  23. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/pygazpar.egg-info/dependency_links.txt +0 -0
  24. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/pygazpar.egg-info/not-zip-safe +0 -0
  25. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/pygazpar.egg-info/requires.txt +0 -0
  26. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/pygazpar.egg-info/top_level.txt +0 -0
  27. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/samples/__init__.py +0 -0
  28. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/samples/excelSample.py +0 -0
  29. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/samples/jsonSample.py +0 -0
  30. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/samples/testSample.py +0 -0
  31. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/setup.cfg +0 -0
  32. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/setup.py +0 -0
  33. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/tests/__init__.py +0 -0
  34. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/tests/test_datafileparser.py +0 -0
  35. {pygazpar-1.3.0a11 → pygazpar-1.3.0a13}/tests/test_datasource.py +0 -0
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pygazpar
3
- Version: 1.3.0a11
3
+ Version: 1.3.0a13
4
4
  Summary: Retrieve gas consumption from GrDF web site (French Gas Company)
5
5
  Home-page: https://github.com/ssenart/pygazpar
6
- Download-URL: https://github.com/ssenart/pygazpar/releases
7
6
  Author: Stephane Senart
8
7
  Author-email: stephane.senart@gmail.com
9
8
  License: MIT
9
+ Download-URL: https://github.com/ssenart/pygazpar/releases
10
10
  Project-URL: Home, https://github.com/ssenart/pygazpar
11
11
  Project-URL: Source, https://github.com/ssenart/pygazpar
12
12
  Project-URL: Issues, https://github.com/ssenart/PyGazpar/issues
@@ -217,6 +217,16 @@ All notable changes to this project will be documented in this file.
217
217
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
218
218
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
219
219
 
220
+ ## [1.2.5](https://github.com/ssenart/PyGazpar/compare/1.2.5...1.2.4) - 2024-12-21
221
+
222
+ ### Fixed
223
+ - [#75](https://github.com/ssenart/PyGazpar/issues/75): Fix an error when no temperature data is available.
224
+
225
+ ## [1.2.4](https://github.com/ssenart/PyGazpar/compare/1.2.4...1.2.3) - 2024-10-09
226
+
227
+ ### Fixed
228
+ - [#72](https://github.com/ssenart/PyGazpar/issues/72): Remove the warning message "UserWarning: Boolean Series key will be reindexed to match DataFrame index. df = pd.concat([df[(df["count"] >= 7)], df.tail(1)[df["count"] < 7]])".
229
+
220
230
  ## [1.2.3](https://github.com/ssenart/PyGazpar/compare/1.2.3...1.2.1) - 2024-10-05
221
231
 
222
232
  ### Added
@@ -453,3 +463,5 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
453
463
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
454
464
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
455
465
  SOFTWARE.
466
+
467
+
@@ -94,14 +94,14 @@ class WebDataSource(IDataSource):
94
94
 
95
95
  params = json.loads(AUTH_TOKEN_PARAMS.format(session_token))
96
96
 
97
- response = session.get(AUTH_TOKEN_URL, params=params, allow_redirects=True, cookies=jar)
97
+ response = session.get(AUTH_TOKEN_URL, params=params, allow_redirects=True, cookies=jar) # type: ignore
98
98
 
99
99
  if response.status_code != 200:
100
100
  raise Exception(f"An error occurred while getting the auth token. Status code: {response.status_code} - {response.text}")
101
101
 
102
102
  auth_token = session.cookies.get("auth_token", domain="monespace.grdf.fr")
103
103
 
104
- return auth_token
104
+ return auth_token # type: ignore
105
105
 
106
106
  @abstractmethod
107
107
  def _loadFromSession(self, auth_token: str, pceIdentifier: str, startDate: date, endDate: date, frequencies: Optional[List[Frequency]] = None) -> MeterReadingsByFrequency:
@@ -211,7 +211,7 @@ class ExcelWebDataSource(WebDataSource):
211
211
 
212
212
  response = session.get(url)
213
213
 
214
- if "text/html" in response.headers.get("Content-Type"):
214
+ if "text/html" in response.headers.get("Content-Type"): # type: ignore
215
215
  raise Exception("An error occurred while loading data. Please check your credentials.")
216
216
 
217
217
  if response.status_code != 200:
@@ -297,7 +297,7 @@ class JsonWebDataSource(WebDataSource):
297
297
  try:
298
298
  response = session.get(downloadUrl)
299
299
 
300
- if "text/html" in response.headers.get("Content-Type"):
300
+ if "text/html" in response.headers.get("Content-Type"): # type: ignore
301
301
  raise Exception("An error occurred while loading data. Please check your credentials.")
302
302
 
303
303
  if response.status_code != 200:
@@ -466,7 +466,7 @@ class FrequencyConverter:
466
466
  df = df.sort_values(by=['first_day_of_week'])
467
467
 
468
468
  # Select rows where we have a full week (7 days) except for the current week.
469
- df = pd.concat([df[(df["count"] >= 7)], df.tail(1)[df["count"] < 7]])
469
+ df = pd.concat([df[(df["count"] >= 7)], df.tail(1)[df.tail(1)["count"] < 7]])
470
470
 
471
471
  # Select target columns.
472
472
  df = df[["time_period", "start_index_m3", "end_index_m3", "volume_m3", "energy_kwh", "timestamp"]]
@@ -494,7 +494,7 @@ class FrequencyConverter:
494
494
  df = df.sort_values(by=['first_day_of_month'])
495
495
 
496
496
  # Select rows where we have a full month (more than 27 days) except for the current month.
497
- df = pd.concat([df[(df["count"] >= 28)], df.tail(1)[df["count"] < 28]])
497
+ df = pd.concat([df[(df["count"] >= 28)], df.tail(1)[df.tail(1)["count"] < 28]])
498
498
 
499
499
  # Rename columns for their target names.
500
500
  df = df.rename(columns={"month_year": "time_period"})
@@ -525,7 +525,7 @@ class FrequencyConverter:
525
525
  df = df.sort_values(by=['year'])
526
526
 
527
527
  # Select rows where we have almost a full year (more than 360) except for the current year.
528
- df = pd.concat([df[(df["count"] >= 360)], df.tail(1)[df["count"] < 360]])
528
+ df = pd.concat([df[(df["count"] >= 360)], df.tail(1)[df.tail(1)["count"] < 360]])
529
529
 
530
530
  # Rename columns for their target names.
531
531
  df = df.rename(columns={"year": "time_period"})
@@ -33,7 +33,7 @@ class ExcelParser:
33
33
 
34
34
  worksheet = workbook.active
35
35
 
36
- res = parseByFrequency[dataReadingFrequency](worksheet)
36
+ res = parseByFrequency[dataReadingFrequency](worksheet) # type: ignore
37
37
 
38
38
  workbook.close()
39
39
 
@@ -29,7 +29,7 @@ class JsonParser:
29
29
 
30
30
  for releve in data[pceIdentifier]['releves']:
31
31
  temperature = releve['temperature']
32
- if temperature is None:
32
+ if temperature is None and temperatures is not None and len(temperatures) > 0:
33
33
  temperature = temperatures.get(releve['journeeGaziere'])
34
34
 
35
35
  item = {}
@@ -0,0 +1 @@
1
+ __version__ = "1.3.0a13"
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pygazpar
3
- Version: 1.3.0a11
3
+ Version: 1.3.0a13
4
4
  Summary: Retrieve gas consumption from GrDF web site (French Gas Company)
5
5
  Home-page: https://github.com/ssenart/pygazpar
6
- Download-URL: https://github.com/ssenart/pygazpar/releases
7
6
  Author: Stephane Senart
8
7
  Author-email: stephane.senart@gmail.com
9
8
  License: MIT
9
+ Download-URL: https://github.com/ssenart/pygazpar/releases
10
10
  Project-URL: Home, https://github.com/ssenart/pygazpar
11
11
  Project-URL: Source, https://github.com/ssenart/pygazpar
12
12
  Project-URL: Issues, https://github.com/ssenart/PyGazpar/issues
@@ -217,6 +217,16 @@ All notable changes to this project will be documented in this file.
217
217
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
218
218
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
219
219
 
220
+ ## [1.2.5](https://github.com/ssenart/PyGazpar/compare/1.2.5...1.2.4) - 2024-12-21
221
+
222
+ ### Fixed
223
+ - [#75](https://github.com/ssenart/PyGazpar/issues/75): Fix an error when no temperature data is available.
224
+
225
+ ## [1.2.4](https://github.com/ssenart/PyGazpar/compare/1.2.4...1.2.3) - 2024-10-09
226
+
227
+ ### Fixed
228
+ - [#72](https://github.com/ssenart/PyGazpar/issues/72): Remove the warning message "UserWarning: Boolean Series key will be reindexed to match DataFrame index. df = pd.concat([df[(df["count"] >= 7)], df.tail(1)[df["count"] < 7]])".
229
+
220
230
  ## [1.2.3](https://github.com/ssenart/PyGazpar/compare/1.2.3...1.2.1) - 2024-10-05
221
231
 
222
232
  ### Added
@@ -453,3 +463,5 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
453
463
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
454
464
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
455
465
  SOFTWARE.
466
+
467
+
@@ -1,2 +1,3 @@
1
1
  [console_scripts]
2
2
  pygazpar = pygazpar.__main__:main
3
+
@@ -52,6 +52,20 @@ class TestClient:
52
52
 
53
53
  assert (len(data[Frequency.HOURLY.value]) == 0)
54
54
 
55
+ def test_one_day_jsonweb(self):
56
+ client = Client(JsonWebDataSource(self.__username, self.__password))
57
+
58
+ data = client.loadSince(self.__pceIdentifier, 1, [Frequency.DAILY])
59
+
60
+ assert (len(data[Frequency.DAILY.value]) <= 1)
61
+
62
+ def test_two_days_jsonweb(self):
63
+ client = Client(JsonWebDataSource(self.__username, self.__password))
64
+
65
+ data = client.loadSince(self.__pceIdentifier, 2, [Frequency.DAILY])
66
+
67
+ assert (len(data[Frequency.DAILY.value]) <= 2)
68
+
55
69
  # @pytest.mark.skip(reason="Requires live data")
56
70
  def test_daily_jsonweb(self):
57
71
  client = Client(JsonWebDataSource(self.__username, self.__password))
@@ -1 +0,0 @@
1
- __version__ = "1.3.0a11"
File without changes
File without changes
File without changes
File without changes
File without changes