pygazpar 1.2.6__tar.gz → 1.2.7__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. pygazpar-1.2.7/CHANGELOG.md +240 -0
  2. {pygazpar-1.2.6/pygazpar.egg-info → pygazpar-1.2.7}/PKG-INFO +10 -4
  3. pygazpar-1.2.7/pygazpar/version.py +1 -0
  4. {pygazpar-1.2.6 → pygazpar-1.2.7/pygazpar.egg-info}/PKG-INFO +10 -4
  5. {pygazpar-1.2.6 → pygazpar-1.2.7}/pygazpar.egg-info/SOURCES.txt +1 -0
  6. {pygazpar-1.2.6 → pygazpar-1.2.7}/pygazpar.egg-info/entry_points.txt +0 -1
  7. {pygazpar-1.2.6 → pygazpar-1.2.7}/tests/test_client.py +159 -159
  8. {pygazpar-1.2.6 → pygazpar-1.2.7}/tests/test_datasource.py +166 -166
  9. pygazpar-1.2.6/pygazpar/version.py +0 -1
  10. {pygazpar-1.2.6 → pygazpar-1.2.7}/LICENSE.md +0 -0
  11. {pygazpar-1.2.6 → pygazpar-1.2.7}/MANIFEST.in +0 -0
  12. {pygazpar-1.2.6 → pygazpar-1.2.7}/README.md +0 -0
  13. {pygazpar-1.2.6 → pygazpar-1.2.7}/pygazpar/__init__.py +0 -0
  14. {pygazpar-1.2.6 → pygazpar-1.2.7}/pygazpar/__main__.py +0 -0
  15. {pygazpar-1.2.6 → pygazpar-1.2.7}/pygazpar/client.py +0 -0
  16. {pygazpar-1.2.6 → pygazpar-1.2.7}/pygazpar/datasource.py +0 -0
  17. {pygazpar-1.2.6 → pygazpar-1.2.7}/pygazpar/enum.py +0 -0
  18. {pygazpar-1.2.6 → pygazpar-1.2.7}/pygazpar/excelparser.py +0 -0
  19. {pygazpar-1.2.6 → pygazpar-1.2.7}/pygazpar/jsonparser.py +0 -0
  20. {pygazpar-1.2.6 → pygazpar-1.2.7}/pygazpar/resources/daily_data_sample.json +0 -0
  21. {pygazpar-1.2.6 → pygazpar-1.2.7}/pygazpar/resources/hourly_data_sample.json +0 -0
  22. {pygazpar-1.2.6 → pygazpar-1.2.7}/pygazpar/resources/monthly_data_sample.json +0 -0
  23. {pygazpar-1.2.6 → pygazpar-1.2.7}/pygazpar/resources/weekly_data_sample.json +0 -0
  24. {pygazpar-1.2.6 → pygazpar-1.2.7}/pygazpar/resources/yearly_data_sample.json +0 -0
  25. {pygazpar-1.2.6 → pygazpar-1.2.7}/pygazpar.egg-info/dependency_links.txt +0 -0
  26. {pygazpar-1.2.6 → pygazpar-1.2.7}/pygazpar.egg-info/not-zip-safe +0 -0
  27. {pygazpar-1.2.6 → pygazpar-1.2.7}/pygazpar.egg-info/requires.txt +0 -0
  28. {pygazpar-1.2.6 → pygazpar-1.2.7}/pygazpar.egg-info/top_level.txt +0 -0
  29. {pygazpar-1.2.6 → pygazpar-1.2.7}/samples/__init__.py +0 -0
  30. {pygazpar-1.2.6 → pygazpar-1.2.7}/samples/excelSample.py +0 -0
  31. {pygazpar-1.2.6 → pygazpar-1.2.7}/samples/jsonSample.py +0 -0
  32. {pygazpar-1.2.6 → pygazpar-1.2.7}/samples/testSample.py +0 -0
  33. {pygazpar-1.2.6 → pygazpar-1.2.7}/setup.cfg +0 -0
  34. {pygazpar-1.2.6 → pygazpar-1.2.7}/setup.py +0 -0
  35. {pygazpar-1.2.6 → pygazpar-1.2.7}/tests/__init__.py +0 -0
  36. {pygazpar-1.2.6 → pygazpar-1.2.7}/tests/test_datafileparser.py +0 -0
@@ -0,0 +1,240 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [1.2.7](https://github.com/ssenart/PyGazpar/compare/1.2.7...1.2.6) - 2025-01-06
8
+
9
+ ### Fixed
10
+ - [#79](https://github.com/ssenart/PyGazpar/issues/79): Fix some unittests that wrongly failed because of the new year.
11
+
12
+ ## [1.2.6](https://github.com/ssenart/PyGazpar/compare/1.2.6...1.2.5) - 2025-01-03
13
+
14
+ ### Fixed
15
+ - [#77](https://github.com/ssenart/PyGazpar/issues/77): Some error may occur while requesting data from GrDF API.
16
+
17
+ ## [1.2.5](https://github.com/ssenart/PyGazpar/compare/1.2.5...1.2.4) - 2024-12-21
18
+
19
+ ### Fixed
20
+ - [#75](https://github.com/ssenart/PyGazpar/issues/75): Fix an error when no temperature data is available.
21
+
22
+ ## [1.2.4](https://github.com/ssenart/PyGazpar/compare/1.2.4...1.2.3) - 2024-10-09
23
+
24
+ ### Fixed
25
+ - [#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]])".
26
+
27
+ ## [1.2.3](https://github.com/ssenart/PyGazpar/compare/1.2.3...1.2.1) - 2024-10-05
28
+
29
+ ### Added
30
+ - [#70](https://github.com/ssenart/PyGazpar/issues/70): Add Python 3.12 support.
31
+
32
+ ## [1.2.2](https://github.com/ssenart/PyGazpar/compare/1.2.1...1.2.2) - 2024-05-08
33
+
34
+ ### Fixed
35
+ - [#65](https://github.com/ssenart/PyGazpar/issues/65): [Bug] PermissionError happens when loading data from Excel file.
36
+
37
+ ## [1.2.1](https://github.com/ssenart/PyGazpar/compare/1.2.0...1.2.1) - 2024-05-04
38
+
39
+ ### Fixed
40
+ - [#64](https://github.com/ssenart/PyGazpar/issues/64): [Issue] Captcha failed issue.
41
+
42
+ - [#63](https://github.com/ssenart/PyGazpar/issues/63): [Bug] If the latest received consumption is Sunday, then the last weekly period is duplicated.
43
+
44
+ ## [1.2.0](https://github.com/ssenart/PyGazpar/compare/1.1.6...1.2.0) - 2022-12-16
45
+
46
+ ### Changed
47
+ - [#59](https://github.com/ssenart/PyGazpar/issues/59): [Feature] Support both Excel and Json data source format from GrDF site.
48
+
49
+ - [#60](https://github.com/ssenart/PyGazpar/issues/60): [Feature] Permit to load data at multiple frequencies with one method call.
50
+
51
+ ### Fixed
52
+ - [#47](https://github.com/ssenart/PyGazpar/issues/47): [Bug] No temperature field available.
53
+
54
+ - [#58](https://github.com/ssenart/PyGazpar/issues/58): [Issue] No data update - GrDF web site is half broken - Download button does not work anymore.
55
+
56
+ ## [1.1.6](https://github.com/ssenart/PyGazpar/compare/1.1.5...1.1.6) - 2022-11-16
57
+ ### Fixed
58
+ - [#55](https://github.com/ssenart/PyGazpar/issues/55): Problème de connexion.
59
+
60
+ ## [1.1.5](https://github.com/ssenart/PyGazpar/compare/1.1.4...1.1.5) - 2022-07-11
61
+ ### Fixed
62
+ - [#49](https://github.com/ssenart/PyGazpar/issues/49): Authentication failure.
63
+
64
+ ## [1.1.4](https://github.com/ssenart/PyGazpar/compare/1.1.2...1.1.4) - 2022-01-18
65
+ ### Changed
66
+ - [#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.
67
+
68
+ ## [1.1.2](https://github.com/ssenart/PyGazpar/compare/1.1.1...1.1.2) - 2022-01-08
69
+ ### Fixed
70
+ - [#39](https://github.com/ssenart/PyGazpar/issues/39): NameError: name 'Frequency' is not defined (thanks [nicolas-r](https://github.com/nicolas-r)).
71
+ - 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)).
72
+
73
+ ## [1.1.1](https://github.com/ssenart/PyGazpar/compare/1.1.0...1.1.1) - 2021-12-02
74
+ ### Changed
75
+ - Exact same version as 1.1.0 except that 1.1.0 has not been published on Pypi repository.
76
+
77
+ ## [1.1.0](https://github.com/ssenart/PyGazpar/compare/1.0.2...1.1.0) - 2021-12-02
78
+ ### Changed
79
+ - Remove Selenium usage and use simple Web request for login and data retrieval.
80
+
81
+ ## [1.0.2](https://github.com/ssenart/PyGazpar/compare/1.0.1...1.0.2) - 2021-11-25
82
+ ### Fixed
83
+ - Fix broken command line pygazpar caused by adding the new lastNDays parameter.
84
+ - 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).
85
+
86
+ ### Changed
87
+ - 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).
88
+
89
+ ## [1.0.1](https://github.com/ssenart/PyGazpar/compare/1.0.0...1.0.1) - 2021-11-24
90
+ ### Fixed
91
+ - Fix typo warning from Pylance preventing 1.0.0 to be published.
92
+
93
+ ## [1.0.0](https://github.com/ssenart/PyGazpar/compare/0.2.0...1.0.0) - 2021-11-24
94
+ ### Added
95
+ - New lastNDays parameter to query data only over the last N days period.
96
+
97
+ ### Fixed
98
+ - [#18](https://github.com/ssenart/PyGazpar/issues/18): PyGazpar broken since GRDF Monespace has been upgraded to a new version.
99
+
100
+ ## [0.2.0](https://github.com/ssenart/PyGazpar/compare/0.1.27...0.2.0) - 2021-04-21
101
+ ### Added
102
+ - [#12](https://github.com/ssenart/PyGazpar/issues/10): Be able to retrieve consumption not only on a daily basis, but weekly and monthly:
103
+ - API : Add a new parameter 'meterReadingFrequency' to Client that accepts enumeration: Frequency.DAILY, Frequency.WEEKLY or Frequency.MONTHLY.
104
+ - Command line : Add a new argument '--frequency' that accepts values : DAILY, WEEKLY or MONTHLY.
105
+ - Be able to test using offline data :
106
+ - 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).
107
+ - Command line : Add a new argument '--testMode' (True if specified and False by default).
108
+
109
+ ### Changed
110
+ - Some ouput energy property names have changed:
111
+ - 'date' => 'time_period'.
112
+ - 'converter_factor' => 'converter_factor_kwh/m3'.
113
+ - 'local_temperature' => 'temperature_degC'.
114
+
115
+ ## [0.1.27](https://github.com/ssenart/PyGazpar/compare/0.1.26...0.1.27) - 2021-04-20
116
+ ### Fixed
117
+ - [#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).
118
+
119
+ ## [0.1.26](https://github.com/ssenart/PyGazpar/compare/0.1.25...0.1.26) - 2021-04-18
120
+ ### Fixed
121
+ - [#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).
122
+
123
+ ### Added
124
+ - A new parameter to drive whether we want Selenium in headless mode or not (mainly for troubleshooting purpose).
125
+
126
+ ## [0.1.25] - 2021-04-15
127
+ ### Fixed
128
+ - Remove useless warning log messages (log message level has been decreased to debug).
129
+
130
+ ## [0.1.24] - 2021-04-14
131
+ ### Added
132
+ - README.md amendment (thanks to pbranly).
133
+
134
+ ## [0.1.23] - 2021-04-09
135
+ ### Changed
136
+ - Final release with CI/CD workflow improvement.
137
+
138
+ ## [0.1.22] - 2021-04-09
139
+ ### Changed
140
+ - Improve CI/CD workflow.
141
+
142
+ ## [0.1.21] - 2021-04-07
143
+ ### Changed
144
+ - Cleanup some codes managing Privacy Conditions popup.
145
+
146
+ ## [0.1.20] - 2021-04-07
147
+ ### Changed
148
+ - Close an eventual Privacy Conditions popup just before clicking the daily button (instead of Cookie banner).
149
+
150
+ ## [0.1.19] - 2021-04-06
151
+ ### Added
152
+ - Close an eventual Cookie popup just before clicking the daily button.
153
+ - Add log messages and screenshot capture around click() and send_keys() methods.
154
+
155
+ ## [0.1.18] - 2021-04-05
156
+ ### Fixed
157
+ - Typo in logger usage.
158
+
159
+ ## [0.1.17] - 2021-04-05
160
+ ### Fixed
161
+ - Logger name must be different in each instance. Using __name__ is a good practice, we can get the module hierarchy.
162
+
163
+ ## [0.1.16] - 2021-04-05
164
+ ### Fixed
165
+ - Logger 'pygazpar' initialization must be done inside the main program and not inside the library.
166
+
167
+ ## [0.1.15] - 2021-04-05
168
+ ### Added
169
+ - Many log message to help debugging if GrDF site changes something : pygazpar.log
170
+ - Take a screenshot of the corresponding page where a selenium command fails : error_screenshot.png.
171
+
172
+ ## [0.1.14] - 2020-09-23
173
+ ### Fixed
174
+ - GrDF survey popup has to be closed at the home page.
175
+ - GrDF Assistant popup may hide the Download button. We have to close it.
176
+ - GrDF bottom banner that invite to accept cookies may also hide the Download button. We have to accept it.
177
+
178
+ ### Added
179
+ - A new parameter 'lastNRows' to get only the last N most recent records.
180
+
181
+ ## [0.1.13] - 2020-06-30
182
+ ### Fixed
183
+ - GrDF data retrieval from Excel file is not limited to the 1000 first rows any more.
184
+
185
+ ## [0.1.12] - 2020-06-30
186
+ ### Fixed
187
+ - 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.
188
+ Second, the condition on clicking on Download button is now based on the corresponding event and not anymore on its identifier.
189
+
190
+ ## [0.1.11] - 2020-06-29
191
+ ### Fixed
192
+ - 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.
193
+ 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).
194
+
195
+ ## [0.1.10] - 2020-06-03
196
+ ### Fixed
197
+ - Extract rows from Excel until line 1000 (instead of 365 as before).
198
+
199
+ ## [0.1.9] - 2019-08-31
200
+ ### Fixed
201
+ - WebDriver window size must be large enough to display all clickable components.
202
+
203
+ ## [0.1.8] - 2019-08-31
204
+ ### Changed
205
+ - Use PropertyNameEnum type to store all property names.
206
+
207
+ ## [0.1.7] - 2019-08-29
208
+ ### Added
209
+ - 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).
210
+ - Add LoginError exception raised when PyGazpar is unable to sign in the GrDF Web site with the given username/password.
211
+ - Refactor all data property names.
212
+
213
+ ## [0.1.6] - 2019-08-26
214
+ ### Added
215
+ - Add README.md and CHANGELOG.md.
216
+ - Add Client.data() method to get the updated data.
217
+
218
+ ### Removed
219
+ - Remove Client.data property to get the updated data. Replaced with Client.__data private property.
220
+
221
+ [0.1.25]: https://github.com/ssenart/PyGazpar/compare/0.1.24...0.1.25
222
+ [0.1.24]: https://github.com/ssenart/PyGazpar/compare/0.1.23...0.1.24
223
+ [0.1.23]: https://github.com/ssenart/PyGazpar/compare/0.1.22...0.1.23
224
+ [0.1.22]: https://github.com/ssenart/PyGazpar/compare/0.1.21...0.1.22
225
+ [0.1.21]: https://github.com/ssenart/PyGazpar/compare/0.1.20...0.1.21
226
+ [0.1.20]: https://github.com/ssenart/PyGazpar/compare/0.1.19...0.1.20
227
+ [0.1.19]: https://github.com/ssenart/PyGazpar/compare/0.1.17...0.1.19
228
+ [0.1.18]: https://github.com/ssenart/PyGazpar/compare/0.1.17...0.1.18
229
+ [0.1.17]: https://github.com/ssenart/PyGazpar/compare/0.1.16...0.1.17
230
+ [0.1.16]: https://github.com/ssenart/PyGazpar/compare/0.1.15...0.1.16
231
+ [0.1.15]: https://github.com/ssenart/PyGazpar/compare/0.1.14...0.1.15
232
+ [0.1.14]: https://github.com/ssenart/PyGazpar/compare/0.1.13...0.1.14
233
+ [0.1.13]: https://github.com/ssenart/PyGazpar/compare/0.1.12...0.1.13
234
+ [0.1.12]: https://github.com/ssenart/PyGazpar/compare/0.1.11...0.1.12
235
+ [0.1.11]: https://github.com/ssenart/PyGazpar/compare/0.1.10...0.1.11
236
+ [0.1.10]: https://github.com/ssenart/PyGazpar/compare/0.1.9...0.1.10
237
+ [0.1.9]: https://github.com/ssenart/PyGazpar/compare/0.1.7...0.1.9
238
+ [0.1.8]: https://github.com/ssenart/PyGazpar/compare/0.1.7...0.1.8
239
+ [0.1.7]: https://github.com/ssenart/PyGazpar/compare/0.1.6...0.1.7
240
+ [0.1.6]: https://github.com/ssenart/PyGazpar/compare/0.1.5...0.1.6
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pygazpar
3
- Version: 1.2.6
3
+ Version: 1.2.7
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
6
7
  Author: Stephane Senart
7
8
  Author-email: stephane.senart@gmail.com
8
9
  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
@@ -26,6 +26,9 @@ Classifier: Programming Language :: Python :: 3.12
26
26
  Requires-Python: >=3.7
27
27
  Description-Content-Type: text/markdown
28
28
  License-File: LICENSE.md
29
+ Requires-Dist: openpyxl>=2.6.3
30
+ Requires-Dist: requests>=2.26.0
31
+ Requires-Dist: pandas
29
32
 
30
33
  # PyGazpar
31
34
 
@@ -215,6 +218,11 @@ All notable changes to this project will be documented in this file.
215
218
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
216
219
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
217
220
 
221
+ ## [1.2.7](https://github.com/ssenart/PyGazpar/compare/1.2.7...1.2.6) - 2025-01-06
222
+
223
+ ### Fixed
224
+ - [#79](https://github.com/ssenart/PyGazpar/issues/79): Fix some unittests that wrongly failed because of the new year.
225
+
218
226
  ## [1.2.6](https://github.com/ssenart/PyGazpar/compare/1.2.6...1.2.5) - 2025-01-03
219
227
 
220
228
  ### Fixed
@@ -466,5 +474,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
466
474
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
467
475
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
468
476
  SOFTWARE.
469
-
470
-
@@ -0,0 +1 @@
1
+ __version__ = "1.2.7"
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pygazpar
3
- Version: 1.2.6
3
+ Version: 1.2.7
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
6
7
  Author: Stephane Senart
7
8
  Author-email: stephane.senart@gmail.com
8
9
  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
@@ -26,6 +26,9 @@ Classifier: Programming Language :: Python :: 3.12
26
26
  Requires-Python: >=3.7
27
27
  Description-Content-Type: text/markdown
28
28
  License-File: LICENSE.md
29
+ Requires-Dist: openpyxl>=2.6.3
30
+ Requires-Dist: requests>=2.26.0
31
+ Requires-Dist: pandas
29
32
 
30
33
  # PyGazpar
31
34
 
@@ -215,6 +218,11 @@ All notable changes to this project will be documented in this file.
215
218
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
216
219
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
217
220
 
221
+ ## [1.2.7](https://github.com/ssenart/PyGazpar/compare/1.2.7...1.2.6) - 2025-01-06
222
+
223
+ ### Fixed
224
+ - [#79](https://github.com/ssenart/PyGazpar/issues/79): Fix some unittests that wrongly failed because of the new year.
225
+
218
226
  ## [1.2.6](https://github.com/ssenart/PyGazpar/compare/1.2.6...1.2.5) - 2025-01-03
219
227
 
220
228
  ### Fixed
@@ -466,5 +474,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
466
474
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
467
475
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
468
476
  SOFTWARE.
469
-
470
-
@@ -1,3 +1,4 @@
1
+ CHANGELOG.md
1
2
  LICENSE.md
2
3
  MANIFEST.in
3
4
  README.md
@@ -1,3 +1,2 @@
1
1
  [console_scripts]
2
2
  pygazpar = pygazpar.__main__:main
3
-
@@ -1,159 +1,159 @@
1
- from pygazpar.enum import Frequency
2
- from pygazpar.client import Client
3
- from pygazpar.datasource import JsonWebDataSource, TestDataSource, ExcelWebDataSource
4
- import os
5
- import pytest
6
-
7
-
8
- class TestClient:
9
-
10
- @classmethod
11
- def setup_class(cls):
12
- """ setup any state specific to the execution of the given class (which
13
- usually contains tests).
14
- """
15
-
16
- @classmethod
17
- def teardown_class(cls):
18
- """ teardown any state that was previously setup with a call to
19
- setup_class.
20
- """
21
-
22
- def setup_method(self):
23
- """ setup any state tied to the execution of the given method in a
24
- class. setup_method is invoked for every test method of a class.
25
- """
26
- tmpdir = os.path.normpath(f"{os.getcwd()}/tmp")
27
-
28
- # We create the tmp directory if not already exists.
29
- if not os.path.exists(tmpdir):
30
- os.mkdir(tmpdir)
31
-
32
- self.__username = os.environ["GRDF_USERNAME"]
33
- self.__password = os.environ["GRDF_PASSWORD"]
34
- self.__pceIdentifier = os.environ["PCE_IDENTIFIER"]
35
- self.__tmp_directory = tmpdir
36
-
37
- def teardown_method(self):
38
- """ teardown any state that was previously setup with a setup_method
39
- call.
40
- """
41
-
42
- def test_login_error(self):
43
- client = Client(JsonWebDataSource("WrongUsername", "WrongPassword"))
44
-
45
- with pytest.raises(Exception):
46
- client.loadSince(self.__pceIdentifier, 365, [Frequency.DAILY])
47
-
48
- def test_hourly_live(self):
49
- client = Client(JsonWebDataSource(self.__username, self.__password))
50
-
51
- data = client.loadSince(self.__pceIdentifier, 365, [Frequency.HOURLY])
52
-
53
- assert (len(data[Frequency.HOURLY.value]) == 0)
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
-
69
- # @pytest.mark.skip(reason="Requires live data")
70
- def test_daily_jsonweb(self):
71
- client = Client(JsonWebDataSource(self.__username, self.__password))
72
-
73
- data = client.loadSince(self.__pceIdentifier, 365, [Frequency.DAILY])
74
-
75
- assert (len(data[Frequency.DAILY.value]) > 0)
76
-
77
- def test_weekly_jsonweb(self):
78
- client = Client(JsonWebDataSource(self.__username, self.__password))
79
-
80
- data = client.loadSince(self.__pceIdentifier, 365, [Frequency.WEEKLY])
81
-
82
- assert (len(data[Frequency.WEEKLY.value]) >= 51 and len(data[Frequency.WEEKLY.value]) <= 54)
83
-
84
- def test_monthly_jsonweb(self):
85
- client = Client(JsonWebDataSource(self.__username, self.__password))
86
-
87
- data = client.loadSince(self.__pceIdentifier, 365, [Frequency.MONTHLY])
88
-
89
- assert (len(data[Frequency.MONTHLY.value]) >= 11 and len(data[Frequency.MONTHLY.value]) <= 13)
90
-
91
- def test_yearly_jsonweb(self):
92
- client = Client(JsonWebDataSource(self.__username, self.__password))
93
-
94
- data = client.loadSince(self.__pceIdentifier, 365, [Frequency.YEARLY])
95
-
96
- assert (len(data[Frequency.YEARLY.value]) == 1)
97
-
98
- def test_daily_excelweb(self):
99
- client = Client(ExcelWebDataSource(self.__username, self.__password, self.__tmp_directory))
100
-
101
- data = client.loadSince(self.__pceIdentifier, 365, [Frequency.DAILY])
102
-
103
- assert (len(data[Frequency.DAILY.value]) > 0)
104
-
105
- def test_weekly_excelweb(self):
106
- client = Client(ExcelWebDataSource(self.__username, self.__password, self.__tmp_directory))
107
-
108
- data = client.loadSince(self.__pceIdentifier, 365, [Frequency.WEEKLY])
109
-
110
- assert (len(data[Frequency.WEEKLY.value]) >= 51 and len(data[Frequency.WEEKLY.value]) <= 54)
111
-
112
- def test_monthly_excelweb(self):
113
- client = Client(ExcelWebDataSource(self.__username, self.__password, self.__tmp_directory))
114
-
115
- data = client.loadSince(self.__pceIdentifier, 365, [Frequency.MONTHLY])
116
-
117
- assert (len(data[Frequency.MONTHLY.value]) >= 12 and len(data[Frequency.MONTHLY.value]) <= 13)
118
-
119
- def test_yearly_excelweb(self):
120
- client = Client(ExcelWebDataSource(self.__username, self.__password, self.__tmp_directory))
121
-
122
- data = client.loadSince(self.__pceIdentifier, 365, [Frequency.YEARLY])
123
-
124
- assert (len(data[Frequency.YEARLY.value]) == 1)
125
-
126
- def test_hourly_sample(self):
127
- client = Client(TestDataSource())
128
-
129
- data = client.loadSince(self.__pceIdentifier, 365, [Frequency.HOURLY])
130
-
131
- assert (len(data[Frequency.HOURLY.value]) == 0)
132
-
133
- def test_daily_sample(self):
134
- client = Client(TestDataSource())
135
-
136
- data = client.loadSince(self.__pceIdentifier, 365, [Frequency.DAILY])
137
-
138
- assert (len(data[Frequency.DAILY.value]) == 711)
139
-
140
- def test_weekly_sample(self):
141
- client = Client(TestDataSource())
142
-
143
- data = client.loadSince(self.__pceIdentifier, 365, [Frequency.WEEKLY])
144
-
145
- assert (len(data[Frequency.WEEKLY.value]) > 0)
146
-
147
- def test_monthly_sample(self):
148
- client = Client(TestDataSource())
149
-
150
- data = client.loadSince(self.__pceIdentifier, 365, [Frequency.MONTHLY])
151
-
152
- assert (len(data[Frequency.MONTHLY.value]) > 0)
153
-
154
- def test_yearly_sample(self):
155
- client = Client(TestDataSource())
156
-
157
- data = client.loadSince(self.__pceIdentifier, 365, [Frequency.YEARLY])
158
-
159
- assert (len(data[Frequency.YEARLY.value]) == 2)
1
+ from pygazpar.enum import Frequency
2
+ from pygazpar.client import Client
3
+ from pygazpar.datasource import JsonWebDataSource, TestDataSource, ExcelWebDataSource
4
+ import os
5
+ import pytest
6
+
7
+
8
+ class TestClient:
9
+
10
+ @classmethod
11
+ def setup_class(cls):
12
+ """ setup any state specific to the execution of the given class (which
13
+ usually contains tests).
14
+ """
15
+
16
+ @classmethod
17
+ def teardown_class(cls):
18
+ """ teardown any state that was previously setup with a call to
19
+ setup_class.
20
+ """
21
+
22
+ def setup_method(self):
23
+ """ setup any state tied to the execution of the given method in a
24
+ class. setup_method is invoked for every test method of a class.
25
+ """
26
+ tmpdir = os.path.normpath(f"{os.getcwd()}/tmp")
27
+
28
+ # We create the tmp directory if not already exists.
29
+ if not os.path.exists(tmpdir):
30
+ os.mkdir(tmpdir)
31
+
32
+ self.__username = os.environ["GRDF_USERNAME"]
33
+ self.__password = os.environ["GRDF_PASSWORD"]
34
+ self.__pceIdentifier = os.environ["PCE_IDENTIFIER"]
35
+ self.__tmp_directory = tmpdir
36
+
37
+ def teardown_method(self):
38
+ """ teardown any state that was previously setup with a setup_method
39
+ call.
40
+ """
41
+
42
+ def test_login_error(self):
43
+ client = Client(JsonWebDataSource("WrongUsername", "WrongPassword"))
44
+
45
+ with pytest.raises(Exception):
46
+ client.loadSince(self.__pceIdentifier, 365, [Frequency.DAILY])
47
+
48
+ def test_hourly_live(self):
49
+ client = Client(JsonWebDataSource(self.__username, self.__password))
50
+
51
+ data = client.loadSince(self.__pceIdentifier, 365, [Frequency.HOURLY])
52
+
53
+ assert (len(data[Frequency.HOURLY.value]) == 0)
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
+
69
+ # @pytest.mark.skip(reason="Requires live data")
70
+ def test_daily_jsonweb(self):
71
+ client = Client(JsonWebDataSource(self.__username, self.__password))
72
+
73
+ data = client.loadSince(self.__pceIdentifier, 365, [Frequency.DAILY])
74
+
75
+ assert (len(data[Frequency.DAILY.value]) > 0)
76
+
77
+ def test_weekly_jsonweb(self):
78
+ client = Client(JsonWebDataSource(self.__username, self.__password))
79
+
80
+ data = client.loadSince(self.__pceIdentifier, 365, [Frequency.WEEKLY])
81
+
82
+ assert (len(data[Frequency.WEEKLY.value]) >= 51 and len(data[Frequency.WEEKLY.value]) <= 54)
83
+
84
+ def test_monthly_jsonweb(self):
85
+ client = Client(JsonWebDataSource(self.__username, self.__password))
86
+
87
+ data = client.loadSince(self.__pceIdentifier, 365, [Frequency.MONTHLY])
88
+
89
+ assert (len(data[Frequency.MONTHLY.value]) >= 11 and len(data[Frequency.MONTHLY.value]) <= 13)
90
+
91
+ def test_yearly_jsonweb(self):
92
+ client = Client(JsonWebDataSource(self.__username, self.__password))
93
+
94
+ data = client.loadSince(self.__pceIdentifier, 365, [Frequency.YEARLY])
95
+
96
+ assert (len(data[Frequency.YEARLY.value]) >= 1)
97
+
98
+ def test_daily_excelweb(self):
99
+ client = Client(ExcelWebDataSource(self.__username, self.__password, self.__tmp_directory))
100
+
101
+ data = client.loadSince(self.__pceIdentifier, 365, [Frequency.DAILY])
102
+
103
+ assert (len(data[Frequency.DAILY.value]) > 0)
104
+
105
+ def test_weekly_excelweb(self):
106
+ client = Client(ExcelWebDataSource(self.__username, self.__password, self.__tmp_directory))
107
+
108
+ data = client.loadSince(self.__pceIdentifier, 365, [Frequency.WEEKLY])
109
+
110
+ assert (len(data[Frequency.WEEKLY.value]) >= 51 and len(data[Frequency.WEEKLY.value]) <= 54)
111
+
112
+ def test_monthly_excelweb(self):
113
+ client = Client(ExcelWebDataSource(self.__username, self.__password, self.__tmp_directory))
114
+
115
+ data = client.loadSince(self.__pceIdentifier, 365, [Frequency.MONTHLY])
116
+
117
+ assert (len(data[Frequency.MONTHLY.value]) >= 12 and len(data[Frequency.MONTHLY.value]) <= 13)
118
+
119
+ def test_yearly_excelweb(self):
120
+ client = Client(ExcelWebDataSource(self.__username, self.__password, self.__tmp_directory))
121
+
122
+ data = client.loadSince(self.__pceIdentifier, 365, [Frequency.YEARLY])
123
+
124
+ assert (len(data[Frequency.YEARLY.value]) >= 1)
125
+
126
+ def test_hourly_sample(self):
127
+ client = Client(TestDataSource())
128
+
129
+ data = client.loadSince(self.__pceIdentifier, 365, [Frequency.HOURLY])
130
+
131
+ assert (len(data[Frequency.HOURLY.value]) == 0)
132
+
133
+ def test_daily_sample(self):
134
+ client = Client(TestDataSource())
135
+
136
+ data = client.loadSince(self.__pceIdentifier, 365, [Frequency.DAILY])
137
+
138
+ assert (len(data[Frequency.DAILY.value]) == 711)
139
+
140
+ def test_weekly_sample(self):
141
+ client = Client(TestDataSource())
142
+
143
+ data = client.loadSince(self.__pceIdentifier, 365, [Frequency.WEEKLY])
144
+
145
+ assert (len(data[Frequency.WEEKLY.value]) > 0)
146
+
147
+ def test_monthly_sample(self):
148
+ client = Client(TestDataSource())
149
+
150
+ data = client.loadSince(self.__pceIdentifier, 365, [Frequency.MONTHLY])
151
+
152
+ assert (len(data[Frequency.MONTHLY.value]) > 0)
153
+
154
+ def test_yearly_sample(self):
155
+ client = Client(TestDataSource())
156
+
157
+ data = client.loadSince(self.__pceIdentifier, 365, [Frequency.YEARLY])
158
+
159
+ assert (len(data[Frequency.YEARLY.value]) == 2)
@@ -1,166 +1,166 @@
1
- import os
2
- from pygazpar.datasource import TestDataSource, JsonFileDataSource, ExcelFileDataSource, JsonWebDataSource, ExcelWebDataSource
3
- from pygazpar.enum import Frequency
4
- from datetime import date, timedelta
5
- from dotenv import load_dotenv
6
-
7
-
8
- class TestAllDataSource:
9
-
10
- # ------------------------------------------------------
11
- @classmethod
12
- def setup_class(cls):
13
- """ setup any state specific to the execution of the given class (which
14
- usually contains tests).
15
- """
16
-
17
- # ------------------------------------------------------
18
- @classmethod
19
- def teardown_class(cls):
20
- """ teardown any state that was previously setup with a call to
21
- setup_class.
22
- """
23
-
24
- # ------------------------------------------------------
25
- def setup_method(self):
26
- """ setup any state tied to the execution of the given method in a
27
- class. setup_method is invoked for every test method of a class.
28
- """
29
- tmpdir = os.path.normpath(f"{os.getcwd()}/tmp")
30
-
31
- # We create the tmp directory if not already exists.
32
- if not os.path.exists(tmpdir):
33
- os.mkdir(tmpdir)
34
-
35
- load_dotenv()
36
-
37
- self.__username = os.environ["GRDF_USERNAME"]
38
- self.__password = os.environ["GRDF_PASSWORD"]
39
- self.__pceIdentifier = os.environ["PCE_IDENTIFIER"]
40
- self.__tmp_directory = tmpdir
41
-
42
- # ------------------------------------------------------
43
- def teardown_method(self):
44
- """ teardown any state that was previously setup with a setup_method
45
- call.
46
- """
47
-
48
- # ------------------------------------------------------
49
- def test_sample(self):
50
-
51
- dataSource = TestDataSource()
52
-
53
- endDate = date.today()
54
- startDate = endDate + timedelta(days=-365)
55
-
56
- data = dataSource.load(self.__pceIdentifier, startDate, endDate)
57
-
58
- assert (len(data[Frequency.DAILY.value]) == 711)
59
-
60
- assert (len(data[Frequency.WEEKLY.value]) == 102)
61
-
62
- assert (len(data[Frequency.MONTHLY.value]) == 24)
63
-
64
- assert (len(data[Frequency.YEARLY.value]) == 2)
65
-
66
- # ------------------------------------------------------
67
- def test_jsonfile_sample(self):
68
-
69
- dataSource = JsonFileDataSource("tests/resources/donnees_informatives.json", "tests/resources/temperatures.json")
70
-
71
- endDate = date.today()
72
- startDate = endDate + timedelta(days=-365)
73
-
74
- data = dataSource.load(self.__pceIdentifier, startDate, endDate, [Frequency.DAILY, Frequency.WEEKLY, Frequency.MONTHLY, Frequency.YEARLY])
75
-
76
- assert (len(data[Frequency.DAILY.value]) == 1096)
77
-
78
- assert (len(data[Frequency.WEEKLY.value]) == 155)
79
-
80
- assert (len(data[Frequency.MONTHLY.value]) == 36)
81
-
82
- assert (len(data[Frequency.YEARLY.value]) == 3)
83
-
84
- # ------------------------------------------------------
85
- def test_daily_excelfile_sample(self):
86
-
87
- dataSource = ExcelFileDataSource("tests/resources/Donnees_informatives_PCE_DAILY.xlsx")
88
-
89
- endDate = date.today()
90
- startDate = endDate + timedelta(days=-365)
91
-
92
- data = dataSource.load(self.__pceIdentifier, startDate, endDate, [Frequency.DAILY])
93
-
94
- assert (len(data[Frequency.DAILY.value]) == 363)
95
-
96
- # ------------------------------------------------------
97
- def test_weekly_excelfile_sample(self):
98
-
99
- dataSource = ExcelFileDataSource("tests/resources/Donnees_informatives_PCE_WEEKLY.xlsx")
100
-
101
- endDate = date.today()
102
- startDate = endDate + timedelta(days=-365)
103
-
104
- data = dataSource.load(self.__pceIdentifier, startDate, endDate, [Frequency.WEEKLY])
105
-
106
- assert (len(data[Frequency.WEEKLY.value]) == 53)
107
-
108
- # ------------------------------------------------------
109
- def test_monthly_excelfile_sample(self):
110
-
111
- dataSource = ExcelFileDataSource("tests/resources/Donnees_informatives_PCE_MONTHLY.xlsx")
112
-
113
- endDate = date.today()
114
- startDate = endDate + timedelta(days=-365)
115
-
116
- data = dataSource.load(self.__pceIdentifier, startDate, endDate, [Frequency.MONTHLY])
117
-
118
- assert (len(data[Frequency.MONTHLY.value]) == 13)
119
-
120
- # ------------------------------------------------------
121
- def test_yearly_excelfile_sample(self):
122
-
123
- dataSource = ExcelFileDataSource("tests/resources/Donnees_informatives_PCE_DAILY.xlsx")
124
-
125
- endDate = date.today()
126
- startDate = endDate + timedelta(days=-365)
127
-
128
- data = dataSource.load(self.__pceIdentifier, startDate, endDate, [Frequency.YEARLY])
129
-
130
- assert (len(data[Frequency.YEARLY.value]) == 1)
131
-
132
- # ------------------------------------------------------
133
- def test_jsonweb(self):
134
-
135
- dataSource = JsonWebDataSource(self.__username, self.__password)
136
-
137
- endDate = date.today()
138
- startDate = endDate + timedelta(days=-365)
139
-
140
- data = dataSource.load(self.__pceIdentifier, startDate, endDate, [Frequency.DAILY, Frequency.WEEKLY, Frequency.MONTHLY, Frequency.YEARLY])
141
-
142
- assert (len(data[Frequency.DAILY.value]) > 0)
143
-
144
- assert (len(data[Frequency.WEEKLY.value]) >= 51 and len(data[Frequency.WEEKLY.value]) <= 54)
145
-
146
- assert (len(data[Frequency.MONTHLY.value]) >= 11 and len(data[Frequency.MONTHLY.value]) <= 13)
147
-
148
- assert (len(data[Frequency.YEARLY.value]) == 1)
149
-
150
- # ------------------------------------------------------
151
- def test_excelweb(self):
152
-
153
- dataSource = ExcelWebDataSource(self.__username, self.__password, self.__tmp_directory)
154
-
155
- endDate = date.today()
156
- startDate = endDate + timedelta(days=-365)
157
-
158
- data = dataSource.load(self.__pceIdentifier, startDate, endDate, [Frequency.DAILY, Frequency.WEEKLY, Frequency.MONTHLY, Frequency.YEARLY])
159
-
160
- assert (len(data[Frequency.DAILY.value]) > 0)
161
-
162
- assert (len(data[Frequency.WEEKLY.value]) >= 51 and len(data[Frequency.WEEKLY.value]) <= 54)
163
-
164
- assert (len(data[Frequency.MONTHLY.value]) >= 12 and len(data[Frequency.MONTHLY.value]) <= 13)
165
-
166
- assert (len(data[Frequency.YEARLY.value]) == 1)
1
+ import os
2
+ from pygazpar.datasource import TestDataSource, JsonFileDataSource, ExcelFileDataSource, JsonWebDataSource, ExcelWebDataSource
3
+ from pygazpar.enum import Frequency
4
+ from datetime import date, timedelta
5
+ from dotenv import load_dotenv
6
+
7
+
8
+ class TestAllDataSource:
9
+
10
+ # ------------------------------------------------------
11
+ @classmethod
12
+ def setup_class(cls):
13
+ """ setup any state specific to the execution of the given class (which
14
+ usually contains tests).
15
+ """
16
+
17
+ # ------------------------------------------------------
18
+ @classmethod
19
+ def teardown_class(cls):
20
+ """ teardown any state that was previously setup with a call to
21
+ setup_class.
22
+ """
23
+
24
+ # ------------------------------------------------------
25
+ def setup_method(self):
26
+ """ setup any state tied to the execution of the given method in a
27
+ class. setup_method is invoked for every test method of a class.
28
+ """
29
+ tmpdir = os.path.normpath(f"{os.getcwd()}/tmp")
30
+
31
+ # We create the tmp directory if not already exists.
32
+ if not os.path.exists(tmpdir):
33
+ os.mkdir(tmpdir)
34
+
35
+ load_dotenv()
36
+
37
+ self.__username = os.environ["GRDF_USERNAME"]
38
+ self.__password = os.environ["GRDF_PASSWORD"]
39
+ self.__pceIdentifier = os.environ["PCE_IDENTIFIER"]
40
+ self.__tmp_directory = tmpdir
41
+
42
+ # ------------------------------------------------------
43
+ def teardown_method(self):
44
+ """ teardown any state that was previously setup with a setup_method
45
+ call.
46
+ """
47
+
48
+ # ------------------------------------------------------
49
+ def test_sample(self):
50
+
51
+ dataSource = TestDataSource()
52
+
53
+ endDate = date.today()
54
+ startDate = endDate + timedelta(days=-365)
55
+
56
+ data = dataSource.load(self.__pceIdentifier, startDate, endDate)
57
+
58
+ assert (len(data[Frequency.DAILY.value]) == 711)
59
+
60
+ assert (len(data[Frequency.WEEKLY.value]) == 102)
61
+
62
+ assert (len(data[Frequency.MONTHLY.value]) == 24)
63
+
64
+ assert (len(data[Frequency.YEARLY.value]) == 2)
65
+
66
+ # ------------------------------------------------------
67
+ def test_jsonfile_sample(self):
68
+
69
+ dataSource = JsonFileDataSource("tests/resources/donnees_informatives.json", "tests/resources/temperatures.json")
70
+
71
+ endDate = date.today()
72
+ startDate = endDate + timedelta(days=-365)
73
+
74
+ data = dataSource.load(self.__pceIdentifier, startDate, endDate, [Frequency.DAILY, Frequency.WEEKLY, Frequency.MONTHLY, Frequency.YEARLY])
75
+
76
+ assert (len(data[Frequency.DAILY.value]) == 1096)
77
+
78
+ assert (len(data[Frequency.WEEKLY.value]) == 155)
79
+
80
+ assert (len(data[Frequency.MONTHLY.value]) == 36)
81
+
82
+ assert (len(data[Frequency.YEARLY.value]) == 3)
83
+
84
+ # ------------------------------------------------------
85
+ def test_daily_excelfile_sample(self):
86
+
87
+ dataSource = ExcelFileDataSource("tests/resources/Donnees_informatives_PCE_DAILY.xlsx")
88
+
89
+ endDate = date.today()
90
+ startDate = endDate + timedelta(days=-365)
91
+
92
+ data = dataSource.load(self.__pceIdentifier, startDate, endDate, [Frequency.DAILY])
93
+
94
+ assert (len(data[Frequency.DAILY.value]) == 363)
95
+
96
+ # ------------------------------------------------------
97
+ def test_weekly_excelfile_sample(self):
98
+
99
+ dataSource = ExcelFileDataSource("tests/resources/Donnees_informatives_PCE_WEEKLY.xlsx")
100
+
101
+ endDate = date.today()
102
+ startDate = endDate + timedelta(days=-365)
103
+
104
+ data = dataSource.load(self.__pceIdentifier, startDate, endDate, [Frequency.WEEKLY])
105
+
106
+ assert (len(data[Frequency.WEEKLY.value]) == 53)
107
+
108
+ # ------------------------------------------------------
109
+ def test_monthly_excelfile_sample(self):
110
+
111
+ dataSource = ExcelFileDataSource("tests/resources/Donnees_informatives_PCE_MONTHLY.xlsx")
112
+
113
+ endDate = date.today()
114
+ startDate = endDate + timedelta(days=-365)
115
+
116
+ data = dataSource.load(self.__pceIdentifier, startDate, endDate, [Frequency.MONTHLY])
117
+
118
+ assert (len(data[Frequency.MONTHLY.value]) == 13)
119
+
120
+ # ------------------------------------------------------
121
+ def test_yearly_excelfile_sample(self):
122
+
123
+ dataSource = ExcelFileDataSource("tests/resources/Donnees_informatives_PCE_DAILY.xlsx")
124
+
125
+ endDate = date.today()
126
+ startDate = endDate + timedelta(days=-365)
127
+
128
+ data = dataSource.load(self.__pceIdentifier, startDate, endDate, [Frequency.YEARLY])
129
+
130
+ assert (len(data[Frequency.YEARLY.value]) == 1)
131
+
132
+ # ------------------------------------------------------
133
+ def test_jsonweb(self):
134
+
135
+ dataSource = JsonWebDataSource(self.__username, self.__password)
136
+
137
+ endDate = date.today()
138
+ startDate = endDate + timedelta(days=-365)
139
+
140
+ data = dataSource.load(self.__pceIdentifier, startDate, endDate, [Frequency.DAILY, Frequency.WEEKLY, Frequency.MONTHLY, Frequency.YEARLY])
141
+
142
+ assert (len(data[Frequency.DAILY.value]) > 0)
143
+
144
+ assert (len(data[Frequency.WEEKLY.value]) >= 51 and len(data[Frequency.WEEKLY.value]) <= 54)
145
+
146
+ assert (len(data[Frequency.MONTHLY.value]) >= 11 and len(data[Frequency.MONTHLY.value]) <= 13)
147
+
148
+ assert (len(data[Frequency.YEARLY.value]) >= 1)
149
+
150
+ # ------------------------------------------------------
151
+ def test_excelweb(self):
152
+
153
+ dataSource = ExcelWebDataSource(self.__username, self.__password, self.__tmp_directory)
154
+
155
+ endDate = date.today()
156
+ startDate = endDate + timedelta(days=-365)
157
+
158
+ data = dataSource.load(self.__pceIdentifier, startDate, endDate, [Frequency.DAILY, Frequency.WEEKLY, Frequency.MONTHLY, Frequency.YEARLY])
159
+
160
+ assert (len(data[Frequency.DAILY.value]) > 0)
161
+
162
+ assert (len(data[Frequency.WEEKLY.value]) >= 51 and len(data[Frequency.WEEKLY.value]) <= 54)
163
+
164
+ assert (len(data[Frequency.MONTHLY.value]) >= 12 and len(data[Frequency.MONTHLY.value]) <= 13)
165
+
166
+ assert (len(data[Frequency.YEARLY.value]) >= 1)
@@ -1 +0,0 @@
1
- __version__ = "1.2.6"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes