pygazpar 1.2.8__py313-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,481 @@
1
+ Metadata-Version: 2.2
2
+ Name: pygazpar
3
+ Version: 1.2.8
4
+ Summary: Retrieve gas consumption from GrDF web site (French Gas Company)
5
+ Home-page: https://github.com/ssenart/pygazpar
6
+ Download-URL: https://github.com/ssenart/pygazpar/releases
7
+ Author: Stephane Senart
8
+ Author-email: stephane.senart@gmail.com
9
+ License: MIT
10
+ Project-URL: Home, https://github.com/ssenart/pygazpar
11
+ Project-URL: Source, https://github.com/ssenart/pygazpar
12
+ Project-URL: Issues, https://github.com/ssenart/PyGazpar/issues
13
+ Project-URL: Changelog, https://github.com/ssenart/PyGazpar/blob/master/CHANGELOG.md
14
+ Project-URL: Download, https://pypi.org/project/pygazpar
15
+ Keywords: Energy,Natural Gas,Meter,GrDF,Gazpar
16
+ Platform: any
17
+ Classifier: Development Status :: 5 - Production/Stable
18
+ Classifier: Topic :: Software Development :: Libraries
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Requires-Python: >=3.9
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE.md
28
+ Requires-Dist: openpyxl>=2.6.3
29
+ Requires-Dist: requests>=2.26.0
30
+ Requires-Dist: pandas
31
+ Dynamic: download-url
32
+
33
+ # PyGazpar
34
+
35
+ ## $\text{\color{green}{!!! This library is working again. CAPTCHA has been removed !!!}}$
36
+
37
+ PyGazpar is a Python library for getting natural gas consumption from GrDF French provider.
38
+
39
+ Their natural gas meter is called Gazpar. It is wireless and transmit the gas consumption once per day.
40
+
41
+ All consumption data is available on the client account at GrDF Web Site (https://monespace.grdf.fr).
42
+
43
+ PyGazpar automatically goes through the Web Site and download the consumption data, and make it available in a Python structure.
44
+
45
+ ## Installation
46
+
47
+ ### Requirements
48
+ PyGazpar does not require Selenium and corresponding geckodriver to work.
49
+
50
+ With the new GrDF web site, it is possible to load the consumption data far easily than before.
51
+
52
+ ### Create your virtual environment
53
+ ```bash
54
+ $ cd /path/to/my_project_folder/
55
+
56
+ $ python -m venv .venv
57
+ ```
58
+
59
+ ### PyGazpar installation
60
+ Activate your virtual environment.
61
+ ```bash
62
+ source .venv/bin/activate
63
+ ```
64
+
65
+ Use the package manager [pip](https://pip.pypa.io/en/stable/) to install PyGazpar.
66
+ ```bash
67
+ pip install pygazpar
68
+ ```
69
+
70
+ You can also download the source code and install it manually.
71
+ ```bash
72
+ cd /path/to/pygazpar/
73
+ python setup.py install
74
+ ```
75
+
76
+ ## Usage
77
+
78
+ #### Command line:
79
+
80
+ 1. Standard usage (using Json GrDF API).
81
+
82
+ ```bash
83
+ $ pygazpar -u 'your login' -p 'your password' -c 'your PCE identifier' --datasource 'json'
84
+ ```
85
+
86
+ 2. Alternate usage (using Excel GrDF document).
87
+
88
+ ```bash
89
+ $ pygazpar -u 'your login' -p 'your password' -c 'your PCE identifier' -t 'temporary directory where to store Excel file (ex: /tmp)' --datasource 'excel'
90
+ ```
91
+
92
+ 3. Test usage (using local static data files, do not connect to GrDF site).
93
+
94
+ ```bash
95
+ $ pygazpar -u 'your login' -p 'your password' -c 'your PCE identifier' --datasource 'test'
96
+ ```
97
+
98
+ #### Library:
99
+
100
+ 1. Standard usage (using Json GrDF API).
101
+
102
+ ```python
103
+ import pygazpar
104
+
105
+ client = pygazpar.Client(pygazpar.JsonWebDataSource(
106
+ username='your login',
107
+ password='your password')
108
+ )
109
+
110
+ data = client.loadSince(pceIdentifier='your PCE identifier',
111
+ lastNDays=60,
112
+ frequencies=[pygazpar.Frequency.DAILY, pygazpar.Frequency.MONTHLY])
113
+ ```
114
+ See [samples/jsonSample.py](samples/jsonSample.py) file for the full example.
115
+
116
+ 2. Alternate usage (using Excel GrDF document).
117
+
118
+ ```python
119
+ import pygazpar
120
+
121
+ client = pygazpar.Client(pygazpar.ExcelWebDataSource(
122
+ username='your login',
123
+ password='your password')
124
+ )
125
+
126
+ data = client.loadSince(pceIdentifier='your PCE identifier',
127
+ lastNDays=60,
128
+ frequencies=[pygazpar.Frequency.DAILY, pygazpar.Frequency.MONTHLY])
129
+ ```
130
+ See [samples/excelSample.py](samples/jsonSample.py) file for the full example.
131
+
132
+ 3. Test usage (using local static data files, do not connect to GrDF site).
133
+
134
+ ```python
135
+ import pygazpar
136
+
137
+ client = pygazpar.Client(pygazpar.TestDataSource())
138
+
139
+ data = client.loadSince(pceIdentifier='your PCE identifier',
140
+ lastNDays=10,
141
+ frequencies=[pygazpar.Frequency.DAILY, Frequency.MONTHLY])
142
+ ```
143
+ See [samples/testSample.py](samples/jsonSample.py) file for the full example.
144
+
145
+ #### Output:
146
+
147
+ ```json
148
+ data =>
149
+ {
150
+ "daily": [
151
+ {
152
+ "time_period": "13/10/2022",
153
+ "start_index_m3": 15724,
154
+ "end_index_m3": 15725,
155
+ "volume_m3": 2,
156
+ "energy_kwh": 17,
157
+ "converter_factor_kwh/m3": 11.16,
158
+ "temperature_degC": null,
159
+ "type": "Mesur\u00e9",
160
+ "timestamp": "2022-12-13T23:58:35.606763"
161
+ },
162
+ ...
163
+ {
164
+ "time_period": "11/12/2022",
165
+ "start_index_m3": 16081,
166
+ "end_index_m3": 16098,
167
+ "volume_m3": 18,
168
+ "energy_kwh": 201,
169
+ "converter_factor_kwh/m3": 11.27,
170
+ "temperature_degC": -1.47,
171
+ "type": "Mesur\u00e9",
172
+ "timestamp": "2022-12-13T23:58:35.606763"
173
+ }
174
+ ],
175
+ "monthly": [
176
+ {
177
+ "time_period": "Novembre 2022",
178
+ "start_index_m3": 15750,
179
+ "end_index_m3": 15950,
180
+ "volume_m3": 204,
181
+ "energy_kwh": 2227,
182
+ "timestamp": "2022-12-13T23:58:35.606763"
183
+ },
184
+ {
185
+ "time_period": "D\u00e9cembre 2022",
186
+ "start_index_m3": 15950,
187
+ "end_index_m3": 16098,
188
+ "volume_m3": 148,
189
+ "energy_kwh": 1664,
190
+ "timestamp": "2022-12-13T23:58:35.606763"
191
+ }
192
+ ]
193
+ }
194
+ ```
195
+
196
+ ## Limitation
197
+ PyGazpar relies on how GrDF Web Site is built.
198
+
199
+ Any change in the Web site may break this library.
200
+
201
+ We expect in close Future that GrDF makes available an open API from which we can get safely their data.
202
+
203
+ ## Contributing
204
+ Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
205
+
206
+ Please make sure to update tests as appropriate.
207
+
208
+ ## License
209
+ [MIT](https://choosealicense.com/licenses/mit/)
210
+
211
+ ## Project status
212
+ PyGazpar has been initiated for integration with [Home Assistant](https://www.home-assistant.io/).
213
+
214
+ Corresponding Home Assistant integration custom component is available [here](https://github.com/ssenart/home-assistant-gazpar).
215
+ # Changelog
216
+ All notable changes to this project will be documented in this file.
217
+
218
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
219
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
220
+
221
+ ## [1.2.8](https://github.com/ssenart/PyGazpar/compare/1.2.8...1.2.7) - 2025-01-11
222
+
223
+ ### Added
224
+ - [#81](https://github.com/ssenart/PyGazpar/issues/81): Add meter/temperature debug log messages to help investigation in case of errors.
225
+
226
+ ## [1.2.7](https://github.com/ssenart/PyGazpar/compare/1.2.7...1.2.6) - 2025-01-06
227
+
228
+ ### Fixed
229
+ - [#79](https://github.com/ssenart/PyGazpar/issues/79): Fix some unittests that wrongly failed because of the new year.
230
+
231
+ ## [1.2.6](https://github.com/ssenart/PyGazpar/compare/1.2.6...1.2.5) - 2025-01-03
232
+
233
+ ### Fixed
234
+ - [#77](https://github.com/ssenart/PyGazpar/issues/77): Some error may occur while requesting data from GrDF API.
235
+
236
+ ## [1.2.5](https://github.com/ssenart/PyGazpar/compare/1.2.5...1.2.4) - 2024-12-21
237
+
238
+ ### Fixed
239
+ - [#75](https://github.com/ssenart/PyGazpar/issues/75): Fix an error when no temperature data is available.
240
+
241
+ ## [1.2.4](https://github.com/ssenart/PyGazpar/compare/1.2.4...1.2.3) - 2024-10-09
242
+
243
+ ### Fixed
244
+ - [#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]])".
245
+
246
+ ## [1.2.3](https://github.com/ssenart/PyGazpar/compare/1.2.3...1.2.1) - 2024-10-05
247
+
248
+ ### Added
249
+ - [#70](https://github.com/ssenart/PyGazpar/issues/70): Add Python 3.12 support.
250
+
251
+ ## [1.2.2](https://github.com/ssenart/PyGazpar/compare/1.2.1...1.2.2) - 2024-05-08
252
+
253
+ ### Fixed
254
+ - [#65](https://github.com/ssenart/PyGazpar/issues/65): [Bug] PermissionError happens when loading data from Excel file.
255
+
256
+ ## [1.2.1](https://github.com/ssenart/PyGazpar/compare/1.2.0...1.2.1) - 2024-05-04
257
+
258
+ ### Fixed
259
+ - [#64](https://github.com/ssenart/PyGazpar/issues/64): [Issue] Captcha failed issue.
260
+
261
+ - [#63](https://github.com/ssenart/PyGazpar/issues/63): [Bug] If the latest received consumption is Sunday, then the last weekly period is duplicated.
262
+
263
+ ## [1.2.0](https://github.com/ssenart/PyGazpar/compare/1.1.6...1.2.0) - 2022-12-16
264
+
265
+ ### Changed
266
+ - [#59](https://github.com/ssenart/PyGazpar/issues/59): [Feature] Support both Excel and Json data source format from GrDF site.
267
+
268
+ - [#60](https://github.com/ssenart/PyGazpar/issues/60): [Feature] Permit to load data at multiple frequencies with one method call.
269
+
270
+ ### Fixed
271
+ - [#47](https://github.com/ssenart/PyGazpar/issues/47): [Bug] No temperature field available.
272
+
273
+ - [#58](https://github.com/ssenart/PyGazpar/issues/58): [Issue] No data update - GrDF web site is half broken - Download button does not work anymore.
274
+
275
+ ## [1.1.6](https://github.com/ssenart/PyGazpar/compare/1.1.5...1.1.6) - 2022-11-16
276
+ ### Fixed
277
+ - [#55](https://github.com/ssenart/PyGazpar/issues/55): Problème de connexion.
278
+
279
+ ## [1.1.5](https://github.com/ssenart/PyGazpar/compare/1.1.4...1.1.5) - 2022-07-11
280
+ ### Fixed
281
+ - [#49](https://github.com/ssenart/PyGazpar/issues/49): Authentication failure.
282
+
283
+ ## [1.1.4](https://github.com/ssenart/PyGazpar/compare/1.1.2...1.1.4) - 2022-01-18
284
+ ### Changed
285
+ - [#43](https://github.com/ssenart/PyGazpar/issues/43): Downloaded Excel file name has changed from Donnees_informatives_PCE_$dateDebut_$dateFin.xlsx to Donnees_informatives_$numeroPCE_$dateDebut_$dateFin.xlsx.
286
+
287
+ ## [1.1.2](https://github.com/ssenart/PyGazpar/compare/1.1.1...1.1.2) - 2022-01-08
288
+ ### Fixed
289
+ - [#39](https://github.com/ssenart/PyGazpar/issues/39): NameError: name 'Frequency' is not defined (thanks [nicolas-r](https://github.com/nicolas-r)).
290
+ - Numéro PCE pas forcément un nombre: Le numéro PCE de mon compteur commence par un 0 et lorsque j'essaie de récupérer mes relevés avec PyGazpar, une erreur de l'API est renvoyée. Le numéro PCE ne doit donc pas être converti en int lorsque il est passé en paramètre mais doit être une string (thanks [maelgangloff](https://github.com/maelgangloff)).
291
+
292
+ ## [1.1.1](https://github.com/ssenart/PyGazpar/compare/1.1.0...1.1.1) - 2021-12-02
293
+ ### Changed
294
+ - Exact same version as 1.1.0 except that 1.1.0 has not been published on Pypi repository.
295
+
296
+ ## [1.1.0](https://github.com/ssenart/PyGazpar/compare/1.0.2...1.1.0) - 2021-12-02
297
+ ### Changed
298
+ - Remove Selenium usage and use simple Web request for login and data retrieval.
299
+
300
+ ## [1.0.2](https://github.com/ssenart/PyGazpar/compare/1.0.1...1.0.2) - 2021-11-25
301
+ ### Fixed
302
+ - Fix broken command line pygazpar caused by adding the new lastNDays parameter.
303
+ - Fix the error : ValueError: could not convert string to float: 'Index de début de période (m3)'. It occurs because the records in the Excel file now starts at line 10 instead of line 8 before (thanks to [DEFAYArnaud](https://github.com/DEFAYArnaud) for having spotted the issue and bringing the fix).
304
+
305
+ ### Changed
306
+ - In the Excel file, if a cell is empty, then no corresponding key will be inserted in the result dictionary (before we inserted a key with an empty string).
307
+
308
+ ## [1.0.1](https://github.com/ssenart/PyGazpar/compare/1.0.0...1.0.1) - 2021-11-24
309
+ ### Fixed
310
+ - Fix typo warning from Pylance preventing 1.0.0 to be published.
311
+
312
+ ## [1.0.0](https://github.com/ssenart/PyGazpar/compare/0.2.0...1.0.0) - 2021-11-24
313
+ ### Added
314
+ - New lastNDays parameter to query data only over the last N days period.
315
+
316
+ ### Fixed
317
+ - [#18](https://github.com/ssenart/PyGazpar/issues/18): PyGazpar broken since GRDF Monespace has been upgraded to a new version.
318
+
319
+ ## [0.2.0](https://github.com/ssenart/PyGazpar/compare/0.1.27...0.2.0) - 2021-04-21
320
+ ### Added
321
+ - [#12](https://github.com/ssenart/PyGazpar/issues/10): Be able to retrieve consumption not only on a daily basis, but weekly and monthly:
322
+ - API : Add a new parameter 'meterReadingFrequency' to Client that accepts enumeration: Frequency.DAILY, Frequency.WEEKLY or Frequency.MONTHLY.
323
+ - Command line : Add a new argument '--frequency' that accepts values : DAILY, WEEKLY or MONTHLY.
324
+ - Be able to test using offline data :
325
+ - API : Add a new parameter 'testMode' to Clients used to specify whether we want to get some live data (testMode=False) and static testing data (testMode=True).
326
+ - Command line : Add a new argument '--testMode' (True if specified and False by default).
327
+
328
+ ### Changed
329
+ - Some ouput energy property names have changed:
330
+ - 'date' => 'time_period'.
331
+ - 'converter_factor' => 'converter_factor_kwh/m3'.
332
+ - 'local_temperature' => 'temperature_degC'.
333
+
334
+ ## [0.1.27](https://github.com/ssenart/PyGazpar/compare/0.1.26...0.1.27) - 2021-04-20
335
+ ### Fixed
336
+ - [#10](https://github.com/ssenart/PyGazpar/issues/10) : Does not download data file in tmpdir as expected (instead it is downloaded in the default user Download directory). The previous attempt in version 0.1.26 is a failure. The origin of the bug is that we send a relative tmp directory path to Webdriver. Additionally, this path has to be normalized to the runtime OS (using slash or backslash).
337
+
338
+ ## [0.1.26](https://github.com/ssenart/PyGazpar/compare/0.1.25...0.1.26) - 2021-04-18
339
+ ### Fixed
340
+ - [#10](https://github.com/ssenart/PyGazpar/issues/10) : Does not download data file in tmpdir as expected (instead it is downloaded in the default user Download directory).
341
+
342
+ ### Added
343
+ - A new parameter to drive whether we want Selenium in headless mode or not (mainly for troubleshooting purpose).
344
+
345
+ ## [0.1.25] - 2021-04-15
346
+ ### Fixed
347
+ - Remove useless warning log messages (log message level has been decreased to debug).
348
+
349
+ ## [0.1.24] - 2021-04-14
350
+ ### Added
351
+ - README.md amendment (thanks to pbranly).
352
+
353
+ ## [0.1.23] - 2021-04-09
354
+ ### Changed
355
+ - Final release with CI/CD workflow improvement.
356
+
357
+ ## [0.1.22] - 2021-04-09
358
+ ### Changed
359
+ - Improve CI/CD workflow.
360
+
361
+ ## [0.1.21] - 2021-04-07
362
+ ### Changed
363
+ - Cleanup some codes managing Privacy Conditions popup.
364
+
365
+ ## [0.1.20] - 2021-04-07
366
+ ### Changed
367
+ - Close an eventual Privacy Conditions popup just before clicking the daily button (instead of Cookie banner).
368
+
369
+ ## [0.1.19] - 2021-04-06
370
+ ### Added
371
+ - Close an eventual Cookie popup just before clicking the daily button.
372
+ - Add log messages and screenshot capture around click() and send_keys() methods.
373
+
374
+ ## [0.1.18] - 2021-04-05
375
+ ### Fixed
376
+ - Typo in logger usage.
377
+
378
+ ## [0.1.17] - 2021-04-05
379
+ ### Fixed
380
+ - Logger name must be different in each instance. Using __name__ is a good practice, we can get the module hierarchy.
381
+
382
+ ## [0.1.16] - 2021-04-05
383
+ ### Fixed
384
+ - Logger 'pygazpar' initialization must be done inside the main program and not inside the library.
385
+
386
+ ## [0.1.15] - 2021-04-05
387
+ ### Added
388
+ - Many log message to help debugging if GrDF site changes something : pygazpar.log
389
+ - Take a screenshot of the corresponding page where a selenium command fails : error_screenshot.png.
390
+
391
+ ## [0.1.14] - 2020-09-23
392
+ ### Fixed
393
+ - GrDF survey popup has to be closed at the home page.
394
+ - GrDF Assistant popup may hide the Download button. We have to close it.
395
+ - GrDF bottom banner that invite to accept cookies may also hide the Download button. We have to accept it.
396
+
397
+ ### Added
398
+ - A new parameter 'lastNRows' to get only the last N most recent records.
399
+
400
+ ## [0.1.13] - 2020-06-30
401
+ ### Fixed
402
+ - GrDF data retrieval from Excel file is not limited to the 1000 first rows any more.
403
+
404
+ ## [0.1.12] - 2020-06-30
405
+ ### Fixed
406
+ - The previous 0.1.11 is not sufficient. Hence, 2 new changes : First, make configurable the waiting time so the user can adapt to its context usage.
407
+ Second, the condition on clicking on Download button is now based on the corresponding event and not anymore on its identifier.
408
+
409
+ ## [0.1.11] - 2020-06-29
410
+ ### Fixed
411
+ - When GrDF Web site is slower than usual, the client may not wait enough time for pages to load and miss to reach the data file.
412
+ It occurs with the page containing 'Jour' button which is very long to load (I increase the wait to load time from 5s to 30s).
413
+
414
+ ## [0.1.10] - 2020-06-03
415
+ ### Fixed
416
+ - Extract rows from Excel until line 1000 (instead of 365 as before).
417
+
418
+ ## [0.1.9] - 2019-08-31
419
+ ### Fixed
420
+ - WebDriver window size must be large enough to display all clickable components.
421
+
422
+ ## [0.1.8] - 2019-08-31
423
+ ### Changed
424
+ - Use PropertyNameEnum type to store all property names.
425
+
426
+ ## [0.1.7] - 2019-08-29
427
+ ### Added
428
+ - Add wait_time option to control how much time the library has to wait for Web page element to load (see https://selenium-python.readthedocs.io/waits.html for details).
429
+ - Add LoginError exception raised when PyGazpar is unable to sign in the GrDF Web site with the given username/password.
430
+ - Refactor all data property names.
431
+
432
+ ## [0.1.6] - 2019-08-26
433
+ ### Added
434
+ - Add README.md and CHANGELOG.md.
435
+ - Add Client.data() method to get the updated data.
436
+
437
+ ### Removed
438
+ - Remove Client.data property to get the updated data. Replaced with Client.__data private property.
439
+
440
+ [0.1.25]: https://github.com/ssenart/PyGazpar/compare/0.1.24...0.1.25
441
+ [0.1.24]: https://github.com/ssenart/PyGazpar/compare/0.1.23...0.1.24
442
+ [0.1.23]: https://github.com/ssenart/PyGazpar/compare/0.1.22...0.1.23
443
+ [0.1.22]: https://github.com/ssenart/PyGazpar/compare/0.1.21...0.1.22
444
+ [0.1.21]: https://github.com/ssenart/PyGazpar/compare/0.1.20...0.1.21
445
+ [0.1.20]: https://github.com/ssenart/PyGazpar/compare/0.1.19...0.1.20
446
+ [0.1.19]: https://github.com/ssenart/PyGazpar/compare/0.1.17...0.1.19
447
+ [0.1.18]: https://github.com/ssenart/PyGazpar/compare/0.1.17...0.1.18
448
+ [0.1.17]: https://github.com/ssenart/PyGazpar/compare/0.1.16...0.1.17
449
+ [0.1.16]: https://github.com/ssenart/PyGazpar/compare/0.1.15...0.1.16
450
+ [0.1.15]: https://github.com/ssenart/PyGazpar/compare/0.1.14...0.1.15
451
+ [0.1.14]: https://github.com/ssenart/PyGazpar/compare/0.1.13...0.1.14
452
+ [0.1.13]: https://github.com/ssenart/PyGazpar/compare/0.1.12...0.1.13
453
+ [0.1.12]: https://github.com/ssenart/PyGazpar/compare/0.1.11...0.1.12
454
+ [0.1.11]: https://github.com/ssenart/PyGazpar/compare/0.1.10...0.1.11
455
+ [0.1.10]: https://github.com/ssenart/PyGazpar/compare/0.1.9...0.1.10
456
+ [0.1.9]: https://github.com/ssenart/PyGazpar/compare/0.1.7...0.1.9
457
+ [0.1.8]: https://github.com/ssenart/PyGazpar/compare/0.1.7...0.1.8
458
+ [0.1.7]: https://github.com/ssenart/PyGazpar/compare/0.1.6...0.1.7
459
+ [0.1.6]: https://github.com/ssenart/PyGazpar/compare/0.1.5...0.1.6
460
+
461
+ MIT License
462
+
463
+ Copyright (c) 2019 Stéphane Senart
464
+
465
+ Permission is hereby granted, free of charge, to any person obtaining a copy
466
+ of this software and associated documentation files (the "Software"), to deal
467
+ in the Software without restriction, including without limitation the rights
468
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
469
+ copies of the Software, and to permit persons to whom the Software is
470
+ furnished to do so, subject to the following conditions:
471
+
472
+ The above copyright notice and this permission notice shall be included in all
473
+ copies or substantial portions of the Software.
474
+
475
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
476
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
477
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
478
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
479
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
480
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
481
+ SOFTWARE.
@@ -0,0 +1,27 @@
1
+ pygazpar/__init__.py,sha256=qshO_XZbDA2Wrt80ABDs0MoScqJytClAuIJjAnILglk,309
2
+ pygazpar/__main__.py,sha256=Pt3PInX7QiWcs0aBKZN90NTaU8KFnrQiZ5Hsow1eR5U,3177
3
+ pygazpar/client.py,sha256=JdVm0jZbeibwtTumcRbUSFadfXnCUClPMjL95_J6p5Y,2595
4
+ pygazpar/datasource.py,sha256=SQ6ko4ElWp9BBid-TcBo9iWiCMO4VL-_pTkGb6sCGDE,21400
5
+ pygazpar/enum.py,sha256=3ZCk4SziXF6pxgP3MuQ1qxYfqB3X5DOV8Rtd0GHsK9w,898
6
+ pygazpar/excelparser.py,sha256=A9s0A1xpIxGiqLvVd80p7ntb89Grq9-tVb46Al0xJx8,6149
7
+ pygazpar/jsonparser.py,sha256=OrRdMZNBi7rI4dRGoRW7gjyFwJFk-IvtkRZ_t1XVFrI,1859
8
+ pygazpar/version.py,sha256=CfVXm0wwlKPW0khOcwhWw61TpgtZiLijCePsAIOK3aU,22
9
+ pygazpar/resources/daily_data_sample.json,sha256=YJovtrNUMs257magTfyxiewLmecySFypcelbGFUUeT8,199583
10
+ pygazpar/resources/hourly_data_sample.json,sha256=N1F-Xz3GaBn2H1p7uKzhkhKCQV8QVR0t76XD6wmFtXA,3
11
+ pygazpar/resources/monthly_data_sample.json,sha256=yrr4SqrB2MubeVU2HX_FRDZKHIhC0LXCqkO1iqnFWcg,3351
12
+ pygazpar/resources/weekly_data_sample.json,sha256=AjNuZkZvdYUi-3A_Vho7MA50bUddVvvrZNXechodrAM,15587
13
+ pygazpar/resources/yearly_data_sample.json,sha256=-h0Oy-4yV6cfTaZ2oLjzEqPtoYxSyJ_48gQ92_rDWcw,446
14
+ samples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
+ samples/excelSample.py,sha256=ltAl-bBz9-U9YI802JpcIswra-vDS7tR_KL5VNdxJ5c,765
16
+ samples/jsonSample.py,sha256=sYAIusdEJhZdwDAMgHqoWcwDR0FA2eWhSt_2gL_mJRk,736
17
+ samples/testSample.py,sha256=UeirdEtezHwfZDv_75oxul17YzGWn5yZuHfJYTF3Ez0,387
18
+ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
+ tests/test_client.py,sha256=BFLz0GNk8qEP4d2-7cAaIcLWpkSnDZo3wRb0AlXBNOQ,5765
20
+ tests/test_datafileparser.py,sha256=nAeUpOHtelblMpmbrrnf-2GuMjK5ai65veDoymceprE,818
21
+ tests/test_datasource.py,sha256=NTeD3yQEi4fTw8ZWz2cuUUdeFC8QVjChBMw5jyqia40,6149
22
+ pygazpar-1.2.8.dist-info/LICENSE.md,sha256=XsCJx_7_BC9tvmE0ZxS1cTNR7ekurog_ea9ybdZ-8tc,1073
23
+ pygazpar-1.2.8.dist-info/METADATA,sha256=sl9nqURRaGEYNeNWnu7_izw5h2at-COvx85heMYb-ps,19455
24
+ pygazpar-1.2.8.dist-info/WHEEL,sha256=heifHQSKhqRJTk4L2t2NPjdREYCobSbslRTygvZmIJE,93
25
+ pygazpar-1.2.8.dist-info/entry_points.txt,sha256=dNJjC6RYY3FeJIe0hZL9Kcr6vKEx1qkZ71e6Slocb7I,52
26
+ pygazpar-1.2.8.dist-info/top_level.txt,sha256=P7qn-XtanDPBLQsTvjvLV71wH8RK0DYbx8tzN_rDS70,23
27
+ pygazpar-1.2.8.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (75.8.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py313-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ pygazpar = pygazpar.__main__:main
@@ -0,0 +1,3 @@
1
+ pygazpar
2
+ samples
3
+ tests
samples/__init__.py ADDED
File without changes
samples/excelSample.py ADDED
@@ -0,0 +1,31 @@
1
+ import sys
2
+ import os
3
+ import dotenv
4
+ import json
5
+ import pygazpar
6
+
7
+
8
+ def main():
9
+
10
+ # Load environment variables GRDF_USERNAME, GRDF_PASSWORD, PCE_IDENTIFIER from .env file.
11
+ dotenv.load_dotenv()
12
+
13
+ username = os.environ["GRDF_USERNAME"]
14
+ password = os.environ["GRDF_PASSWORD"]
15
+ pceIdentifier = os.environ["PCE_IDENTIFIER"]
16
+
17
+ client = pygazpar.Client(pygazpar.ExcelWebDataSource(
18
+ username=username,
19
+ password=password,
20
+ tmpDirectory="tmp")
21
+ )
22
+
23
+ data = client.loadSince(pceIdentifier=pceIdentifier,
24
+ lastNDays=60,
25
+ frequencies=[pygazpar.Frequency.DAILY, pygazpar.Frequency.MONTHLY])
26
+
27
+ print(json.dumps(data, indent=2))
28
+
29
+
30
+ if __name__ == '__main__':
31
+ sys.exit(main())
samples/jsonSample.py ADDED
@@ -0,0 +1,30 @@
1
+ import sys
2
+ import os
3
+ import dotenv
4
+ import json
5
+ import pygazpar
6
+
7
+
8
+ def main():
9
+
10
+ # Load environment variables GRDF_USERNAME, GRDF_PASSWORD, PCE_IDENTIFIER from .env file.
11
+ dotenv.load_dotenv()
12
+
13
+ username = os.environ["GRDF_USERNAME"]
14
+ password = os.environ["GRDF_PASSWORD"]
15
+ pceIdentifier = os.environ["PCE_IDENTIFIER"]
16
+
17
+ client = pygazpar.Client(pygazpar.JsonWebDataSource(
18
+ username=username,
19
+ password=password)
20
+ )
21
+
22
+ data = client.loadSince(pceIdentifier=pceIdentifier,
23
+ lastNDays=60,
24
+ frequencies=[pygazpar.Frequency.DAILY, pygazpar.Frequency.MONTHLY])
25
+
26
+ print(json.dumps(data, indent=2))
27
+
28
+
29
+ if __name__ == '__main__':
30
+ sys.exit(main())
samples/testSample.py ADDED
@@ -0,0 +1,18 @@
1
+ import sys
2
+ import json
3
+ import pygazpar
4
+
5
+
6
+ def main():
7
+
8
+ client = pygazpar.Client(pygazpar.TestDataSource())
9
+
10
+ data = client.loadSince(pceIdentifier="xxx",
11
+ lastNDays=60,
12
+ frequencies=[pygazpar.Frequency.DAILY, pygazpar.Frequency.MONTHLY])
13
+
14
+ print(json.dumps(data, indent=2))
15
+
16
+
17
+ if __name__ == '__main__':
18
+ sys.exit(main())
tests/__init__.py ADDED
File without changes