tagreader 6.0.2__tar.gz → 6.0.3__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.
- {tagreader-6.0.2 → tagreader-6.0.3}/PKG-INFO +9 -17
- {tagreader-6.0.2 → tagreader-6.0.3}/README.md +3 -11
- {tagreader-6.0.2 → tagreader-6.0.3}/pyproject.toml +4 -5
- {tagreader-6.0.2 → tagreader-6.0.3}/tagreader/clients.py +5 -2
- {tagreader-6.0.2 → tagreader-6.0.3}/tagreader/web_handlers.py +14 -9
- {tagreader-6.0.2 → tagreader-6.0.3}/LICENSE +0 -0
- {tagreader-6.0.2 → tagreader-6.0.3}/tagreader/__init__.py +0 -0
- {tagreader-6.0.2 → tagreader-6.0.3}/tagreader/__version__.py +0 -0
- {tagreader-6.0.2 → tagreader-6.0.3}/tagreader/cache.py +0 -0
- {tagreader-6.0.2 → tagreader-6.0.3}/tagreader/logger.py +0 -0
- {tagreader-6.0.2 → tagreader-6.0.3}/tagreader/utils.py +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: tagreader
|
|
3
|
-
Version: 6.0.
|
|
3
|
+
Version: 6.0.3
|
|
4
4
|
Summary: Tagreader is a Python package for reading trend data from the OSIsoft PI and Aspen Infoplus.21 IMS systems.
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: Aspen InfoPlus.21,OSIsoft PI
|
|
7
7
|
Author: Einar S. Idsø
|
|
8
8
|
Author-email: eiids@equinor.com
|
|
9
|
-
Requires-Python: >=3.
|
|
9
|
+
Requires-Python: >=3.9.2,<4.0.0
|
|
10
10
|
Classifier: Development Status :: 5 - Production/Stable
|
|
11
11
|
Classifier: Intended Audience :: Developers
|
|
12
12
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -16,20 +16,20 @@ Classifier: Operating System :: MacOS
|
|
|
16
16
|
Classifier: Operating System :: Microsoft :: Windows
|
|
17
17
|
Classifier: Operating System :: POSIX :: Linux
|
|
18
18
|
Classifier: Programming Language :: Python :: 3
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
21
19
|
Classifier: Programming Language :: Python :: 3.10
|
|
22
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
23
21
|
Classifier: Programming Language :: Python :: 3.12
|
|
24
22
|
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
25
25
|
Classifier: Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator
|
|
26
26
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
27
27
|
Classifier: Topic :: Utilities
|
|
28
28
|
Provides-Extra: notebooks
|
|
29
|
-
Requires-Dist: certifi (>=2024.12.14,<
|
|
29
|
+
Requires-Dist: certifi (>=2024.12.14,<2026.0.0)
|
|
30
30
|
Requires-Dist: diskcache (>=5.6.1,<6.0.0)
|
|
31
31
|
Requires-Dist: matplotlib (>=3.7.5,<4.0.0) ; extra == "notebooks"
|
|
32
|
-
Requires-Dist: msal-bearer (>=
|
|
32
|
+
Requires-Dist: msal-bearer (>=1.3.0,<2.0.0)
|
|
33
33
|
Requires-Dist: notebook (>=7.2.2,<8.0.0) ; extra == "notebooks"
|
|
34
34
|
Requires-Dist: pandas (>=1)
|
|
35
35
|
Requires-Dist: pycryptodome (>=3.20.0,<4.0.0)
|
|
@@ -48,25 +48,17 @@ Description-Content-Type: text/markdown
|
|
|
48
48
|
[](https://pepy.tech/project/tagreader)
|
|
49
49
|
|
|
50
50
|
Tagreader is a Python package for reading timeseries data from the OSIsoft PI and Aspen Infoplus.21
|
|
51
|
-
Information
|
|
52
|
-
as possible to the backend historians.
|
|
51
|
+
Information Management Systems (IMS). It is intended to be easy to use, and present as similar interfaces
|
|
52
|
+
as possible to the backend plant historians.
|
|
53
53
|
|
|
54
54
|
## Installation
|
|
55
55
|
You can install tagreader directly into your project from pypi by using pip
|
|
56
|
-
or another package manager.
|
|
56
|
+
or another package manager. Supports Python version 3.9.2 and above.
|
|
57
57
|
|
|
58
58
|
```shell
|
|
59
59
|
pip install tagreader
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
The following are required and will be installed:
|
|
63
|
-
|
|
64
|
-
* pandas
|
|
65
|
-
* requests
|
|
66
|
-
* requests-kerberos
|
|
67
|
-
* certifi
|
|
68
|
-
* diskcache
|
|
69
|
-
|
|
70
62
|
## Usage
|
|
71
63
|
Tagreader is easy to use for both Equinor internal IMS services, and non-internal usage. For non-internal usage
|
|
72
64
|
you simply need to provide the corresponding IMS service URLs and IMSType.
|
|
@@ -6,25 +6,17 @@
|
|
|
6
6
|
[](https://pepy.tech/project/tagreader)
|
|
7
7
|
|
|
8
8
|
Tagreader is a Python package for reading timeseries data from the OSIsoft PI and Aspen Infoplus.21
|
|
9
|
-
Information
|
|
10
|
-
as possible to the backend historians.
|
|
9
|
+
Information Management Systems (IMS). It is intended to be easy to use, and present as similar interfaces
|
|
10
|
+
as possible to the backend plant historians.
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
You can install tagreader directly into your project from pypi by using pip
|
|
14
|
-
or another package manager.
|
|
14
|
+
or another package manager. Supports Python version 3.9.2 and above.
|
|
15
15
|
|
|
16
16
|
```shell
|
|
17
17
|
pip install tagreader
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
The following are required and will be installed:
|
|
21
|
-
|
|
22
|
-
* pandas
|
|
23
|
-
* requests
|
|
24
|
-
* requests-kerberos
|
|
25
|
-
* certifi
|
|
26
|
-
* diskcache
|
|
27
|
-
|
|
28
20
|
## Usage
|
|
29
21
|
Tagreader is easy to use for both Equinor internal IMS services, and non-internal usage. For non-internal usage
|
|
30
22
|
you simply need to provide the corresponding IMS service URLs and IMSType.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "tagreader"
|
|
3
|
-
version = "6.0.
|
|
3
|
+
version = "6.0.3"
|
|
4
4
|
description = "Tagreader is a Python package for reading trend data from the OSIsoft PI and Aspen Infoplus.21 IMS systems."
|
|
5
5
|
authors = ["Einar S. Idsø <eiids@equinor.com>", "Morten Dæhli Aslesen <masl@equinor.com"]
|
|
6
6
|
license = "MIT"
|
|
@@ -28,19 +28,18 @@ classifiers=[
|
|
|
28
28
|
]
|
|
29
29
|
|
|
30
30
|
[tool.poetry.dependencies]
|
|
31
|
-
python = "^3.
|
|
31
|
+
python = "^3.9.2"
|
|
32
32
|
pandas = ">=1"
|
|
33
|
-
certifi = "
|
|
33
|
+
certifi = ">=2024.12.14,<2026.0.0"
|
|
34
34
|
requests = "^2"
|
|
35
35
|
requests-kerberos = "^0"
|
|
36
|
-
msal-bearer = "
|
|
36
|
+
msal-bearer = "^1.3.0"
|
|
37
37
|
notebook = { version = "^7.2.2", optional = true }
|
|
38
38
|
matplotlib = { version = "^3.7.5", optional = true }
|
|
39
39
|
diskcache = "^5.6.1"
|
|
40
40
|
pycryptodome = "^3.20.0"
|
|
41
41
|
requests-ntlm = ">=1.1,<=2.0"
|
|
42
42
|
|
|
43
|
-
|
|
44
43
|
[tool.poetry.group.dev.dependencies]
|
|
45
44
|
pre-commit = "^3"
|
|
46
45
|
pytest = ">=7,<9"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import os
|
|
2
|
-
from datetime import datetime, timedelta, tzinfo
|
|
2
|
+
from datetime import datetime, timedelta, timezone, tzinfo
|
|
3
3
|
from itertools import groupby
|
|
4
4
|
from operator import itemgetter
|
|
5
5
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
@@ -128,6 +128,8 @@ def get_server_address_aspen(datasource: str) -> Optional[Tuple[str, int]]:
|
|
|
128
128
|
host and port based on the path above and the UUID.
|
|
129
129
|
"""
|
|
130
130
|
|
|
131
|
+
# todo: is obsolete after removing ODBC
|
|
132
|
+
|
|
131
133
|
if not is_windows():
|
|
132
134
|
return None
|
|
133
135
|
import winreg
|
|
@@ -168,6 +170,7 @@ def get_server_address_pi(datasource: str) -> Optional[Tuple[str, int]]:
|
|
|
168
170
|
:return: host, port
|
|
169
171
|
:type: tuple(string, int)
|
|
170
172
|
"""
|
|
173
|
+
# todo: is obsolete after removing ODBC
|
|
171
174
|
|
|
172
175
|
if not is_windows():
|
|
173
176
|
return None
|
|
@@ -557,7 +560,7 @@ class IMSClient:
|
|
|
557
560
|
except ValueError:
|
|
558
561
|
start = convert_to_pydatetime(start)
|
|
559
562
|
if end is None:
|
|
560
|
-
end = datetime.
|
|
563
|
+
end = datetime.now(timezone.utc)
|
|
561
564
|
elif isinstance(end, (str, pd.Timestamp)):
|
|
562
565
|
end = convert_to_pydatetime(end)
|
|
563
566
|
|
|
@@ -72,7 +72,7 @@ def get_auth_aspen(use_internal: bool = True):
|
|
|
72
72
|
if use_internal:
|
|
73
73
|
return HTTPKerberosAuth(mutual_authentication=OPTIONAL)
|
|
74
74
|
|
|
75
|
-
from msal_bearer
|
|
75
|
+
from msal_bearer import BearerAuth
|
|
76
76
|
|
|
77
77
|
tenantID = "3aa4a235-b6e2-48d5-9195-7fcf05b459b0"
|
|
78
78
|
clientID = "7adaaa99-897f-428c-8a5f-4053db565b32"
|
|
@@ -260,6 +260,7 @@ class AspenHandlerWeb(BaseHandlerWeb):
|
|
|
260
260
|
|
|
261
261
|
@staticmethod
|
|
262
262
|
def generate_connection_string(host, *_, **__):
|
|
263
|
+
# todo: is obsolete after removing ODBC
|
|
263
264
|
raise NotImplementedError
|
|
264
265
|
|
|
265
266
|
@staticmethod
|
|
@@ -670,11 +671,13 @@ class AspenHandlerWeb(BaseHandlerWeb):
|
|
|
670
671
|
return connection_string
|
|
671
672
|
|
|
672
673
|
def initialize_connection_string(
|
|
674
|
+
# todo: is obsolete after removing ODBC
|
|
673
675
|
self,
|
|
674
676
|
host: Optional[str] = None,
|
|
675
677
|
port: int = 10014,
|
|
676
678
|
connection_string: Optional[str] = None,
|
|
677
679
|
):
|
|
680
|
+
# todo: is obsolete after removing ODBC
|
|
678
681
|
if connection_string:
|
|
679
682
|
self._connection_string = connection_string
|
|
680
683
|
else:
|
|
@@ -712,16 +715,17 @@ class AspenHandlerWeb(BaseHandlerWeb):
|
|
|
712
715
|
parsed_dict = res.json()["data"][0]
|
|
713
716
|
|
|
714
717
|
cols = []
|
|
715
|
-
|
|
716
|
-
|
|
718
|
+
if "cols" in parsed_dict.keys():
|
|
719
|
+
for i in parsed_dict["cols"]:
|
|
720
|
+
cols.append(i["n"])
|
|
717
721
|
|
|
718
722
|
rows = []
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
723
|
+
if "rows" in parsed_dict.keys():
|
|
724
|
+
for i in parsed_dict["rows"]:
|
|
725
|
+
element = []
|
|
726
|
+
for j in i["fld"]:
|
|
727
|
+
element.append(j["v"])
|
|
728
|
+
rows.append(element)
|
|
725
729
|
return pd.DataFrame(data=rows, columns=cols)
|
|
726
730
|
return res.text
|
|
727
731
|
|
|
@@ -756,6 +760,7 @@ class PIHandlerWeb(BaseHandlerWeb):
|
|
|
756
760
|
|
|
757
761
|
@staticmethod
|
|
758
762
|
def generate_connection_string(host, *_, **__):
|
|
763
|
+
# todo: is obsolete after removing ODBC
|
|
759
764
|
raise NotImplementedError
|
|
760
765
|
|
|
761
766
|
@staticmethod
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|