volue-insight-timeseries 1.0.5__py3-none-any.whl → 1.2.0__py3-none-any.whl
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.
Potentially problematic release.
This version of volue-insight-timeseries might be problematic. Click here for more details.
- volue_insight_timeseries/VERSION +1 -1
- volue_insight_timeseries/__init__.py +0 -1
- volue_insight_timeseries/auth.py +0 -1
- volue_insight_timeseries/events.py +3 -4
- volue_insight_timeseries/util.py +25 -13
- {volue_insight_timeseries-1.0.5.dist-info → volue_insight_timeseries-1.2.0.dist-info}/METADATA +2 -4
- volue_insight_timeseries-1.2.0.dist-info/RECORD +12 -0
- {volue_insight_timeseries-1.0.5.dist-info → volue_insight_timeseries-1.2.0.dist-info}/WHEEL +1 -1
- volue_insight_timeseries-1.0.5.dist-info/RECORD +0 -12
- {volue_insight_timeseries-1.0.5.dist-info → volue_insight_timeseries-1.2.0.dist-info}/LICENSE +0 -0
- {volue_insight_timeseries-1.0.5.dist-info → volue_insight_timeseries-1.2.0.dist-info}/top_level.txt +0 -0
volue_insight_timeseries/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0
|
|
1
|
+
1.2.0
|
volue_insight_timeseries/auth.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import contextlib
|
|
1
2
|
import json
|
|
2
3
|
import time
|
|
3
4
|
|
|
@@ -58,10 +59,8 @@ class EventListener:
|
|
|
58
59
|
event.curve = self.curve_cache[event.id]
|
|
59
60
|
self.queue.put(event)
|
|
60
61
|
if sse_event.retry is not None:
|
|
61
|
-
|
|
62
|
+
with contextlib.suppress(ValueError, TypeError):
|
|
62
63
|
self.retry = int(sse_event.retry)
|
|
63
|
-
except:
|
|
64
|
-
pass
|
|
65
64
|
if self.do_shutdown:
|
|
66
65
|
break
|
|
67
66
|
# Session was closed by server/network, wait for retry before looping.
|
|
@@ -107,7 +106,7 @@ class DefaultEvent(object):
|
|
|
107
106
|
self._raw_event = sse_event
|
|
108
107
|
try:
|
|
109
108
|
self.json_data = json.loads(sse_event.data)
|
|
110
|
-
except:
|
|
109
|
+
except (json.JSONDecodeError, TypeError):
|
|
111
110
|
self.json_data = None
|
|
112
111
|
|
|
113
112
|
|
volue_insight_timeseries/util.py
CHANGED
|
@@ -8,6 +8,7 @@ import datetime
|
|
|
8
8
|
import dateutil.parser
|
|
9
9
|
import pandas as pd
|
|
10
10
|
import numpy as np
|
|
11
|
+
import warnings
|
|
11
12
|
from past.types import basestring
|
|
12
13
|
try:
|
|
13
14
|
from urllib.parse import quote_plus
|
|
@@ -26,29 +27,38 @@ TAGGED_INSTANCES = 'TAGGED_INSTANCES'
|
|
|
26
27
|
|
|
27
28
|
# Frequency mapping from TS to Pandas
|
|
28
29
|
_TS_FREQ_TABLE = {
|
|
29
|
-
'Y': '
|
|
30
|
+
'Y': 'YS',
|
|
30
31
|
'S': '2QS',
|
|
31
32
|
'Q': 'QS',
|
|
32
33
|
'M': 'MS',
|
|
33
34
|
'W': 'W-MON',
|
|
34
|
-
'H12': '
|
|
35
|
-
'H6': '
|
|
36
|
-
'H3': '
|
|
37
|
-
'MIN30': '
|
|
38
|
-
'MIN15': '
|
|
39
|
-
'MIN5': '
|
|
40
|
-
'MIN': '
|
|
35
|
+
'H12': '12h',
|
|
36
|
+
'H6': '6h',
|
|
37
|
+
'H3': '3h',
|
|
38
|
+
'MIN30': '30min',
|
|
39
|
+
'MIN15': '15min',
|
|
40
|
+
'MIN5': '5min',
|
|
41
|
+
'MIN': 'min',
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
+
|
|
44
|
+
# Mapping from various versions of Pandas to TS is built from map above,
|
|
45
|
+
# with some additions to support older versions of pandas
|
|
43
46
|
_PANDAS_FREQ_TABLE = {
|
|
47
|
+
'YS-JAN': 'Y',
|
|
44
48
|
'AS-JAN': 'Y',
|
|
45
|
-
'
|
|
49
|
+
'AS': 'Y',
|
|
46
50
|
'2QS-JAN': 'S',
|
|
47
51
|
'QS-JAN': 'Q',
|
|
48
|
-
'
|
|
52
|
+
'12H': 'H12',
|
|
53
|
+
'6H': 'H6',
|
|
54
|
+
'3H': 'H3',
|
|
55
|
+
'30T': 'MIN30',
|
|
56
|
+
'15T': 'MIN15',
|
|
57
|
+
'5T': 'MIN5',
|
|
58
|
+
'T': 'MIN',
|
|
49
59
|
}
|
|
50
|
-
for
|
|
51
|
-
_PANDAS_FREQ_TABLE[
|
|
60
|
+
for ts_freq, pandas_freq in _TS_FREQ_TABLE.items():
|
|
61
|
+
_PANDAS_FREQ_TABLE[pandas_freq.upper()] = ts_freq
|
|
52
62
|
|
|
53
63
|
|
|
54
64
|
class CurveException(Exception):
|
|
@@ -166,6 +176,8 @@ class TS(object):
|
|
|
166
176
|
def _rev_map_freq(frequency):
|
|
167
177
|
if frequency.upper() in _PANDAS_FREQ_TABLE:
|
|
168
178
|
frequency = _PANDAS_FREQ_TABLE[frequency.upper()]
|
|
179
|
+
else:
|
|
180
|
+
warnings.warn(f"Frequency is not supported: '{frequency}'", FutureWarning, stacklevel=2)
|
|
169
181
|
return frequency
|
|
170
182
|
|
|
171
183
|
@staticmethod
|
{volue_insight_timeseries-1.0.5.dist-info → volue_insight_timeseries-1.2.0.dist-info}/METADATA
RENAMED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: volue-insight-timeseries
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Volue Insight API python library
|
|
5
5
|
Home-page: https://www.volueinsight.com
|
|
6
6
|
Author: Volue Insight
|
|
7
7
|
Author-email: support.insight@volue.com
|
|
8
|
-
Requires-Python: >=3.9, <3.
|
|
8
|
+
Requires-Python: >=3.9, <3.13a0
|
|
9
9
|
License-File: LICENSE
|
|
10
10
|
Requires-Dist: requests >=2.18
|
|
11
11
|
Requires-Dist: sseclient-py >=1.7
|
|
12
12
|
Requires-Dist: pandas >=1.5.0
|
|
13
13
|
Requires-Dist: future >=0.16
|
|
14
|
-
Requires-Dist: matplotlib ==3.8.2
|
|
15
|
-
Requires-Dist: plotly ==5.18.0
|
|
16
14
|
|
|
17
15
|
This library is meant as a simple toolkit for working with data from https://api.volueinsight.com/ (or equivalent services). Note that access is based on some sort of login credentials, this library is not all that useful unless you have a valid Volue Insight account.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
volue_insight_timeseries/VERSION,sha256=HltRzeUVOWqfp2KQnPjKZYTMxWSzJdLuvup2F1_pXE0,6
|
|
2
|
+
volue_insight_timeseries/__init__.py,sha256=DXR1tB3huHaG9wKRbpSEYhAat97msXrFgdp9eyYR5Wc,274
|
|
3
|
+
volue_insight_timeseries/auth.py,sha256=z8pm3dMm9ZhRjqt4hlTDr34raGEmCr6BIVhuI14q8QA,2106
|
|
4
|
+
volue_insight_timeseries/curves.py,sha256=DaHtO5gmcx_f-OZY9kJPoQWc40WEAxhWR_TG3Fwv00A,65949
|
|
5
|
+
volue_insight_timeseries/events.py,sha256=95Ha6JJ6Gwk0OqK9KPkkNoLqECjnXQJJ6rrjdOK3gik,4217
|
|
6
|
+
volue_insight_timeseries/session.py,sha256=u271_x8rSeuCi8IvaUTcweBHahY1pVEVkhTGZYmJcNY,20124
|
|
7
|
+
volue_insight_timeseries/util.py,sha256=kWv8X4-E4jLFAJLLmT48ifOejFjFMAjH2b_6T1lN1Aw,9664
|
|
8
|
+
volue_insight_timeseries-1.2.0.dist-info/LICENSE,sha256=QW5nSxE0LozNpYWdyJm_0hco_PidycTnelwYzKdW7ZM,1069
|
|
9
|
+
volue_insight_timeseries-1.2.0.dist-info/METADATA,sha256=WMPC4JxnQc69K2CpQB4D2j8rGeppbYChfS27xIvJmhs,661
|
|
10
|
+
volue_insight_timeseries-1.2.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
11
|
+
volue_insight_timeseries-1.2.0.dist-info/top_level.txt,sha256=IxOCIoqzMAV5gS4n6CIoRW9kBZnKQHyUPlDuJpEXmNY,25
|
|
12
|
+
volue_insight_timeseries-1.2.0.dist-info/RECORD,,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
volue_insight_timeseries/VERSION,sha256=jFS_q38a6b0acUjq5B57Co9K03JuDKxw-COi1F255gw,6
|
|
2
|
-
volue_insight_timeseries/__init__.py,sha256=V4x4Q0s3cOxTWqOzS_AWPCjCht-JWaEF8v2WU__Mzdg,275
|
|
3
|
-
volue_insight_timeseries/auth.py,sha256=qkfVgblT8KuNOohj-s62uaid0N7YaTIfn16P_F17A90,2117
|
|
4
|
-
volue_insight_timeseries/curves.py,sha256=DaHtO5gmcx_f-OZY9kJPoQWc40WEAxhWR_TG3Fwv00A,65949
|
|
5
|
-
volue_insight_timeseries/events.py,sha256=jDWJM1OaU4buMmLNefPYhV8gK81G_DIT_11wQwXtyGU,4194
|
|
6
|
-
volue_insight_timeseries/session.py,sha256=u271_x8rSeuCi8IvaUTcweBHahY1pVEVkhTGZYmJcNY,20124
|
|
7
|
-
volue_insight_timeseries/util.py,sha256=TLbVWl07xx_SbPqP2N-gGz5SrwfZhjVxDvsJ8lzGbms,9301
|
|
8
|
-
volue_insight_timeseries-1.0.5.dist-info/LICENSE,sha256=QW5nSxE0LozNpYWdyJm_0hco_PidycTnelwYzKdW7ZM,1069
|
|
9
|
-
volue_insight_timeseries-1.0.5.dist-info/METADATA,sha256=wtPm_f8gQjbjDh62g6u_wMPQVLiGVFQ2FQ6Cw0yU7J8,726
|
|
10
|
-
volue_insight_timeseries-1.0.5.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
11
|
-
volue_insight_timeseries-1.0.5.dist-info/top_level.txt,sha256=IxOCIoqzMAV5gS4n6CIoRW9kBZnKQHyUPlDuJpEXmNY,25
|
|
12
|
-
volue_insight_timeseries-1.0.5.dist-info/RECORD,,
|
{volue_insight_timeseries-1.0.5.dist-info → volue_insight_timeseries-1.2.0.dist-info}/LICENSE
RENAMED
|
File without changes
|
{volue_insight_timeseries-1.0.5.dist-info → volue_insight_timeseries-1.2.0.dist-info}/top_level.txt
RENAMED
|
File without changes
|