pygazpar 1.3.0a6__py37-none-any.whl → 1.3.0a9__py37-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
pygazpar/datasource.py CHANGED
@@ -144,7 +144,10 @@ class ExcelWebDataSource(WebDataSource):
144
144
  file_list = glob.glob(data_file_path_pattern)
145
145
  for filename in file_list:
146
146
  if os.path.isfile(filename):
147
- os.remove(filename)
147
+ try:
148
+ os.remove(filename)
149
+ except PermissionError:
150
+ pass
148
151
 
149
152
  if frequencies is None:
150
153
  # Transform Enum in List.
@@ -194,7 +197,7 @@ class ExcelWebDataSource(WebDataSource):
194
197
  try:
195
198
  # openpyxl does not close the file properly.
196
199
  os.remove(filename)
197
- except Exception:
200
+ except PermissionError:
198
201
  pass
199
202
 
200
203
  # We compute yearly from daily data.
pygazpar/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.3.0a6"
1
+ __version__ = "1.3.0a9"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pygazpar
3
- Version: 1.3.0a6
3
+ Version: 1.3.0a9
4
4
  Summary: Retrieve gas consumption from GrDF web site (French Gas Company)
5
5
  Home-page: https://github.com/ssenart/pygazpar
6
6
  Author: Stephane Senart
@@ -29,6 +29,11 @@ Requires-Dist: requests >=2.26.0
29
29
  Requires-Dist: pandas
30
30
 
31
31
  # PyGazpar
32
+
33
+ ## <span style="color:green">!!! This library is working again. CAPTCHA has been removed !!!</span>
34
+
35
+ ## <span style="color:red">~~!!! This library is broken since CAPTCHA is mandatory on GrDF site !!!~~</span>
36
+
32
37
  PyGazpar is a Python library for getting natural gas consumption from GrDF French provider.
33
38
 
34
39
  Their natural gas meter is called Gazpar. It is wireless and transmit the gas consumption once per day.
@@ -213,6 +218,10 @@ All notable changes to this project will be documented in this file.
213
218
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
214
219
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
215
220
 
221
+ ## [1.2.2](https://github.com/ssenart/PyGazpar/compare/1.2.1...1.2.2) - 2024-05-08
222
+
223
+ ### Fixed
224
+ - [#65](https://github.com/ssenart/PyGazpar/issues/65): [Bug] PermissionError happens when loading data from Excel file.
216
225
 
217
226
  ## [1.2.1](https://github.com/ssenart/PyGazpar/compare/1.2.0...1.2.1) - 2024-05-04
218
227
 
@@ -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=gqOREo9OQaBmqWgaDIgShJrP1dZNVFJoIxUu9Rfxmec,21374
4
+ pygazpar/datasource.py,sha256=nlIWxZ6SNSHf09BVBFIChSHf4dN05lC3LCxUUDRTylg,21470
5
5
  pygazpar/enum.py,sha256=3ZCk4SziXF6pxgP3MuQ1qxYfqB3X5DOV8Rtd0GHsK9w,898
6
6
  pygazpar/excelparser.py,sha256=glWlbj22pxYjHGKurOFmhzcVAoWCvfOHn7_Y6GgHUPo,5915
7
7
  pygazpar/jsonparser.py,sha256=AWdU3h7UohsOov8HpeP8GNuqcnDmM4r3I7-CI_crDvA,1804
8
- pygazpar/version.py,sha256=rcyBYFWxUArZ5y56YkLypabOiwSZfCl48nXHK0ebB20,24
8
+ pygazpar/version.py,sha256=M68dz_mPRENIQzrCD_i1UgDy4ON37VxutlMfPrsxFpY,24
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
@@ -16,12 +16,12 @@ samples/excelSample.py,sha256=ltAl-bBz9-U9YI802JpcIswra-vDS7tR_KL5VNdxJ5c,765
16
16
  samples/jsonSample.py,sha256=sYAIusdEJhZdwDAMgHqoWcwDR0FA2eWhSt_2gL_mJRk,736
17
17
  samples/testSample.py,sha256=UeirdEtezHwfZDv_75oxul17YzGWn5yZuHfJYTF3Ez0,387
18
18
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
- tests/test_client.py,sha256=OwYBeNC66WiykU1IUEf4eZacAU49xQJXsFQY6kYiXCQ,5111
19
+ tests/test_client.py,sha256=DVGGubMPMM56LvQW-4_pCouvG9qTCbVZVPoRTBGuCU4,5111
20
20
  tests/test_datafileparser.py,sha256=nAeUpOHtelblMpmbrrnf-2GuMjK5ai65veDoymceprE,818
21
- tests/test_datasource.py,sha256=2BCrnUh9ZbR_dAdvKT9498u5a-jGnC4aZafP7V9iZn8,5983
22
- pygazpar-1.3.0a6.dist-info/LICENSE.md,sha256=XsCJx_7_BC9tvmE0ZxS1cTNR7ekurog_ea9ybdZ-8tc,1073
23
- pygazpar-1.3.0a6.dist-info/METADATA,sha256=rAa2dhtTBrI7Bqo53G1ZPN1NgAIBGu7SsWfE0EmUW34,17741
24
- pygazpar-1.3.0a6.dist-info/WHEEL,sha256=9FUYUSCt5io1tVBOVa-3S0zjcMzGO1nOIw99iWozm3o,93
25
- pygazpar-1.3.0a6.dist-info/entry_points.txt,sha256=c_FMZPYlRv1w9EqfgWhlkdJOoje7FcglI0UMm2oRLoI,53
26
- pygazpar-1.3.0a6.dist-info/top_level.txt,sha256=P7qn-XtanDPBLQsTvjvLV71wH8RK0DYbx8tzN_rDS70,23
27
- pygazpar-1.3.0a6.dist-info/RECORD,,
21
+ tests/test_datasource.py,sha256=Fkn9BOGVKITAgrx9XipR1_ykT7rdvPyt_PAg3ftjfSU,5983
22
+ pygazpar-1.3.0a9.dist-info/LICENSE.md,sha256=XsCJx_7_BC9tvmE0ZxS1cTNR7ekurog_ea9ybdZ-8tc,1073
23
+ pygazpar-1.3.0a9.dist-info/METADATA,sha256=WN6S_-4VAud_Dph6tll4CL3NCn5WkaQP66czhgArX8I,18168
24
+ pygazpar-1.3.0a9.dist-info/WHEEL,sha256=9FUYUSCt5io1tVBOVa-3S0zjcMzGO1nOIw99iWozm3o,93
25
+ pygazpar-1.3.0a9.dist-info/entry_points.txt,sha256=c_FMZPYlRv1w9EqfgWhlkdJOoje7FcglI0UMm2oRLoI,53
26
+ pygazpar-1.3.0a9.dist-info/top_level.txt,sha256=P7qn-XtanDPBLQsTvjvLV71wH8RK0DYbx8tzN_rDS70,23
27
+ pygazpar-1.3.0a9.dist-info/RECORD,,
tests/test_client.py CHANGED
@@ -72,7 +72,7 @@ class TestClient:
72
72
 
73
73
  data = client.loadSince(self.__pceIdentifier, 365, [Frequency.MONTHLY])
74
74
 
75
- assert (len(data[Frequency.MONTHLY.value]) >= 12 and len(data[Frequency.MONTHLY.value]) <= 13)
75
+ assert (len(data[Frequency.MONTHLY.value]) >= 11 and len(data[Frequency.MONTHLY.value]) <= 13)
76
76
 
77
77
  def test_yearly_jsonweb(self):
78
78
  client = Client(JsonWebDataSource(self.__username, self.__password))
tests/test_datasource.py CHANGED
@@ -143,7 +143,7 @@ class TestAllDataSource:
143
143
 
144
144
  assert (len(data[Frequency.WEEKLY.value]) >= 51 and len(data[Frequency.WEEKLY.value]) <= 54)
145
145
 
146
- assert (len(data[Frequency.MONTHLY.value]) >= 12 and len(data[Frequency.MONTHLY.value]) <= 13)
146
+ assert (len(data[Frequency.MONTHLY.value]) >= 11 and len(data[Frequency.MONTHLY.value]) <= 13)
147
147
 
148
148
  assert (len(data[Frequency.YEARLY.value]) == 1)
149
149