epmwebapi 6.0.40__tar.gz → 6.50.38__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.
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/PKG-INFO +15 -5
- epmwebapi-6.50.38/epmwebapi/_version.py +1 -0
- epmwebapi-6.50.38/epmwebapi/advancedevent.py +61 -0
- epmwebapi-6.50.38/epmwebapi/attributeoperand.py +18 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/authorizationservice.py +1 -1
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/basicvariable.py +6 -0
- epmwebapi-6.50.38/epmwebapi/elementoperand.py +56 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/epmconnection.py +450 -5
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/epmmodelobject.py +28 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/epmnodeids.py +4 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/epmobject.py +8 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/epmvariable.py +19 -9
- epmwebapi-6.50.38/epmwebapi/eventfiltermodel.py +24 -0
- epmwebapi-6.50.38/epmwebapi/filtermodel.py +20 -0
- epmwebapi-6.50.38/epmwebapi/filteroperand.py +2 -0
- epmwebapi-6.50.38/epmwebapi/historyeventmodeljson.py +24 -0
- epmwebapi-6.50.38/epmwebapi/literaloperand.py +18 -0
- epmwebapi-6.50.38/epmwebapi/numpyextras.py +290 -0
- epmwebapi-6.50.38/epmwebapi/queryfiltercontent.py +15 -0
- epmwebapi-6.50.38/epmwebapi/queryfilterelement.py +17 -0
- epmwebapi-6.50.38/epmwebapi/querymodelfilterJSON.py +27 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/queryresultmask.py +2 -0
- epmwebapi-6.50.38/epmwebapi/simpleattributeoperand.py +17 -0
- epmwebapi-6.50.38/epmwebapi/typeevent.py +69 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi.egg-info/PKG-INFO +15 -5
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi.egg-info/SOURCES.txt +15 -1
- epmwebapi-6.50.38/pyproject.toml +22 -0
- epmwebapi-6.50.38/setup.cfg +4 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/setup.py +1 -1
- epmwebapi-6.0.40/epmwebapi/_version.py +0 -1
- epmwebapi-6.0.40/epmwebapi/numpyextras.py +0 -125
- epmwebapi-6.0.40/setup.cfg +0 -8
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/LICENSE.txt +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/Readme.md +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/__init__.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/aggregatedetails.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/annotationvaluejson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/autostarttimer.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/basicvariablepropertymask.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/browsedirection.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/browseitemmodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/browsemodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/browseresultitemmodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/browseresultmodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/customtypedefinition.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/dataobjectattributes.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/dataobjectsfilter.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/datasetconfig.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/datasetpen.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/datavaluejson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/diagnosticmodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/dll_references/Elipse.Epm.AddressSpaceModel.dll +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/dll_references/ElipseLoggerInterface.dll +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/dll_references/EpmData.dll +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/dll_references/Microsoft.Extensions.Logging.Abstractions.dll +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/domainfilter.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/downloadtype.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/epmconnectioncontext.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/epmdataobject.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/epmproperty.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/epmsession.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/epmutils.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/epmwebapi.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/exporttype.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/folder.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/historyprocessedmodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/historyrawmodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/historyresultitemmodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/historyresultmodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/historyupdatedataitemmodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/historyupdatedatamodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/historyupdateresultmodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/historyupdatetype.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/itempathandcontinuationpointjson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/itempathjson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/mimetype.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/nodeattributes.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/nodeclassmask.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/performupdatetype.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/portalresources.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/processorresources.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/querymodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/queryperiod.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/queryresultitemmodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/queryresultmodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/readitemmodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/readmodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/readresultitemmodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/readresultmodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/report.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/resource.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/resourcesmanager.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/statuscodes.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/writeitemmodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi/writemodeljson.py +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi.egg-info/dependency_links.txt +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi.egg-info/requires.txt +0 -0
- {epmwebapi-6.0.40 → epmwebapi-6.50.38}/epmwebapi.egg-info/top_level.txt +0 -0
|
@@ -1,17 +1,27 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: epmwebapi
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.50.38
|
|
4
4
|
Home-page: https://github.com/elipsesoftware/epmwebapi
|
|
5
5
|
Author: Elipse Software Ltda
|
|
6
|
+
License-Expression: GPL-3.0-only
|
|
6
7
|
Classifier: Development Status :: 3 - Alpha
|
|
7
8
|
Classifier: Intended Audience :: Developers
|
|
8
9
|
Classifier: Topic :: Software Development :: Build Tools
|
|
9
|
-
Classifier:
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
13
|
Requires-Python: >=3.6, <4
|
|
13
14
|
Description-Content-Type: text/markdown
|
|
14
15
|
License-File: LICENSE.txt
|
|
16
|
+
Requires-Dist: numpy
|
|
17
|
+
Requires-Dist: requests
|
|
18
|
+
Requires-Dist: python-dateutil
|
|
19
|
+
Requires-Dist: pytz
|
|
20
|
+
Requires-Dist: pythonnet
|
|
21
|
+
Dynamic: author
|
|
22
|
+
Dynamic: home-page
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
Dynamic: requires-python
|
|
15
25
|
|
|
16
26
|
# epmwebapi
|
|
17
27
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '6.50.38'
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import Any, List
|
|
3
|
+
from numpy.typing import NDArray
|
|
4
|
+
|
|
5
|
+
from .elementoperand import ElementOperand
|
|
6
|
+
from .queryperiod import QueryPeriod
|
|
7
|
+
from .itempathjson import ItemPathJSON
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AdvancedEvent(object):
|
|
11
|
+
"""
|
|
12
|
+
Class representing an Event Advanced.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, connection:EpmConnection, eventName:str):
|
|
16
|
+
self._connection = connection
|
|
17
|
+
self._eventPath = ItemPathJSON('OPCUA.BrowsePath', '', '1:Events/1:Advanced/1:' + eventName)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def historyRead(self, queryPeriod:QueryPeriod, where:ElementOperand=None, select:List[str]=['Time', 'Severity', 'EventId', 'PayloadVariables', 'PayloadValues']) -> NDArray[Any]:
|
|
21
|
+
"""
|
|
22
|
+
Returns raw values from this Event within the configured period.
|
|
23
|
+
|
|
24
|
+
:param queryPeriod: An `epmwebapi.queryperiod.QueryPeriod` object with the period of time to query.
|
|
25
|
+
:type queryPeriod: epmwebapi.queryperiod.QueryPeriod
|
|
26
|
+
:param where: An optional parameter indicating the where condition to be applied. Default is None.
|
|
27
|
+
:type where: epmwebapi.elementoperand.ElementOperand
|
|
28
|
+
:param select: An optional parameter indicating the selected fields to be returned. Default is ['Time', 'Severity', 'EventId', 'PayloadVariables', 'PayloadValues'].
|
|
29
|
+
:type select: List[str]
|
|
30
|
+
:return: A numpy NDArray.
|
|
31
|
+
:rtype: np.NDArray
|
|
32
|
+
|
|
33
|
+
Examples
|
|
34
|
+
--------
|
|
35
|
+
The following examples show how to use historyRead function.
|
|
36
|
+
|
|
37
|
+
Retrives all events from a period of time:
|
|
38
|
+
|
|
39
|
+
.. code-block:: python
|
|
40
|
+
|
|
41
|
+
ini_date = dt.datetime.now(dt.timezone.utc) - dt.timedelta(hours=1)
|
|
42
|
+
end_date = dt.datetime.now(dt.timezone.utc)
|
|
43
|
+
queryPeriod = epm.QueryPeriod(ini_date, end_date)
|
|
44
|
+
typeEvent = connection.getAdvancedEvent('EventName')
|
|
45
|
+
result = typeEvent.historyRead(queryPeriod)
|
|
46
|
+
|
|
47
|
+
Retrieves all events where the Tag0023 is greater than 30 (Tag0023 must be inserted on Payload):
|
|
48
|
+
|
|
49
|
+
.. code-block:: python
|
|
50
|
+
|
|
51
|
+
ini_date = dt.datetime.now(dt.timezone.utc) - dt.timedelta(hours=1)
|
|
52
|
+
end_date = dt.datetime.now(dt.timezone.utc)
|
|
53
|
+
queryPeriod = epm.QueryPeriod(ini_date, end_date)
|
|
54
|
+
typeEvent = connection.getTypeEvent('PumpEventName')
|
|
55
|
+
where = ElementOperand(Operator.Greater, [SimpleAttributeOperand('Tag0023'), LiteralOperand(30)])
|
|
56
|
+
result = typeEvent.historyRead(queryPeriod, where)
|
|
57
|
+
|
|
58
|
+
"""
|
|
59
|
+
return self._connection._historyReadEvent(queryPeriod, self._eventPath, select, where)
|
|
60
|
+
|
|
61
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from .epmvariable import EpmVariable
|
|
2
|
+
from .filteroperand import FilterOperand
|
|
3
|
+
|
|
4
|
+
class AttributeOperand(FilterOperand):
|
|
5
|
+
"""
|
|
6
|
+
AttributeOperand class
|
|
7
|
+
"""
|
|
8
|
+
def __init__(self, variable:EpmVariable):
|
|
9
|
+
"""
|
|
10
|
+
Creates a new instance of an AttributeOperand object.
|
|
11
|
+
|
|
12
|
+
:param variable: The variable used by this operand filter.
|
|
13
|
+
:type variable: :class:`EpmVariable`.
|
|
14
|
+
"""
|
|
15
|
+
self._variable = variable
|
|
16
|
+
|
|
17
|
+
def toDict(self):
|
|
18
|
+
return {'type':'attribute', 'path':self._variable._itemPath.toDict(), 'alias': None, 'browsePath': None, 'attributeId': 13}
|
|
@@ -46,7 +46,7 @@ class AuthorizationService(object):
|
|
|
46
46
|
post_data = {"grant_type": "password",
|
|
47
47
|
"username": self._context.getUserName(),
|
|
48
48
|
"password": self._context.getPassword(),
|
|
49
|
-
"scope": "offline_access openid profile email opcua_browse opcua_read opcua_write opcua_subscription opcua_history EpmWebApi portal_files portal_upload"}
|
|
49
|
+
"scope": "offline_access openid profile email opcua_browse opcua_read opcua_write opcua_subscription opcua_history EpmWebApi portal_files portal_upload"}
|
|
50
50
|
auth_url = self._context.getAuthServer() + '/connect/token'
|
|
51
51
|
|
|
52
52
|
session = self._getSession()
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import List, Union
|
|
4
|
+
|
|
5
|
+
from .literaloperand import LiteralOperand
|
|
6
|
+
from .simpleattributeoperand import SimpleAttributeOperand
|
|
7
|
+
from .attributeoperand import AttributeOperand
|
|
8
|
+
|
|
9
|
+
from enum import Enum
|
|
10
|
+
|
|
11
|
+
class Operator(Enum):
|
|
12
|
+
"""
|
|
13
|
+
Enumeration with all types of operators
|
|
14
|
+
"""
|
|
15
|
+
Equals = "Equals"
|
|
16
|
+
IsNull = "IsNull"
|
|
17
|
+
GreaterThan = "GreaterThan"
|
|
18
|
+
LessThan = "LessThan"
|
|
19
|
+
GreaterThanOrEqual = "GreaterThanOrEqual"
|
|
20
|
+
LessThanOrEqual = "LessThanOrEqual"
|
|
21
|
+
Like = "Like"
|
|
22
|
+
Not = "Not"
|
|
23
|
+
Between = "Between"
|
|
24
|
+
InList = "InList"
|
|
25
|
+
And = "And"
|
|
26
|
+
Or = "Or"
|
|
27
|
+
Cast = "Cast"
|
|
28
|
+
InView = "InView"
|
|
29
|
+
OfType = "OfType"
|
|
30
|
+
RelatedTo = "RelatedTo"
|
|
31
|
+
BitwiseAnd = "BitwiseAnd"
|
|
32
|
+
BitwiseOr = "BitwiseOr"
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class ElementOperand(object):
|
|
36
|
+
"""
|
|
37
|
+
ElementOperand class
|
|
38
|
+
"""
|
|
39
|
+
def __init__(self, operator:Operator, operands:List[Union[SimpleAttributeOperand,AttributeOperand,LiteralOperand,ElementOperand]]):
|
|
40
|
+
"""
|
|
41
|
+
Creates a new instance of an ElementOperand object.
|
|
42
|
+
|
|
43
|
+
:param operator: The selected Operator enum.
|
|
44
|
+
:type operator: :class:`Operator`
|
|
45
|
+
:param operands: A list of filter operands that must be:
|
|
46
|
+
- :class:`SimpleAttributeOperand`: Operando for simple attributes.
|
|
47
|
+
- :class:`AttributeOperand`: Operand for generic attributes.
|
|
48
|
+
- :class:`LiteralOperand`: Operand for literal values.
|
|
49
|
+
- :class:`ElementOperand`: Operand to reference other filter elements.
|
|
50
|
+
:type operands: :class:`typing.List`
|
|
51
|
+
"""
|
|
52
|
+
self._operator = operator
|
|
53
|
+
self._operands = operands
|
|
54
|
+
|
|
55
|
+
def toDict(self):
|
|
56
|
+
return {'type':'element', 'operator': self._operator.value, 'operands': [item.toDict() for item in self._operands]}
|