pygazpar 1.3.0a11__py310-none-any.whl → 1.3.0a12__py310-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- pygazpar/datasource.py +7 -7
- pygazpar/excelparser.py +1 -1
- pygazpar/version.py +1 -1
- {pygazpar-1.3.0a11.dist-info → pygazpar-1.3.0a12.dist-info}/METADATA +6 -1
- {pygazpar-1.3.0a11.dist-info → pygazpar-1.3.0a12.dist-info}/RECORD +9 -9
- {pygazpar-1.3.0a11.dist-info → pygazpar-1.3.0a12.dist-info}/LICENSE.md +0 -0
- {pygazpar-1.3.0a11.dist-info → pygazpar-1.3.0a12.dist-info}/WHEEL +0 -0
- {pygazpar-1.3.0a11.dist-info → pygazpar-1.3.0a12.dist-info}/entry_points.txt +0 -0
- {pygazpar-1.3.0a11.dist-info → pygazpar-1.3.0a12.dist-info}/top_level.txt +0 -0
pygazpar/datasource.py
CHANGED
@@ -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"})
|
pygazpar/excelparser.py
CHANGED
pygazpar/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "1.3.
|
1
|
+
__version__ = "1.3.0a12"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pygazpar
|
3
|
-
Version: 1.3.
|
3
|
+
Version: 1.3.0a12
|
4
4
|
Summary: Retrieve gas consumption from GrDF web site (French Gas Company)
|
5
5
|
Home-page: https://github.com/ssenart/pygazpar
|
6
6
|
Download-URL: https://github.com/ssenart/pygazpar/releases
|
@@ -220,6 +220,11 @@ All notable changes to this project will be documented in this file.
|
|
220
220
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
221
221
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
222
222
|
|
223
|
+
## [1.2.4](https://github.com/ssenart/PyGazpar/compare/1.2.4...1.2.3) - 2024-10-09
|
224
|
+
|
225
|
+
### Fixed
|
226
|
+
- [#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]])".
|
227
|
+
|
223
228
|
## [1.2.3](https://github.com/ssenart/PyGazpar/compare/1.2.3...1.2.1) - 2024-10-05
|
224
229
|
|
225
230
|
### Added
|
@@ -1,11 +1,11 @@
|
|
1
1
|
pygazpar/__init__.py,sha256=qshO_XZbDA2Wrt80ABDs0MoScqJytClAuIJjAnILglk,309
|
2
2
|
pygazpar/__main__.py,sha256=Pt3PInX7QiWcs0aBKZN90NTaU8KFnrQiZ5Hsow1eR5U,3177
|
3
3
|
pygazpar/client.py,sha256=JdVm0jZbeibwtTumcRbUSFadfXnCUClPMjL95_J6p5Y,2595
|
4
|
-
pygazpar/datasource.py,sha256=
|
4
|
+
pygazpar/datasource.py,sha256=N9OVdJr4BwtA0W8DvKe4PEE4kLKbSEH2wxAYGNk-iIU,21558
|
5
5
|
pygazpar/enum.py,sha256=3ZCk4SziXF6pxgP3MuQ1qxYfqB3X5DOV8Rtd0GHsK9w,898
|
6
|
-
pygazpar/excelparser.py,sha256=
|
6
|
+
pygazpar/excelparser.py,sha256=QNFIErXNgMjGGjsGjdnRxAbNpfVagdYmZQtXRub3_Xc,5931
|
7
7
|
pygazpar/jsonparser.py,sha256=AWdU3h7UohsOov8HpeP8GNuqcnDmM4r3I7-CI_crDvA,1804
|
8
|
-
pygazpar/version.py,sha256=
|
8
|
+
pygazpar/version.py,sha256=NYLHmRgRpna4gqXDsWvEWKVyypmZM3RBiuJ43vesebY,25
|
9
9
|
pygazpar/resources/daily_data_sample.json,sha256=YJovtrNUMs257magTfyxiewLmecySFypcelbGFUUeT8,199583
|
10
10
|
pygazpar/resources/hourly_data_sample.json,sha256=N1F-Xz3GaBn2H1p7uKzhkhKCQV8QVR0t76XD6wmFtXA,3
|
11
11
|
pygazpar/resources/monthly_data_sample.json,sha256=yrr4SqrB2MubeVU2HX_FRDZKHIhC0LXCqkO1iqnFWcg,3351
|
@@ -19,9 +19,9 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
tests/test_client.py,sha256=DVGGubMPMM56LvQW-4_pCouvG9qTCbVZVPoRTBGuCU4,5111
|
20
20
|
tests/test_datafileparser.py,sha256=nAeUpOHtelblMpmbrrnf-2GuMjK5ai65veDoymceprE,818
|
21
21
|
tests/test_datasource.py,sha256=Fkn9BOGVKITAgrx9XipR1_ykT7rdvPyt_PAg3ftjfSU,5983
|
22
|
-
pygazpar-1.3.
|
23
|
-
pygazpar-1.3.
|
24
|
-
pygazpar-1.3.
|
25
|
-
pygazpar-1.3.
|
26
|
-
pygazpar-1.3.
|
27
|
-
pygazpar-1.3.
|
22
|
+
pygazpar-1.3.0a12.dist-info/LICENSE.md,sha256=XsCJx_7_BC9tvmE0ZxS1cTNR7ekurog_ea9ybdZ-8tc,1073
|
23
|
+
pygazpar-1.3.0a12.dist-info/METADATA,sha256=NuwxgC5w4f_2V6xuEaEtZJCq6KsZsPOf3g9P_QZGoJI,18744
|
24
|
+
pygazpar-1.3.0a12.dist-info/WHEEL,sha256=zXk6K_A7S1zXTTGQPK42FLTtMF4m_BNsmq7d4JZSrOg,94
|
25
|
+
pygazpar-1.3.0a12.dist-info/entry_points.txt,sha256=dNJjC6RYY3FeJIe0hZL9Kcr6vKEx1qkZ71e6Slocb7I,52
|
26
|
+
pygazpar-1.3.0a12.dist-info/top_level.txt,sha256=P7qn-XtanDPBLQsTvjvLV71wH8RK0DYbx8tzN_rDS70,23
|
27
|
+
pygazpar-1.3.0a12.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|