python-esios 0.2.3__tar.gz → 0.2.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_esios-0.2.3/python_esios.egg-info → python_esios-0.2.5}/PKG-INFO +1 -1
- {python_esios-0.2.3 → python_esios-0.2.5}/esios/archives.py +2 -1
- {python_esios-0.2.3 → python_esios-0.2.5}/esios/indicators.py +11 -4
- {python_esios-0.2.3 → python_esios-0.2.5/python_esios.egg-info}/PKG-INFO +1 -1
- {python_esios-0.2.3 → python_esios-0.2.5}/setup.py +1 -1
- {python_esios-0.2.3 → python_esios-0.2.5}/LICENSE +0 -0
- {python_esios-0.2.3 → python_esios-0.2.5}/README.md +0 -0
- {python_esios-0.2.3 → python_esios-0.2.5}/esios/__init__.py +0 -0
- {python_esios-0.2.3 → python_esios-0.2.5}/esios/client.py +0 -0
- {python_esios-0.2.3 → python_esios-0.2.5}/esios/offer_indicators.py +0 -0
- {python_esios-0.2.3 → python_esios-0.2.5}/python_esios.egg-info/SOURCES.txt +0 -0
- {python_esios-0.2.3 → python_esios-0.2.5}/python_esios.egg-info/dependency_links.txt +0 -0
- {python_esios-0.2.3 → python_esios-0.2.5}/python_esios.egg-info/requires.txt +0 -0
- {python_esios-0.2.3 → python_esios-0.2.5}/python_esios.egg-info/top_level.txt +0 -0
- {python_esios-0.2.3 → python_esios-0.2.5}/setup.cfg +0 -0
|
@@ -45,6 +45,7 @@ class Archive:
|
|
|
45
45
|
raise ValueError("Either 'date', or 'start' and 'end' dates must be provided")
|
|
46
46
|
|
|
47
47
|
endpoint = f"archives/{self.id}"
|
|
48
|
+
|
|
48
49
|
response = self.client._get(endpoint, self.client.public_headers, params=params)
|
|
49
50
|
|
|
50
51
|
self.metadata = response
|
|
@@ -71,7 +72,7 @@ class Archive:
|
|
|
71
72
|
The path to the extracted file.
|
|
72
73
|
"""
|
|
73
74
|
|
|
74
|
-
response = requests.get(self.url_download
|
|
75
|
+
response = requests.get(self.url_download)
|
|
75
76
|
response.raise_for_status()
|
|
76
77
|
|
|
77
78
|
zip_file = BytesIO(response.content)
|
|
@@ -48,10 +48,18 @@ class Indicator:
|
|
|
48
48
|
# Remove None values from params
|
|
49
49
|
params = {k: v for k, v in params.items() if v is not None}
|
|
50
50
|
|
|
51
|
-
start_date =
|
|
52
|
-
end_date =
|
|
51
|
+
start_date = pd.to_datetime(start)
|
|
52
|
+
end_date = pd.to_datetime(end)
|
|
53
53
|
three_weeks = timedelta(weeks=3)
|
|
54
|
-
|
|
54
|
+
|
|
55
|
+
endpoint = f"indicators/{self.id}"
|
|
56
|
+
|
|
57
|
+
if end_date - start_date <= three_weeks:
|
|
58
|
+
data = self.client._get(endpoint, self.client.public_headers, params=params)
|
|
59
|
+
data = data.get('indicator', {}).get('values', [])
|
|
60
|
+
|
|
61
|
+
return self._to_dataframe(data, column_name)
|
|
62
|
+
|
|
55
63
|
data_all = []
|
|
56
64
|
|
|
57
65
|
current_start = start_date
|
|
@@ -61,7 +69,6 @@ class Indicator:
|
|
|
61
69
|
chunk_params['start_date'] = current_start.strftime('%Y-%m-%d')
|
|
62
70
|
chunk_params['end_date'] = current_end.strftime('%Y-%m-%d') + 'T23:59:59'
|
|
63
71
|
|
|
64
|
-
endpoint = f"indicators/{self.id}"
|
|
65
72
|
data = self.client._get(endpoint, self.client.public_headers, params=chunk_params)
|
|
66
73
|
data_all.extend(data.get('indicator', {}).get('values', []))
|
|
67
74
|
|
|
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
|