volue-insight-timeseries 1.2.0__tar.gz → 1.2.2__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.2.0 → volue_insight_timeseries-1.2.2}/PKG-INFO +2 -2
  2. {volue-insight-timeseries-1.2.0 → volue_insight_timeseries-1.2.2}/README.md +71 -1
  3. {volue-insight-timeseries-1.2.0 → volue_insight_timeseries-1.2.2}/setup.py +1 -1
  4. volue_insight_timeseries-1.2.2/volue_insight_timeseries/VERSION +1 -0
  5. {volue-insight-timeseries-1.2.0 → volue_insight_timeseries-1.2.2}/volue_insight_timeseries/util.py +1 -0
  6. {volue-insight-timeseries-1.2.0 → volue_insight_timeseries-1.2.2}/volue_insight_timeseries.egg-info/PKG-INFO +1 -1
  7. volue-insight-timeseries-1.2.0/volue_insight_timeseries/VERSION +0 -1
  8. {volue-insight-timeseries-1.2.0 → volue_insight_timeseries-1.2.2}/LICENSE +0 -0
  9. {volue-insight-timeseries-1.2.0 → volue_insight_timeseries-1.2.2}/MANIFEST.in +0 -0
  10. {volue-insight-timeseries-1.2.0 → volue_insight_timeseries-1.2.2}/setup.cfg +0 -0
  11. {volue-insight-timeseries-1.2.0 → volue_insight_timeseries-1.2.2}/volue_insight_timeseries/__init__.py +0 -0
  12. {volue-insight-timeseries-1.2.0 → volue_insight_timeseries-1.2.2}/volue_insight_timeseries/auth.py +0 -0
  13. {volue-insight-timeseries-1.2.0 → volue_insight_timeseries-1.2.2}/volue_insight_timeseries/curves.py +0 -0
  14. {volue-insight-timeseries-1.2.0 → volue_insight_timeseries-1.2.2}/volue_insight_timeseries/events.py +0 -0
  15. {volue-insight-timeseries-1.2.0 → volue_insight_timeseries-1.2.2}/volue_insight_timeseries/session.py +0 -0
  16. {volue-insight-timeseries-1.2.0 → volue_insight_timeseries-1.2.2}/volue_insight_timeseries.egg-info/SOURCES.txt +0 -0
  17. {volue-insight-timeseries-1.2.0 → volue_insight_timeseries-1.2.2}/volue_insight_timeseries.egg-info/dependency_links.txt +0 -0
  18. {volue-insight-timeseries-1.2.0 → volue_insight_timeseries-1.2.2}/volue_insight_timeseries.egg-info/requires.txt +0 -0
  19. {volue-insight-timeseries-1.2.0 → volue_insight_timeseries-1.2.2}/volue_insight_timeseries.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
- Name: volue-insight-timeseries
3
- Version: 1.2.0
2
+ Name: volue_insight_timeseries
3
+ Version: 1.2.2
4
4
  Summary: Volue Insight API python library
5
5
  Home-page: https://www.volueinsight.com
6
6
  Author: Volue Insight
@@ -58,10 +58,80 @@ make the switch.
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
 
61
+ ### Example of migrating an existing script
62
+ Assume you want to migrate the script below. It is a very simple script to
63
+ highlight things that are changing, not a recommended way to write production
64
+ code.
65
+
66
+ ```python
67
+ # python 3.9.8
68
+ # pip install wapi-python==0.7.15
69
+ # pip install python-dotenv==1.0.1
70
+ #
71
+ # ---
72
+ # .env file contents
73
+ # CLIENT_ID=your-client-id
74
+ # CLIENT_SECRET=your-client-secret
75
+
76
+ import os
77
+ import wapi
78
+ from wapi.util import TS
79
+ from wapi.curves import InstanceCurve
80
+ from dotenv import load_dotenv
81
+
82
+ load_dotenv()
83
+ session = wapi.Session(client_id=(os.environ['CLIENT_ID']),
84
+ client_secret=(os.environ['CLIENT_SECRET']))
85
+
86
+ results = session.search(name="tt no2 con ec00 °c cet min15 f")
87
+ if results:
88
+ instance_curve: InstanceCurve = results[0]
89
+ data: TS = instance_curve.get_latest(data_to="2030-04-01T04:00Z")
90
+ print(f"Curve type: {data.curve_type}")
91
+ print(f"Time zone class of curve data: {type(data.tz)}")
92
+
93
+ # Output
94
+ # Curve type: INSTANCES
95
+ # Time zone class of curve data: <class 'pytz.tzfile.CET'>
96
+ ```
97
+
98
+ The migrated script is below
99
+
100
+ ```python
101
+ # python 3.9.8
102
+ # pip install volue-insight-timeseries==1.2.0
103
+ # pip install python-dotenv==1.0.1
104
+ #
105
+ # ---
106
+ # .env file contents
107
+ # CLIENT_ID=your-client-id
108
+ # CLIENT_SECRET=your-client-secret
109
+
110
+ import os
111
+ import volue_insight_timeseries as vit
112
+ from volue_insight_timeseries.util import TS
113
+ from volue_insight_timeseries.curves import InstanceCurve
114
+ from dotenv import load_dotenv
115
+
116
+ load_dotenv()
117
+ session = vit.Session(client_id=(os.environ['CLIENT_ID']),
118
+ client_secret=(os.environ['CLIENT_SECRET']))
119
+
120
+ results = session.search(name="tt no2 con ec00 °c cet min15 f")
121
+ if results:
122
+ instance_curve: InstanceCurve = results[0]
123
+ data: TS = instance_curve.get_latest(data_to="2030-04-01T04:00Z")
124
+ print(f"Curve type: {data.curve_type}")
125
+ print(f"Time zone class of curve data: {type(data.tz)}")
126
+
127
+ # Output
128
+ # Curve type: INSTANCES
129
+ # Time zone class of curve data: <class 'zoneinfo.ZoneInfo'>
130
+ ```
61
131
 
62
132
  ## Copyright (MIT License)
63
133
 
64
- Copyright (c) 2018-2022 Volue Insight AS
134
+ Copyright (c) 2018-2024 Volue Insight AS
65
135
 
66
136
  Permission is hereby granted, free of charge, to any person obtaining a copy
67
137
  of this software and associated documentation files (the "Software"), to deal
@@ -26,7 +26,7 @@ with open(os.path.join(here, 'volue_insight_timeseries/VERSION')) as fv:
26
26
  version = fv.read().strip()
27
27
 
28
28
  setup(
29
- name='volue-insight-timeseries',
29
+ name='volue_insight_timeseries',
30
30
  python_requires='>=3.9, <3.13a0',
31
31
  packages=find_packages(),
32
32
  install_requires=extract_requirements('requirements.txt'),
@@ -39,6 +39,7 @@ _TS_FREQ_TABLE = {
39
39
  'MIN15': '15min',
40
40
  'MIN5': '5min',
41
41
  'MIN': 'min',
42
+ 'D': 'D',
42
43
  }
43
44
 
44
45
  # Mapping from various versions of Pandas to TS is built from map above,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: volue-insight-timeseries
3
- Version: 1.2.0
3
+ Version: 1.2.2
4
4
  Summary: Volue Insight API python library
5
5
  Home-page: https://www.volueinsight.com
6
6
  Author: Volue Insight