volue-insight-timeseries 1.0.5__tar.gz → 1.2.0__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.

Potentially problematic release.


This version of volue-insight-timeseries might be problematic. Click here for more details.

Files changed (19) hide show
  1. {volue-insight-timeseries-1.0.5/volue_insight_timeseries.egg-info → volue-insight-timeseries-1.2.0}/PKG-INFO +2 -2
  2. {volue-insight-timeseries-1.0.5 → volue-insight-timeseries-1.2.0}/README.md +2 -2
  3. {volue-insight-timeseries-1.0.5 → volue-insight-timeseries-1.2.0}/setup.py +1 -1
  4. volue-insight-timeseries-1.2.0/volue_insight_timeseries/VERSION +1 -0
  5. {volue-insight-timeseries-1.0.5 → volue-insight-timeseries-1.2.0}/volue_insight_timeseries/__init__.py +0 -1
  6. {volue-insight-timeseries-1.0.5 → volue-insight-timeseries-1.2.0}/volue_insight_timeseries/auth.py +0 -1
  7. {volue-insight-timeseries-1.0.5 → volue-insight-timeseries-1.2.0}/volue_insight_timeseries/events.py +3 -4
  8. {volue-insight-timeseries-1.0.5 → volue-insight-timeseries-1.2.0}/volue_insight_timeseries/util.py +25 -13
  9. {volue-insight-timeseries-1.0.5 → volue-insight-timeseries-1.2.0/volue_insight_timeseries.egg-info}/PKG-INFO +2 -2
  10. {volue-insight-timeseries-1.0.5 → volue-insight-timeseries-1.2.0}/volue_insight_timeseries.egg-info/requires.txt +0 -2
  11. volue-insight-timeseries-1.0.5/volue_insight_timeseries/VERSION +0 -1
  12. {volue-insight-timeseries-1.0.5 → volue-insight-timeseries-1.2.0}/LICENSE +0 -0
  13. {volue-insight-timeseries-1.0.5 → volue-insight-timeseries-1.2.0}/MANIFEST.in +0 -0
  14. {volue-insight-timeseries-1.0.5 → volue-insight-timeseries-1.2.0}/setup.cfg +0 -0
  15. {volue-insight-timeseries-1.0.5 → volue-insight-timeseries-1.2.0}/volue_insight_timeseries/curves.py +0 -0
  16. {volue-insight-timeseries-1.0.5 → volue-insight-timeseries-1.2.0}/volue_insight_timeseries/session.py +0 -0
  17. {volue-insight-timeseries-1.0.5 → volue-insight-timeseries-1.2.0}/volue_insight_timeseries.egg-info/SOURCES.txt +0 -0
  18. {volue-insight-timeseries-1.0.5 → volue-insight-timeseries-1.2.0}/volue_insight_timeseries.egg-info/dependency_links.txt +0 -0
  19. {volue-insight-timeseries-1.0.5 → volue-insight-timeseries-1.2.0}/volue_insight_timeseries.egg-info/top_level.txt +0 -0
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: volue-insight-timeseries
3
- Version: 1.0.5
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.12a0
8
+ Requires-Python: >=3.9, <3.13a0
9
9
  License-File: LICENSE
10
10
 
11
11
  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.
@@ -6,7 +6,7 @@ https://api.volueinsight.com/ (or equivalent services). Note that access
6
6
  is based on having a valid Volue Insight account. Please contact
7
7
  sales.insight@volue.com in order to get a trial account.
8
8
 
9
- The library is tested against Python 3.9, 3.10 and 3.11 - we recommend using
9
+ The library is tested against Python 3.9, 3.10, 3.11 and 3.12 - we recommend using
10
10
  the latest Python version.
11
11
 
12
12
 
@@ -54,7 +54,7 @@ the event of a severe bug that we will do any changes to it.
54
54
  These are the steps you will have to do in order to successfully
55
55
  make the switch.
56
56
 
57
- * Use Python 3.9, 3.10 or 3.11
57
+ * Use Python 3.9, 3.10, 3.11 or 3.12
58
58
  * Use Pandas 1.5.0 or newer
59
59
  * Use [zoneinfo](https://docs.python.org/3/library/zoneinfo.html), not pytz for handling time zone information
60
60
 
@@ -27,7 +27,7 @@ with open(os.path.join(here, 'volue_insight_timeseries/VERSION')) as fv:
27
27
 
28
28
  setup(
29
29
  name='volue-insight-timeseries',
30
- python_requires='>=3.9, <3.12a0',
30
+ python_requires='>=3.9, <3.13a0',
31
31
  packages=find_packages(),
32
32
  install_requires=extract_requirements('requirements.txt'),
33
33
  tests_require=[
@@ -9,4 +9,3 @@ from . import auth, curves, events, session, util
9
9
  here = os.path.abspath(os.path.dirname(__file__))
10
10
  with open(os.path.join(here, 'VERSION')) as fv:
11
11
  VERSION = __version__ = fv.read().strip()
12
-
@@ -2,7 +2,6 @@
2
2
  # Authentication support
3
3
  #
4
4
 
5
- import imp
6
5
  import json
7
6
  import time
8
7
  import threading
@@ -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
- try:
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
 
@@ -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': 'AS',
30
+ 'Y': 'YS',
30
31
  'S': '2QS',
31
32
  'Q': 'QS',
32
33
  'M': 'MS',
33
34
  'W': 'W-MON',
34
- 'H12': '12H',
35
- 'H6': '6H',
36
- 'H3': '3H',
37
- 'MIN30': '30T',
38
- 'MIN15': '15T',
39
- 'MIN5': '5T',
40
- 'MIN': 'T',
35
+ 'H12': '12h',
36
+ 'H6': '6h',
37
+ 'H3': '3h',
38
+ 'MIN30': '30min',
39
+ 'MIN15': '15min',
40
+ 'MIN5': '5min',
41
+ 'MIN': 'min',
41
42
  }
42
- # Mapping from Pandas to TS is built from map above, with some additions
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
- 'YS': 'Y',
49
+ 'AS': 'Y',
46
50
  '2QS-JAN': 'S',
47
51
  'QS-JAN': 'Q',
48
- 'min': 'MIN',
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 k, v in _TS_FREQ_TABLE.items():
51
- _PANDAS_FREQ_TABLE[v] = k
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
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: volue-insight-timeseries
3
- Version: 1.0.5
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.12a0
8
+ Requires-Python: >=3.9, <3.13a0
9
9
  License-File: LICENSE
10
10
 
11
11
  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.
@@ -2,5 +2,3 @@ requests>=2.18
2
2
  sseclient-py>=1.7
3
3
  pandas>=1.5.0
4
4
  future>=0.16
5
- matplotlib==3.8.2
6
- plotly==5.18.0