layrz-sdk 3.1.7__py3-none-any.whl → 3.1.9__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 layrz-sdk might be problematic. Click here for more details.

@@ -8,5 +8,5 @@ from pydantic import BaseModel, Field
8
8
  class BroadcastRequest(BaseModel):
9
9
  """Broadcast request data"""
10
10
 
11
- json: Any = Field(description='Parsed data')
11
+ parsed: Any = Field(description='Parsed data')
12
12
  raw: str = Field(description='Raw data')
@@ -8,5 +8,5 @@ from pydantic import BaseModel, Field
8
8
  class BroadcastResponse(BaseModel):
9
9
  """Broadcast response data"""
10
10
 
11
- json: Any = Field(description='Parsed data')
11
+ parsed: Any = Field(description='Parsed data')
12
12
  raw: str = Field(description='Raw data')
@@ -4,6 +4,7 @@ import logging
4
4
  import os
5
5
  import time
6
6
  import warnings
7
+ from pathlib import Path
7
8
  from typing import Any, Dict, List, Optional
8
9
 
9
10
  import xlsxwriter
@@ -51,7 +52,7 @@ class Report(BaseModel):
51
52
  export_format: Optional[ReportFormat] = None,
52
53
  password: Optional[str] = None,
53
54
  msoffice_crypt_path: str = '/opt/msoffice/bin/msoffice-crypt.exe',
54
- ) -> str | Dict[str, Any]:
55
+ ) -> Path | Dict[str, Any]:
55
56
  """
56
57
  Export report to file
57
58
 
@@ -60,7 +61,7 @@ class Report(BaseModel):
60
61
  :param password: Password to protect the file (Only works with Microsoft Excel format)
61
62
  :param msoffice_crypt_path: Path to the msoffice-crypt.exe executable, used to encrypt the file
62
63
  :return: Full path of the exported file or JSON representation of the report
63
- :rtype: str | dict
64
+ :rtype: Path | dict
64
65
  :raises AttributeError: If the export format is not supported
65
66
  """
66
67
  if export_format:
@@ -135,10 +136,10 @@ class Report(BaseModel):
135
136
 
136
137
  def _export_xlsx(
137
138
  self,
138
- path: str,
139
+ path: str | Path,
139
140
  password: Optional[str] = None,
140
141
  msoffice_crypt_path: Optional[str] = None,
141
- ) -> str:
142
+ ) -> Path:
142
143
  """
143
144
  Export to Microsoft Excel (.xslx)
144
145
  :param path: Path to save the report
@@ -147,7 +148,14 @@ class Report(BaseModel):
147
148
  :return: Full path of the exported file
148
149
  """
149
150
 
150
- full_path = os.path.join(path, self.filename)
151
+ if isinstance(path, str):
152
+ path = Path(path).resolve()
153
+
154
+ full_path = path / self.filename
155
+ if full_path.exists():
156
+ log.warning(f'File {full_path} already exists, overwriting it')
157
+ os.remove(full_path)
158
+
151
159
  book = xlsxwriter.Workbook(full_path)
152
160
 
153
161
  pages_name: List[str] = []
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: layrz-sdk
3
- Version: 3.1.7
3
+ Version: 3.1.9
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>
@@ -21,6 +21,7 @@ Requires-Dist: xlsxwriter
21
21
  Requires-Dist: tzdata
22
22
  Requires-Dist: pydantic>=2.10.6
23
23
  Requires-Dist: typing-extensions>=4.10.0
24
+ Dynamic: license-file
24
25
 
25
26
  # Layrz SDK
26
27
 
@@ -4,8 +4,8 @@ layrz_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  layrz_sdk/entities/__init__.py,sha256=Z_FnKRGVYH9pnrUcCJJBaYmoVOA67hQ-5iyDf7Ryva4,3823
5
5
  layrz_sdk/entities/asset.py,sha256=PsuGFSnpTf10vwk6cxcA1OOSstANZNKFQJeHFySPq-g,2209
6
6
  layrz_sdk/entities/asset_operation_mode.py,sha256=FANfXq5k_4Nk3dvDZwlMrgl3XozmQyOttXRiQvoaFps,665
7
- layrz_sdk/entities/broadcast_request.py,sha256=tuC8xDwYrHNzvM-rfEK-wQAPSJaTMirXENCp9fTUoOA,270
8
- layrz_sdk/entities/broadcast_response.py,sha256=qMu2qZ0jWubN9R3lwi_MKnsSnCKWav7lP6JfWBuHh8s,273
7
+ layrz_sdk/entities/broadcast_request.py,sha256=65j4X1rhWEikftX3fiNl8YWRHu7nNs5bdRRzXhq3kSo,272
8
+ layrz_sdk/entities/broadcast_response.py,sha256=iV2R2JGIGHxJRSAiEwnw4SGOMPXby8P5Yp2eQF6ia6s,275
9
9
  layrz_sdk/entities/broadcast_result.py,sha256=KlUjb5beH9-SDw6KygWE6TGYS5QQGaLUH25BaCWcowY,706
10
10
  layrz_sdk/entities/broadcast_status.py,sha256=N_sszSFPIG3PKER9QYYI66E15xpnOm1QRMlqfrF7r08,620
11
11
  layrz_sdk/entities/case.py,sha256=Q65BsH4NKBAzsnnriXXhl79ErHUr06OhejtJkxt54WA,1793
@@ -23,7 +23,7 @@ layrz_sdk/entities/message.py,sha256=WS36Zm0FwvbzCZ7Tywtqvgb_hPy_Rtg4WZ1sskeQEx4
23
23
  layrz_sdk/entities/outbound_service.py,sha256=h1B23WFfBAiUZxf-SdlgJn2yib_qxCRc8a1KlGq7d1I,235
24
24
  layrz_sdk/entities/position.py,sha256=j2WLAUcYVIVSGv_u8_dyLNFL4XXKQ96pXwzpvWjDaIo,2825
25
25
  layrz_sdk/entities/presence_type.py,sha256=aR14DlVNxtm9ZC4DjCD2QBELY3Zu1JdWHrDLW3dYEiI,309
26
- layrz_sdk/entities/report.py,sha256=qEsUs7QJzQoBAgDhqGDVtTe2RsDbgcF64PaPKjaTCaw,8482
26
+ layrz_sdk/entities/report.py,sha256=vl9aWry6M5fKAVkooKqcSKnbXujLNx8c8quNK3e1PBY,8702
27
27
  layrz_sdk/entities/report_col.py,sha256=iyRG81UDw-xXqGUN-nFaA1CPz4bUllAzxDki92cwN1s,1401
28
28
  layrz_sdk/entities/report_configuration.py,sha256=pG_P-_LG78MJ0FxINwWze2Oo4YVylKSSshZcLyF4xDI,244
29
29
  layrz_sdk/entities/report_data_type.py,sha256=-ck2hBmDcgWJpT9z_cUxbEOy-Yq0OaYfzjSSz5uj2w0,525
@@ -68,8 +68,8 @@ layrz_sdk/helpers/__init__.py,sha256=uWW-TbDdmAJ8w8Pjr7B3xjEJi6BzCsqzThj2974H3nM
68
68
  layrz_sdk/helpers/color.py,sha256=McSoqsWKQ6suW14LMzwkdvruutm5xyvpE057IlBWm0Y,1248
69
69
  layrz_sdk/lcl/__init__.py,sha256=T9yk0RccanRnnITbw5tTxWld1gZFG6ySjvZ9G16mxPU,101
70
70
  layrz_sdk/lcl/core.py,sha256=R740h8EYKQwIUJ2TPwTrmctbl_LkCb8z4lP3fmruiNA,25161
71
- layrz_sdk-3.1.7.dist-info/LICENSE,sha256=h4aQZdgkHkEP6_m5wPfTsdDRdWOOgP7G_10OgDNmBf4,1063
72
- layrz_sdk-3.1.7.dist-info/METADATA,sha256=LL_2XDDmwygd77ml_ZJ8yHqvhl2r7CvuwO36diSFPyo,1877
73
- layrz_sdk-3.1.7.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
74
- layrz_sdk-3.1.7.dist-info/top_level.txt,sha256=yUTMMzfdZ0HDWQH5TaSlFM4xtwmP1fSGxmlL1dmu4l4,10
75
- layrz_sdk-3.1.7.dist-info/RECORD,,
71
+ layrz_sdk-3.1.9.dist-info/licenses/LICENSE,sha256=h4aQZdgkHkEP6_m5wPfTsdDRdWOOgP7G_10OgDNmBf4,1063
72
+ layrz_sdk-3.1.9.dist-info/METADATA,sha256=aHzxReLxRpae2OHq1XQhQ4TT6k7SqjfBzLvfk_S3Xhc,1900
73
+ layrz_sdk-3.1.9.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
74
+ layrz_sdk-3.1.9.dist-info/top_level.txt,sha256=yUTMMzfdZ0HDWQH5TaSlFM4xtwmP1fSGxmlL1dmu4l4,10
75
+ layrz_sdk-3.1.9.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (76.1.0)
2
+ Generator: setuptools (77.0.3)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5