python-eigen-ingenuity 0.4.13__py3-none-any.whl → 0.4.16__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.
@@ -19,7 +19,7 @@ eigeningenuity.core) or a full URL to a JSON Bridge Historian instance.
19
19
 
20
20
  import json
21
21
  import math
22
- import logging
22
+ import warnings
23
23
  import csv
24
24
  import requests
25
25
  from urllib.parse import quote as urlquote
@@ -37,8 +37,6 @@ from eigeningenuity.util import _do_eigen_json_request, force_list, time_to_epoc
37
37
  from urllib3.exceptions import InsecureRequestWarning
38
38
  requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
39
39
 
40
- logging.basicConfig(format='%(levelname)s - %(message)s', level=logging.INFO)
41
-
42
40
 
43
41
  class JsonBridgeHistorian (object):
44
42
  """A Historian which talks the Eigen Historian Json Bridge protocol.
@@ -153,7 +151,7 @@ class JsonBridgeHistorian (object):
153
151
  if response['unknown'] != []:
154
152
  if items == {}:
155
153
  raise EigenException("None of the provided tags could be found in historian " + self.historian)
156
- logging.warning("Could not find tags: " + str(response["unknown"]) + " in historian " + self.historian)
154
+ warnings.warn("Could not find tags: " + str(response["unknown"]) + " in historian " + self.historian)
157
155
 
158
156
  if output == "raw":
159
157
  return response
@@ -202,7 +200,7 @@ class JsonBridgeHistorian (object):
202
200
  if response['unknown'] != []:
203
201
  if items == {}:
204
202
  raise EigenException("None of the provided tags could be found in historian " + self.historian)
205
- logging.warning("Could not find tags: " + str(response["unknown"]) + " in historian " + self.historian)
203
+ warnings.warn("Could not find tags: " + str(response["unknown"]) + " in historian " + self.historian)
206
204
 
207
205
  if output == "raw":
208
206
  return response
@@ -254,7 +252,7 @@ class JsonBridgeHistorian (object):
254
252
  if response['unknown'] != []:
255
253
  if items == {}:
256
254
  raise EigenException("None of the provided tags could be found in historian " + self.historian)
257
- logging.warning("Could not find tags: " + str(response["unknown"]) + " in historian " + self.historian)
255
+ warnings.warn("Could not find tags: " + str(response["unknown"]) + " in historian " + self.historian)
258
256
 
259
257
  if output == "raw":
260
258
  return response
@@ -307,7 +305,7 @@ class JsonBridgeHistorian (object):
307
305
  if response['unknown'] != []:
308
306
  if items == {}:
309
307
  raise EigenException("None of the provided tags could be found in historian " + self.historian)
310
- logging.warning("Could not find tags: " + str(response["unknown"]) + " in historian " + self.historian)
308
+ warnings.warn("Could not find tags: " + str(response["unknown"]) + " in historian " + self.historian)
311
309
 
312
310
  if output == "raw":
313
311
  return response
@@ -365,7 +363,7 @@ class JsonBridgeHistorian (object):
365
363
  if missing != []:
366
364
  if response == {}:
367
365
  raise EigenException("None of the provided tags could be found in historian " + self.historian)
368
- logging.warning("Could not find tags: " + str(missing) + " in historian " + self.historian)
366
+ warnings.warn("Could not find tags: " + str(missing) + " in historian " + self.historian)
369
367
 
370
368
  if output == "raw":
371
369
  return response
@@ -422,7 +420,7 @@ class JsonBridgeHistorian (object):
422
420
  else:
423
421
  count = 1
424
422
  if count > 1000:
425
- logging.warning(
423
+ warnings.warn(
426
424
  "getAggregateIntervals is only designed to return up to 1000 aggregate sets, currently returning " + str(
427
425
  count) + " sets. This may return overlapping intervals")
428
426
 
@@ -440,7 +438,7 @@ class JsonBridgeHistorian (object):
440
438
  if missing != []:
441
439
  if response == {}:
442
440
  raise EigenException("None of the provided tags could be found in historian " + self.historian)
443
- logging.warning("Could not find tags: " + str(missing) + " in historian " + self.historian)
441
+ warnings.warn("Could not find tags: " + str(missing) + " in historian " + self.historian)
444
442
 
445
443
  if output == "raw":
446
444
  return response
@@ -2,7 +2,7 @@ import os
2
2
  from getpass import getuser
3
3
 
4
4
  _token_cache_enabled_ = True
5
- _azure_auth_enabled_ = True
5
+ _azure_auth_enabled_ = False
6
6
  _azure_tenant_id_ = os.getenv("TENANTID", "74efa022-e6d6-42ad-bc15-edc76c525bde")
7
7
  _azure_client_id_ = os.getenv("CLIENTID", "c2b9aa13-e178-4dde-bc2c-b6cc4c8391d2")
8
8
 
@@ -45,6 +45,19 @@ def disable_azure_auth(state=True):
45
45
  global _azure_auth_enabled_
46
46
  _azure_auth_enabled_ = not state
47
47
 
48
+ def enable_azure_auth(state=True):
49
+ """
50
+ Skip all azure authentication steps, note that this will cause an error if querying a protected resource
51
+
52
+ Args:
53
+ None
54
+
55
+ Returns:
56
+ None
57
+ """
58
+ global _azure_auth_enabled_
59
+ _azure_auth_enabled_ = state
60
+
48
61
  def set_azure_tenant_id(id):
49
62
  """
50
63
  Set the ID of the Azure tenant of the eigenserver. This value is required for Azure authentication, but the use of the TENANTID environmental variable can be used as an alternative way of setting it.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-eigen-ingenuity
3
- Version: 0.4.13
3
+ Version: 0.4.16
4
4
  Summary: A python library used to query data from the Eigen Ingenuity system
5
5
  Home-page: https://www.eigen.co/
6
6
  Author: Murray Callander
@@ -3,13 +3,13 @@ eigeningenuity/assetmodel.py,sha256=Ly26iD_t-cyhaSNHRvbhHo_eulVUDXmNRAbgsfSeaqM,
3
3
  eigeningenuity/auth.py,sha256=3efTRyiKoKXCYt3F2lZ9KVF82Gw-BfFLC8y9lo8690I,6560
4
4
  eigeningenuity/elastic.py,sha256=FYwjnIjDimDS4XWVnhPWVWJ4yLPUsTNr12S-YCYmM04,6250
5
5
  eigeningenuity/events.py,sha256=gU6Q3VLpk4lgVjZPtCchjJI7CVWehEGijSEfmrFEgkY,3054
6
- eigeningenuity/historian.py,sha256=x3hiwfGdf9n2Jbnrxiih3FgkgZquIdwWy3VxSIvmq3M,36274
7
- eigeningenuity/settings.py,sha256=q9hiuD9E8Bcpl8NI2kr-DQK1U8wNqZDNKSQ8Xy_Dpx4,2085
6
+ eigeningenuity/historian.py,sha256=0kYyCRdekrvpJgDXggE0Ox6BWSctY3PQQoYAxEaBagU,36182
7
+ eigeningenuity/settings.py,sha256=bTowoRfT1BYh28ohxjT4uTiSdzUMDB4rOefRUHz_0Ls,2363
8
8
  eigeningenuity/smartdash.py,sha256=pkqx_hSZLJUKT1xJtu2TmQgk4pZCTiPoaCjrbgcD86I,2843
9
9
  eigeningenuity/sql.py,sha256=bWZpCPTKgX_MF-xlNb0qPEZv09to4_SIUAvTjZXWkDc,4081
10
10
  eigeningenuity/util.py,sha256=ewNDMk4n1PZm2nRW1_5RlQgUWF_fQ9l2oW76WHysU7o,12839
11
11
  eigeningenuity/core/__init__.py,sha256=QVMU9bEoZTjPzg_-oNWXHzQB0HPlt95tKGXdlBS_eP0,7741
12
- python_eigen_ingenuity-0.4.13.dist-info/METADATA,sha256=IXzvgud6xuTRNTjXkIMBJsIefoFboPSa5hfkeNJleXg,1853
13
- python_eigen_ingenuity-0.4.13.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
14
- python_eigen_ingenuity-0.4.13.dist-info/top_level.txt,sha256=N3esHxXM41zWhi8-bvfUn84i2Vl1Ry6RJtrrzEwpLcM,15
15
- python_eigen_ingenuity-0.4.13.dist-info/RECORD,,
12
+ python_eigen_ingenuity-0.4.16.dist-info/METADATA,sha256=6zGqXkQEEIo0rub0g2IWwLjMHfEXDHTyqSRVGYkhV8c,1853
13
+ python_eigen_ingenuity-0.4.16.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
14
+ python_eigen_ingenuity-0.4.16.dist-info/top_level.txt,sha256=N3esHxXM41zWhi8-bvfUn84i2Vl1Ry6RJtrrzEwpLcM,15
15
+ python_eigen_ingenuity-0.4.16.dist-info/RECORD,,