logs-py 3.0.13__py3-none-any.whl → 3.0.15__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.

Potentially problematic release.


This version of logs-py might be problematic. Click here for more details.

@@ -14,6 +14,13 @@ from LOGS.Auxiliary.MinimalModelGenerator import (
14
14
  from LOGS.Entities.BridgeMinimal import BridgeMinimal
15
15
  from LOGS.Entities.DataSourceRelations import DataSourceRelations
16
16
  from LOGS.Entities.DataSourceStatus import DataSourceStatus
17
+ from LOGS.Entities.DataSourceStatusHistoryIterator import (
18
+ DataSourceStatusHistoryIterator,
19
+ )
20
+ from LOGS.Entities.DataSourceStatusHistoryRequestParameter import (
21
+ DataSourceHistoryOrder,
22
+ DataSourceStatusHistoryRequestParameter,
23
+ )
17
24
  from LOGS.Entities.FileExcludePattern import FileExcludePattern
18
25
  from LOGS.Entities.Format import Format
19
26
  from LOGS.Entities.FormatMinimal import FormatMinimal
@@ -95,6 +102,15 @@ class DataSource(
95
102
  if responseError:
96
103
  raise EntityAPIException(entity=self, responseError=responseError)
97
104
 
105
+ @property
106
+ def history(self) -> Optional[DataSourceStatusHistoryIterator]:
107
+ return DataSourceStatusHistoryIterator(
108
+ self._connection,
109
+ DataSourceStatusHistoryRequestParameter(
110
+ dataSourceIds=[self.id], orderby=DataSourceHistoryOrder.STARTED_ON_DESC
111
+ ),
112
+ )
113
+
98
114
  @property
99
115
  def enabled(self) -> Optional[bool]:
100
116
  return self._enabled
@@ -0,0 +1,135 @@
1
+ from datetime import datetime
2
+ from typing import List, Optional
3
+
4
+ from LOGS.Auxiliary.Decorators import Endpoint
5
+ from LOGS.Entities.BridgeType import BridgeType
6
+ from LOGS.Entities.RunState import RunState
7
+ from LOGS.Entity.EntityWithIntId import IEntityWithIntId
8
+ from LOGS.Entity.SerializableContent import SerializableClass
9
+ from LOGS.LOGSConnection import LOGSConnection
10
+
11
+
12
+ class DataSourceStatusError(SerializableClass):
13
+ message: Optional[str] = None
14
+
15
+
16
+ @Endpoint("data_sources_status")
17
+ class DataSourceStatusHistory(IEntityWithIntId):
18
+ _type: Optional[BridgeType] = None
19
+ _uuid: Optional[str] = None
20
+ _lastUpdated: Optional[datetime] = None
21
+ _counter: Optional[int] = None
22
+ _dataSourceId: Optional[int] = None
23
+ _runState: Optional[RunState] = None
24
+ _startedOn: Optional[datetime] = None
25
+ _duration: Optional[float] = None
26
+ _errors: Optional[List[DataSourceStatusError]] = None
27
+ _info: Optional[dict] = None
28
+
29
+ def __init__(
30
+ self,
31
+ ref=None,
32
+ id: Optional[int] = None,
33
+ connection: Optional[LOGSConnection] = None,
34
+ ):
35
+ """Represents a connected LOGS entity type"""
36
+
37
+ self._type = None
38
+ self._bridge = None
39
+ self._format = None
40
+ self._customImport = None
41
+ self._enabled = None
42
+ self._bridgeId = None
43
+ self._formats = None
44
+ self._directories = None
45
+ self._intervalInSeconds = None
46
+ self._method = None
47
+ self._instrument = None
48
+ self._cutoffDate = None
49
+ self._customImportId = None
50
+ self._status = None
51
+ self._info = None
52
+
53
+ super().__init__(ref=ref, id=id, connection=connection)
54
+
55
+ @property
56
+ def type(self) -> Optional[BridgeType]:
57
+ return self._type
58
+
59
+ @type.setter
60
+ def type(self, value):
61
+ self._type = self.checkAndConvertNullable(value, BridgeType, "type")
62
+
63
+ @property
64
+ def uuid(self) -> Optional[str]:
65
+ return self._uuid
66
+
67
+ @uuid.setter
68
+ def uuid(self, value):
69
+ self._uuid = self.checkAndConvertNullable(value, str, "uuid")
70
+
71
+ @property
72
+ def lastUpdated(self) -> Optional[datetime]:
73
+ return self._lastUpdated
74
+
75
+ @lastUpdated.setter
76
+ def lastUpdated(self, value):
77
+ self._lastUpdated = self.checkAndConvertNullable(value, datetime, "lastUpdated")
78
+
79
+ @property
80
+ def counter(self) -> Optional[int]:
81
+ return self._counter
82
+
83
+ @counter.setter
84
+ def counter(self, value):
85
+ self._counter = self.checkAndConvertNullable(value, int, "counter")
86
+
87
+ @property
88
+ def dataSourceId(self) -> Optional[int]:
89
+ return self._dataSourceId
90
+
91
+ @dataSourceId.setter
92
+ def dataSourceId(self, value):
93
+ self._dataSourceId = self.checkAndConvertNullable(value, int, "dataSourceId")
94
+
95
+ @property
96
+ def runState(self) -> Optional[RunState]:
97
+ return self._runState
98
+
99
+ @runState.setter
100
+ def runState(self, value):
101
+ self._runState = self.checkAndConvertNullable(value, RunState, "runState")
102
+
103
+ @property
104
+ def startedOn(self) -> Optional[datetime]:
105
+ return self._startedOn
106
+
107
+ @startedOn.setter
108
+ def startedOn(self, value):
109
+ self._startedOn = self.checkAndConvertNullable(value, datetime, "startedOn")
110
+
111
+ @property
112
+ def duration(self) -> Optional[float]:
113
+ return self._duration
114
+
115
+ @duration.setter
116
+ def duration(self, value):
117
+ self._duration = self.checkAndConvertNullable(value, float, "duration")
118
+
119
+ @property
120
+ def errors(self) -> Optional[List[DataSourceStatusError]]:
121
+ return self._errors
122
+
123
+ @errors.setter
124
+ def errors(self, value):
125
+ self._errors = self.checkListAndConvertNullable(
126
+ value, DataSourceStatusError, "errors"
127
+ )
128
+
129
+ @property
130
+ def info(self) -> Optional[dict]:
131
+ return self._info
132
+
133
+ @info.setter
134
+ def info(self, value):
135
+ self._info = self.checkAndConvertNullable(value, dict, "info")
@@ -0,0 +1,16 @@
1
+ from LOGS.Auxiliary.Decorators import Endpoint
2
+ from LOGS.Entities.DataSourceStatusHistory import DataSourceStatusHistory
3
+ from LOGS.Entities.DataSourceStatusHistoryRequestParameter import (
4
+ DataSourceStatusHistoryRequestParameter,
5
+ )
6
+ from LOGS.Entity.EntityIterator import EntityIterator
7
+
8
+
9
+ @Endpoint("data_sources_status")
10
+ class DataSourceStatusHistoryIterator(
11
+ EntityIterator[DataSourceStatusHistory, DataSourceStatusHistoryRequestParameter]
12
+ ):
13
+ """LOGS connected class DataSource iterator"""
14
+
15
+ _generatorType = DataSourceStatusHistory
16
+ _parameterType = DataSourceStatusHistoryRequestParameter
@@ -0,0 +1,34 @@
1
+ from dataclasses import dataclass
2
+ from datetime import datetime
3
+ from enum import Enum
4
+ from typing import List, Optional
5
+
6
+ from LOGS.Entities.BridgeType import BridgeType
7
+ from LOGS.Entities.IRelatedEntityRequest import IRelatedEntityRequest
8
+ from LOGS.Entities.RunState import RunState
9
+ from LOGS.Entity.EntityRequestParameter import EntityRequestParameter
10
+ from LOGS.Interfaces.INamedEntity import INamedEntityRequest
11
+ from LOGS.Interfaces.IPermissionedEntity import IPermissionedEntityRequest
12
+
13
+
14
+ class DataSourceHistoryOrder(Enum):
15
+ ID_ASC = "ID_ASC"
16
+ ID_DESC = "ID_DESC"
17
+ STARTED_ON_ASC = "STARTED_ON_ASC"
18
+ STARTED_ON_DESC = "STARTED_ON_DESC"
19
+
20
+
21
+ @dataclass
22
+ class DataSourceStatusHistoryRequestParameter(
23
+ EntityRequestParameter[DataSourceHistoryOrder],
24
+ INamedEntityRequest,
25
+ IRelatedEntityRequest,
26
+ IPermissionedEntityRequest,
27
+ ):
28
+ dataSourceIds: Optional[List[int]] = None
29
+ types: Optional[List[BridgeType]] = None
30
+ runStates: Optional[List[RunState]] = None
31
+ durationInSecondsMin: Optional[float] = None
32
+ durationInSecondsMax: Optional[float] = None
33
+ startedOnFrom: Optional[datetime] = None
34
+ startedOnTo: Optional[datetime] = None
@@ -4,9 +4,9 @@ from LOGS.Entities.DataSourceRequestParameter import DataSourceRequestParameter
4
4
  from LOGS.Entity.EntityIterator import EntityIterator
5
5
 
6
6
 
7
- @Endpoint("autoload_configurations")
7
+ @Endpoint("data_sources")
8
8
  class DataSources(EntityIterator[DataSource, DataSourceRequestParameter]):
9
- """LOGS connected class AutouploadSource iterator"""
9
+ """LOGS connected class DataSource iterator"""
10
10
 
11
11
  _generatorType = DataSource
12
12
  _parameterType = DataSourceRequestParameter
LOGS/Entities/__init__.py CHANGED
@@ -36,6 +36,9 @@ from .DatasetUploadParameter import *
36
36
  from .DataSource import *
37
37
  from .DataSourceMinimal import *
38
38
  from .DataSourceRequestParameter import *
39
+ from .DataSourceStatusHistory import *
40
+ from .DataSourceStatusHistoryIterator import *
41
+ from .DataSourceStatusHistoryRequestParameter import *
39
42
  from .Datatrack import *
40
43
  from .DatatrackFormattedTable import *
41
44
  from .DatatrackImage import *
@@ -52,11 +55,16 @@ from .ExperimentRequestParameter import *
52
55
  from .Experiments import *
53
56
  from .FileEntry import *
54
57
  from .Format import *
58
+ from .FormatFormatMinimal import *
55
59
  from .FormatFormatRequestParameter import *
60
+ from .FormatInstrumentMinimal import *
56
61
  from .FormatInstrumentRequestParameter import *
62
+ from .FormatMethod import *
63
+ from .FormatMethodMinimal import *
57
64
  from .FormatMethodRequestParameter import *
58
65
  from .FormatMinimal import *
59
66
  from .FormatRequestParameter import *
67
+ from .FormatVendorMinimal import *
60
68
  from .FormatVendorRequestParameter import *
61
69
  from .HierarchyLeaf import *
62
70
  from .HierarchyNode import *
@@ -2,7 +2,7 @@ import inspect
2
2
  import json
3
3
  import math
4
4
  import random
5
- from datetime import datetime
5
+ from datetime import datetime, timezone
6
6
  from enum import Enum
7
7
  from typing import (
8
8
  Any,
@@ -292,6 +292,10 @@ class SerializableContent:
292
292
  l[i] = self._serializeItem(v)
293
293
  d[k] = l
294
294
  elif isinstance(a, datetime):
295
+ a = a.astimezone(
296
+ timezone.utc
297
+ ) # we convert all datetimes to UTC for the LOGS server
298
+
295
299
  # if not a.tzinfo:
296
300
  # a.replace(tzinfo=tzlocal.get_localzone())
297
301
  # print(">>>", a.strftime("%Y-%m-%dT%H:%M:%S.%fZ"))
@@ -604,12 +608,13 @@ class SerializableContent:
604
608
  m.unshiftPath(k)
605
609
  elif isinstance(text, list):
606
610
  for i in range(0, len(text)):
607
- text[i], messages = cls.replaceControlCharacters(
611
+ s, messages = cls.replaceControlCharacters(
608
612
  text[i],
609
613
  excludeKeys=excludeKeys,
610
614
  excludeCharacters=excludeCharacters,
611
615
  mergeMessages=mergeMessages,
612
616
  )
617
+ text[i] = str(s)
613
618
  if messages:
614
619
  for m in messages:
615
620
  m.unshiftPath(i)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: logs-py
3
- Version: 3.0.13
3
+ Version: 3.0.15
4
4
  Summary: A python interface for the LOGS public API
5
5
  Home-page: https://docs.logs-python.com
6
6
  Author: Sina Kazemi
@@ -48,12 +48,15 @@ LOGS/Entities/CustomTypeRelations.py,sha256=zTo81K9ZOgRHQ5pN7gbAKnolh1-bu6C8pGra
48
48
  LOGS/Entities/CustomTypeRequestParameter.py,sha256=Dj66a45ivFGgLq5L72KxcVrFOik8NDeVugX09-oxZwo,2371
49
49
  LOGS/Entities/CustomTypeSection.py,sha256=1Znbq5xrqXFyfbwMcEgVsNLRACpKPVDV2oaRZaCcMts,1141
50
50
  LOGS/Entities/CustomTypes.py,sha256=aUSnWZ7xIpNlFqzoLfJebbLMPBFft1QliOQ5QtGzPMY,452
51
- LOGS/Entities/DataSource.py,sha256=EM7Dqa9uACB8spI6aniVjcSt-qG5t_cF8X_-0CpRslo,6884
51
+ LOGS/Entities/DataSource.py,sha256=K6Kwp2nVNAcPsAsHNbxp7PmkxFLukSP51Frv5YxuLcU,7453
52
52
  LOGS/Entities/DataSourceMinimal.py,sha256=KlejLccyZR_AP2LvFQgCJXpcmWwtaOg6rRTVsXXlODI,261
53
53
  LOGS/Entities/DataSourceRelations.py,sha256=eIszpHjZqz6v4WyhaPNu8efSzedsJLNrYR9b3hCa3HY,658
54
54
  LOGS/Entities/DataSourceRequestParameter.py,sha256=zAfC61NvVt4XO3HhIy1PLViN3AEBJo7Q6Fa_EtyqNvA,1610
55
55
  LOGS/Entities/DataSourceStatus.py,sha256=LIMesU020i1clMiTxvO3hAoESf4B1-fXsDGMMtWLdsM,427
56
- LOGS/Entities/DataSources.py,sha256=UU5ey98_vX4WQknyWITMy-dPOV-wgjblXxu5uXpnVso,481
56
+ LOGS/Entities/DataSourceStatusHistory.py,sha256=HBQOuuP8uqycysf81PdX4qjPiMYNJaZ5VbAhvKGwS0I,3909
57
+ LOGS/Entities/DataSourceStatusHistoryIterator.py,sha256=BzN32WSRVW_cvRntooqcaS6D7qCctNzOBFOpckTk4fk,610
58
+ LOGS/Entities/DataSourceStatusHistoryRequestParameter.py,sha256=vdhG7CC1A1iB-q3_C2ratAlSAq4BkzJOD7o_U58AtFY,1174
59
+ LOGS/Entities/DataSources.py,sha256=YLQef__hHUyEtkCF8VCHifWN8nKO049jCoXeb0Btf5Y,464
57
60
  LOGS/Entities/Dataset.py,sha256=VFPccmTCEsMH-WKd-MyqA9bbGl4CeZxNNzMZ9lHClOM,27758
58
61
  LOGS/Entities/DatasetCreator.py,sha256=GJ2e0pcYt5ziVqREViBM_uq45K3rm3FG_3NqIOjrO3Y,3253
59
62
  LOGS/Entities/DatasetInfo.py,sha256=GVs9dxE2ufMfiuhgKXDcN-GEi2VrZPM1TMBLwtsfMU0,4972
@@ -179,7 +182,7 @@ LOGS/Entities/TrackXY.py,sha256=klLXkgK9hkXdSIiTPbpGxnWoBf-fymOxJ4BJtcc97Cc,1332
179
182
  LOGS/Entities/TrackXYComplex.py,sha256=Ts8UusoZY81P8OX4gWgHfSEKiUflT3cr8oUoqFXuc0I,1698
180
183
  LOGS/Entities/TrackXYComplexData.py,sha256=xWd3_jdXa347Gh53NYIMo66nFirA60Zd2KxaPs4KHaY,1368
181
184
  LOGS/Entities/TrackXYData.py,sha256=6AbwG2qa2HN858ROLaLpzkuIlwsb8tN8wznaiKplRdo,819
182
- LOGS/Entities/__init__.py,sha256=CxPw9F8WKDAn1z514YIJ_tZoq3oPHhC9TodDP7Kuz2g,3800
185
+ LOGS/Entities/__init__.py,sha256=L2akPaKwPQA8H-1pB6i6ekeb-Zb3kzabqRIUuPysHBY,4113
183
186
  LOGS/Entities/FormattedTable/DatatypeFormattedTable.py,sha256=M5rL0UZdXfylHANrTXKqAnnrML_rEUeMMBFyQEIyto4,3588
184
187
  LOGS/Entities/FormattedTable/DatatypeFormattedTableCell.py,sha256=1nBVgWqRecnUWHFwiO0oAqgChYtNSE3VQBxIAjPRjWk,2792
185
188
  LOGS/Entities/FormattedTable/DatatypeFormattedTableSettings.py,sha256=Eox_JyXtm6g29lt5kG_RBwD45ioWTg7F_5T36oZbPpY,308
@@ -228,7 +231,7 @@ LOGS/Entity/EntityRequestParameter.py,sha256=ZeA8SOCCrwXZIpe4dIk3yqBc_KLsIv5gqwc
228
231
  LOGS/Entity/EntityWithIntId.py,sha256=B79VqAQ9I0uEQwbf3DMHXoi064gCw4fv3vCKoXwrHQM,631
229
232
  LOGS/Entity/EntityWithStrId.py,sha256=5hz8-F_t_X4kf85DMwW3DJ2NqH_RiRV1Io1WiMN11yk,631
230
233
  LOGS/Entity/IdIterator.py,sha256=syaf7ygWPhbpSM3Sa5oukGi4wW9KiYInK8Ry61U85N8,6216
231
- LOGS/Entity/SerializableContent.py,sha256=yQfc_ktbyH2VA_PTOsDpaFUzuV6G1XGO30ygR23Igmg,22132
234
+ LOGS/Entity/SerializableContent.py,sha256=ZF4uFqU4UsHrCb-olXvDxNOwleYY0M2pKWqkQ7z3AfQ,22310
232
235
  LOGS/Entity/__init__.py,sha256=IQ_V00xy6yJzf5wnvGpoW3MoFab1o7drifkgKa8EHWY,719
233
236
  LOGS/Interfaces/ICreationRecord.py,sha256=SpACPwz2zA60pkApErZelUOsPq40fHAfiFW3vm9qW9k,1461
234
237
  LOGS/Interfaces/ICustomField.py,sha256=rAMnUKW9wMxgUfkXUFECCclggYt9aGKgXlIep67sEo4,726
@@ -255,7 +258,7 @@ LOGS/Parameters/ParameterElement.py,sha256=fr6AlO_flKRygZZFx1OILP4P-2lV2Tx4PAe6W
255
258
  LOGS/Parameters/ParameterList.py,sha256=ijukB1__iKI5cefmOIIWz0wKaPz9Cx8KpD7Y7Gz2Pn0,1478
256
259
  LOGS/Parameters/ParameterTable.py,sha256=7Lew4DPgWmKcpV1T-1Pvt00kEI05FB383QqO-LHAjds,1758
257
260
  LOGS/Parameters/__init__.py,sha256=KpMSuBPx964v2YMZ1BqVp8vjrgSpuiW9KYBm-aejRuc,312
258
- logs_py-3.0.13.dist-info/METADATA,sha256=wYBZPvRrsD2qIMUK94IcMI1lHbcEyVPcnJpKcmjz97Y,2340
259
- logs_py-3.0.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
260
- logs_py-3.0.13.dist-info/top_level.txt,sha256=Ckn2LiAmGaR7k3tdEnKAc04z_uboMD4gLreYghRNdCs,5
261
- logs_py-3.0.13.dist-info/RECORD,,
261
+ logs_py-3.0.15.dist-info/METADATA,sha256=CeQq8aTBEbD_lO3blXPImHYrKrzxTa7uDtyGTivQAn4,2340
262
+ logs_py-3.0.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
263
+ logs_py-3.0.15.dist-info/top_level.txt,sha256=Ckn2LiAmGaR7k3tdEnKAc04z_uboMD4gLreYghRNdCs,5
264
+ logs_py-3.0.15.dist-info/RECORD,,