layrz-sdk 3.1.9__tar.gz → 3.1.10__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 layrz-sdk might be problematic. Click here for more details.
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/CHANGELOG.md +4 -0
- {layrz_sdk-3.1.9/layrz_sdk.egg-info → layrz_sdk-3.1.10}/PKG-INFO +1 -1
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/bar_chart.py +4 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/column_chart.py +4 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/html_chart.py +4 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/line_chart.py +4 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/map_chart.py +4 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/number_chart.py +4 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/pie_chart.py +4 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/radar_chart.py +4 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/radial_bar_chart.py +4 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/scatter_chart.py +4 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/table_chart.py +4 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/timeline_chart.py +4 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/report.py +25 -7
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/helpers/color.py +3 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/lcl/core.py +16 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10/layrz_sdk.egg-info}/PKG-INFO +1 -1
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/pyproject.toml +1 -1
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/uv.lock +1 -1
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/.github/workflows/checks.yml +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/.github/workflows/deploy.yml +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/.gitignore +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/.vscode/extensions.json +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/.vscode/settings.json +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/CODE_OF_CONDUCT.md +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/CONTRIBUTING.md +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/LICENSE +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/README.md +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/__init__.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/constants.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/__init__.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/asset.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/asset_operation_mode.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/broadcast_request.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/broadcast_response.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/broadcast_result.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/broadcast_status.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/case.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/case_ignored_status.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/case_status.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/axis_config.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/chart_alignment.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/chart_color.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/chart_configuration.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/chart_data_serie.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/chart_data_serie_type.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/chart_data_type.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/chart_render_technology.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/map_center_type.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/map_point.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/scatter_serie.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/scatter_serie_item.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/table_header.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/table_row.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/timeline_serie.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/charts/timeline_serie_item.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/checkpoint.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/comment.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/custom_field.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/custom_report_page.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/device.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/event.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/geofence.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/last_message.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/message.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/outbound_service.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/position.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/presence_type.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/report_col.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/report_configuration.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/report_data_type.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/report_format.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/report_header.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/report_page.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/report_row.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/sensor.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/text_alignment.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/trigger.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/user.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/entities/waypoint.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/helpers/__init__.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/lcl/__init__.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk/py.typed +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk.egg-info/SOURCES.txt +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk.egg-info/dependency_links.txt +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk.egg-info/requires.txt +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/layrz_sdk.egg-info/top_level.txt +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/manual_deploy.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/setup.cfg +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/tests/__init__.py +0 -0
- {layrz_sdk-3.1.9 → layrz_sdk-3.1.10}/tests/test_lcl.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: layrz-sdk
|
|
3
|
-
Version: 3.1.
|
|
3
|
+
Version: 3.1.10
|
|
4
4
|
Summary: Layrz SDK for Python
|
|
5
5
|
Author-email: "Golden M, Inc." <software@goldenm.com>
|
|
6
6
|
Maintainer-email: Kenny Mochizuki <kenny@goldenm.com>, Luis Reyes <lreyes@goldenm.com>, Kasen Li <kli@goldenm.com>
|
|
@@ -39,8 +39,12 @@ class BarChart(BaseModel):
|
|
|
39
39
|
) -> Dict[str, Any]:
|
|
40
40
|
"""
|
|
41
41
|
Render chart to a graphic Library.
|
|
42
|
+
|
|
42
43
|
:param technology: The technology to use to render the chart.
|
|
44
|
+
:type technology: ChartRenderTechnology
|
|
45
|
+
|
|
43
46
|
:return: The configuration of the chart.
|
|
47
|
+
:rtype: Dict[str, Any]
|
|
44
48
|
"""
|
|
45
49
|
if technology == ChartRenderTechnology.GRAPHIC:
|
|
46
50
|
return {
|
|
@@ -40,8 +40,12 @@ class ColumnChart(BaseModel):
|
|
|
40
40
|
) -> Any:
|
|
41
41
|
"""
|
|
42
42
|
Render chart to a graphic Library.
|
|
43
|
+
|
|
43
44
|
:param technology: The technology to use to render the chart.
|
|
45
|
+
:type technology: ChartRenderTechnology
|
|
46
|
+
|
|
44
47
|
:return: The configuration of the chart.
|
|
48
|
+
:rtype: Dict[str, Any]
|
|
45
49
|
"""
|
|
46
50
|
if technology == ChartRenderTechnology.GRAPHIC:
|
|
47
51
|
return {
|
|
@@ -20,8 +20,12 @@ class HTMLChart(BaseModel):
|
|
|
20
20
|
def render(self: Self) -> Dict[str, Any]:
|
|
21
21
|
"""
|
|
22
22
|
Render chart to a graphic Library.
|
|
23
|
+
|
|
23
24
|
:param technology: The technology to use to render the chart.
|
|
25
|
+
:type technology: ChartRenderTechnology
|
|
26
|
+
|
|
24
27
|
:return: The configuration of the chart.
|
|
28
|
+
:rtype: Dict[str, Any]
|
|
25
29
|
"""
|
|
26
30
|
return {'library': 'HTML', 'configuration': self._render_html()}
|
|
27
31
|
|
|
@@ -40,8 +40,12 @@ class LineChart(BaseModel):
|
|
|
40
40
|
def render(self: Self, technology: ChartRenderTechnology) -> Dict[str, Any]:
|
|
41
41
|
"""
|
|
42
42
|
Render chart to a graphic Library.
|
|
43
|
+
|
|
43
44
|
:param technology: The technology to use to render the chart.
|
|
45
|
+
:type technology: ChartRenderTechnology
|
|
46
|
+
|
|
44
47
|
:return: The configuration of the chart.
|
|
48
|
+
:rtype: Dict[str, Any]
|
|
45
49
|
"""
|
|
46
50
|
|
|
47
51
|
if technology == ChartRenderTechnology.GRAPHIC:
|
|
@@ -26,8 +26,12 @@ class MapChart(BaseModel):
|
|
|
26
26
|
def render(self: Self, technology: ChartRenderTechnology = ChartRenderTechnology.FLUTTER_MAP) -> Dict[str, Any]:
|
|
27
27
|
"""
|
|
28
28
|
Render chart to a graphic Library.
|
|
29
|
+
|
|
29
30
|
:param technology: The technology to use to render the chart.
|
|
31
|
+
:type technology: ChartRenderTechnology
|
|
32
|
+
|
|
30
33
|
:return: The configuration of the chart.
|
|
34
|
+
:rtype: Dict[str, Any]
|
|
31
35
|
"""
|
|
32
36
|
if technology == ChartRenderTechnology.FLUTTER_MAP:
|
|
33
37
|
return {
|
|
@@ -23,8 +23,12 @@ class NumberChart(BaseModel):
|
|
|
23
23
|
def render(self: Self, technology: ChartRenderTechnology = ChartRenderTechnology.FLUTTER) -> Dict[str, Any]:
|
|
24
24
|
"""
|
|
25
25
|
Render chart to a graphic Library.
|
|
26
|
+
|
|
26
27
|
:param technology: The technology to use to render the chart.
|
|
28
|
+
:type technology: ChartRenderTechnology
|
|
29
|
+
|
|
27
30
|
:return: The configuration of the chart.
|
|
31
|
+
:rtype: Dict[str, Any]
|
|
28
32
|
"""
|
|
29
33
|
if technology == ChartRenderTechnology.FLUTTER:
|
|
30
34
|
return {
|
|
@@ -28,8 +28,12 @@ class PieChart(BaseModel):
|
|
|
28
28
|
) -> Dict[str, Any]:
|
|
29
29
|
"""
|
|
30
30
|
Render chart to a graphic Library.
|
|
31
|
+
|
|
31
32
|
:param technology: The technology to use to render the chart.
|
|
33
|
+
:type technology: ChartRenderTechnology
|
|
34
|
+
|
|
32
35
|
:return: The configuration of the chart.
|
|
36
|
+
:rtype: Dict[str, Any]
|
|
33
37
|
"""
|
|
34
38
|
if technology == ChartRenderTechnology.GRAPHIC:
|
|
35
39
|
return {
|
|
@@ -26,8 +26,12 @@ class RadarChart(BaseModel):
|
|
|
26
26
|
def render(self: Self) -> Dict[str, Any]:
|
|
27
27
|
"""
|
|
28
28
|
Render chart to a graphic Library.
|
|
29
|
+
|
|
29
30
|
:param technology: The technology to use to render the chart.
|
|
31
|
+
:type technology: ChartRenderTechnology
|
|
32
|
+
|
|
30
33
|
:return: The configuration of the chart.
|
|
34
|
+
:rtype: Dict[str, Any]
|
|
31
35
|
"""
|
|
32
36
|
return {'library': 'APEXCHARTS', 'configuration': self._render_apexcharts()}
|
|
33
37
|
|
|
@@ -28,8 +28,12 @@ class RadialBarChart(BaseModel):
|
|
|
28
28
|
) -> Dict[str, Any]:
|
|
29
29
|
"""
|
|
30
30
|
Render chart to a graphic Library.
|
|
31
|
+
|
|
31
32
|
:param technology: The technology to use to render the chart.
|
|
33
|
+
:type technology: ChartRenderTechnology
|
|
34
|
+
|
|
32
35
|
:return: The configuration of the chart.
|
|
36
|
+
:rtype: Dict[str, Any]
|
|
33
37
|
"""
|
|
34
38
|
if technology == ChartRenderTechnology.GRAPHIC:
|
|
35
39
|
return {
|
|
@@ -38,8 +38,12 @@ class ScatterChart(BaseModel):
|
|
|
38
38
|
) -> Dict[str, Any]:
|
|
39
39
|
"""
|
|
40
40
|
Render chart to a graphic Library.
|
|
41
|
+
|
|
41
42
|
:param technology: The technology to use to render the chart.
|
|
43
|
+
:type technology: ChartRenderTechnology
|
|
44
|
+
|
|
42
45
|
:return: The configuration of the chart.
|
|
46
|
+
:rtype: Dict[str, Any]
|
|
43
47
|
"""
|
|
44
48
|
if technology == ChartRenderTechnology.GRAPHIC:
|
|
45
49
|
return {
|
|
@@ -24,8 +24,12 @@ class TableChart(BaseModel):
|
|
|
24
24
|
def render(self: Self, technology: ChartRenderTechnology = ChartRenderTechnology.FLUTTER) -> Dict[str, Any]:
|
|
25
25
|
"""
|
|
26
26
|
Render chart to a graphic Library.
|
|
27
|
+
|
|
27
28
|
:param technology: The technology to use to render the chart.
|
|
29
|
+
:type technology: ChartRenderTechnology
|
|
30
|
+
|
|
28
31
|
:return: The configuration of the chart.
|
|
32
|
+
:rtype: Dict[str, Any]
|
|
29
33
|
"""
|
|
30
34
|
if technology == ChartRenderTechnology.FLUTTER:
|
|
31
35
|
return {
|
|
@@ -24,8 +24,12 @@ class TimelineChart(BaseModel):
|
|
|
24
24
|
def render(self: Self) -> Dict[str, Any]:
|
|
25
25
|
"""
|
|
26
26
|
Render chart to a graphic Library.
|
|
27
|
+
|
|
27
28
|
:param technology: The technology to use to render the chart.
|
|
29
|
+
:type technology: ChartRenderTechnology
|
|
30
|
+
|
|
28
31
|
:return: The configuration of the chart.
|
|
32
|
+
:rtype: Dict[str, Any]
|
|
29
33
|
"""
|
|
30
34
|
return {'library': 'APEXCHARTS', 'configuration': self._render_apexcharts()}
|
|
31
35
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
4
|
import os
|
|
5
|
+
import sys
|
|
5
6
|
import time
|
|
6
7
|
import warnings
|
|
7
8
|
from pathlib import Path
|
|
@@ -17,6 +18,11 @@ from .report_data_type import ReportDataType
|
|
|
17
18
|
from .report_format import ReportFormat
|
|
18
19
|
from .report_page import ReportPage
|
|
19
20
|
|
|
21
|
+
if sys.version_info >= (3, 11):
|
|
22
|
+
from typing import Self
|
|
23
|
+
else:
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
20
26
|
log = logging.getLogger(__name__)
|
|
21
27
|
|
|
22
28
|
|
|
@@ -31,7 +37,7 @@ class Report(BaseModel):
|
|
|
31
37
|
export_format: Optional[ReportFormat] = Field(description='Export format of the report', default=None)
|
|
32
38
|
|
|
33
39
|
@field_validator('export_format', mode='before')
|
|
34
|
-
def _validate_export_format(cls, value: Any) -> Any:
|
|
40
|
+
def _validate_export_format(cls: 'Report', value: Any) -> Any:
|
|
35
41
|
if value is not None:
|
|
36
42
|
warnings.warn(
|
|
37
43
|
'export_format is deprecated, use the export method instead',
|
|
@@ -42,13 +48,13 @@ class Report(BaseModel):
|
|
|
42
48
|
return value
|
|
43
49
|
|
|
44
50
|
@property
|
|
45
|
-
def filename(self) -> str:
|
|
51
|
+
def filename(self: Self) -> str:
|
|
46
52
|
"""Report filename"""
|
|
47
53
|
return f'{self.name}_{int(time.time() * 1000)}.xlsx'
|
|
48
54
|
|
|
49
55
|
def export(
|
|
50
|
-
self,
|
|
51
|
-
path: str,
|
|
56
|
+
self: Self,
|
|
57
|
+
path: str | Path,
|
|
52
58
|
export_format: Optional[ReportFormat] = None,
|
|
53
59
|
password: Optional[str] = None,
|
|
54
60
|
msoffice_crypt_path: str = '/opt/msoffice/bin/msoffice-crypt.exe',
|
|
@@ -57,9 +63,13 @@ class Report(BaseModel):
|
|
|
57
63
|
Export report to file
|
|
58
64
|
|
|
59
65
|
:param path: Path to save the report
|
|
66
|
+
:type path: str | Path
|
|
60
67
|
:param export_format: Format to export the report
|
|
68
|
+
:type export_format: ReportFormat
|
|
61
69
|
:param password: Password to protect the file (Only works with Microsoft Excel format)
|
|
70
|
+
:type password: str
|
|
62
71
|
:param msoffice_crypt_path: Path to the msoffice-crypt.exe executable, used to encrypt the file
|
|
72
|
+
:type msoffice_crypt_path: str
|
|
63
73
|
:return: Full path of the exported file or JSON representation of the report
|
|
64
74
|
:rtype: Path | dict
|
|
65
75
|
:raises AttributeError: If the export format is not supported
|
|
@@ -83,11 +93,11 @@ class Report(BaseModel):
|
|
|
83
93
|
else:
|
|
84
94
|
raise AttributeError(f'Unsupported export format: {self.export_format}')
|
|
85
95
|
|
|
86
|
-
def export_as_json(self) -> Dict[str, Any]:
|
|
96
|
+
def export_as_json(self: Self) -> Dict[str, Any]:
|
|
87
97
|
"""Returns the report as a JSON dict"""
|
|
88
98
|
return self._export_json()
|
|
89
99
|
|
|
90
|
-
def _export_json(self) -> Dict[str, Any]:
|
|
100
|
+
def _export_json(self: Self) -> Dict[str, Any]:
|
|
91
101
|
"""Returns a JSON dict of the report"""
|
|
92
102
|
json_pages = []
|
|
93
103
|
for page in self.pages:
|
|
@@ -135,17 +145,25 @@ class Report(BaseModel):
|
|
|
135
145
|
}
|
|
136
146
|
|
|
137
147
|
def _export_xlsx(
|
|
138
|
-
self,
|
|
148
|
+
self: Self,
|
|
139
149
|
path: str | Path,
|
|
140
150
|
password: Optional[str] = None,
|
|
141
151
|
msoffice_crypt_path: Optional[str] = None,
|
|
142
152
|
) -> Path:
|
|
143
153
|
"""
|
|
144
154
|
Export to Microsoft Excel (.xslx)
|
|
155
|
+
|
|
145
156
|
:param path: Path to save the report
|
|
157
|
+
:type path: str | Path
|
|
146
158
|
:param password: Password to protect the file
|
|
159
|
+
:type password: str
|
|
147
160
|
:param msoffice_crypt_path: Path to the msoffice-crypt.exe executable, used to encrypt the file
|
|
161
|
+
:type msoffice_crypt_path: str
|
|
162
|
+
|
|
148
163
|
:return: Full path of the exported file
|
|
164
|
+
:rtype: Path
|
|
165
|
+
|
|
166
|
+
:raises AttributeError: If the export format is not supported
|
|
149
167
|
"""
|
|
150
168
|
|
|
151
169
|
if isinstance(path, str):
|
|
@@ -8,10 +8,13 @@ Color: TypeAlias = Tuple[int, int, int, int]
|
|
|
8
8
|
def convert_to_rgba(hex_color: str) -> Color:
|
|
9
9
|
"""
|
|
10
10
|
Convert Hex (or Hexa) color to RGB (or RGBA) color
|
|
11
|
+
|
|
11
12
|
:param hex_color: Hex color
|
|
12
13
|
:type hex_color: str
|
|
14
|
+
|
|
13
15
|
:return: RGB or RGBA color
|
|
14
16
|
:rtype: tuple
|
|
17
|
+
|
|
15
18
|
:raises ValueError: If the color is invalid
|
|
16
19
|
"""
|
|
17
20
|
|
|
@@ -26,12 +26,22 @@ class LclCore:
|
|
|
26
26
|
) -> None:
|
|
27
27
|
"""
|
|
28
28
|
Creates a new instance of LclCore
|
|
29
|
+
|
|
29
30
|
:param script: Script to be executed
|
|
31
|
+
:type script: str
|
|
30
32
|
:param sensors: Sensors dictionary
|
|
33
|
+
:type sensors: Optional[PayloadType]
|
|
31
34
|
:param previous_sensors: Previous sensors dictionary
|
|
35
|
+
:type previous_sensors: Optional[PayloadType]
|
|
32
36
|
:param payload: Payload dictionary
|
|
37
|
+
:type payload: Optional[PayloadType]
|
|
33
38
|
:param asset_constants: Asset constants dictionary
|
|
39
|
+
:type asset_constants: Optional[Dict[str, Any]]
|
|
34
40
|
:param custom_fields: Custom fields dictionary
|
|
41
|
+
:type custom_fields: Optional[Dict[str, Any]]
|
|
42
|
+
|
|
43
|
+
:return: None
|
|
44
|
+
:rtype: None
|
|
35
45
|
"""
|
|
36
46
|
if sensors is None:
|
|
37
47
|
sensors = {}
|
|
@@ -61,8 +71,14 @@ class LclCore:
|
|
|
61
71
|
) -> str:
|
|
62
72
|
"""
|
|
63
73
|
Perform script using Layrz Compute Language
|
|
74
|
+
|
|
64
75
|
:param additional_globals: Additional global variables
|
|
76
|
+
:type additional_globals: Optional[Dict[str, Any]]
|
|
65
77
|
:param additional_locals: Additional local variables
|
|
78
|
+
:type additional_locals: Optional[Dict[str, Any]]
|
|
79
|
+
|
|
80
|
+
:return: Result of the script in JSON format
|
|
81
|
+
:rtype: str
|
|
66
82
|
"""
|
|
67
83
|
try:
|
|
68
84
|
local_variables = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: layrz-sdk
|
|
3
|
-
Version: 3.1.
|
|
3
|
+
Version: 3.1.10
|
|
4
4
|
Summary: Layrz SDK for Python
|
|
5
5
|
Author-email: "Golden M, Inc." <software@goldenm.com>
|
|
6
6
|
Maintainer-email: Kenny Mochizuki <kenny@goldenm.com>, Luis Reyes <lreyes@goldenm.com>, Kasen Li <kli@goldenm.com>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|