mbu-dev-shared-components 3.0.1__tar.gz → 3.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.
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/PKG-INFO +1 -1
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/msoffice365/sharepoint_api/files.py +15 -8
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components.egg-info/PKG-INFO +1 -1
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/pyproject.toml +1 -1
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/LICENSE +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/README.md +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/database/__init__.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/database/connection.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/database/constants.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/database/logging.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/database/utility.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/getorganized/__init__.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/getorganized/auth.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/getorganized/cases.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/getorganized/contacts.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/getorganized/documents.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/getorganized/objects.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/google/__init__.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/google/api/__init__.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/google/api/auth.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/google/workspace/__init__.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/google/workspace/alerts.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/msoffice365/__init__.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/msoffice365/excel/__init__.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/msoffice365/excel/excel_reader.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/msoffice365/sharepoint_api/__init__.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/os2forms/__init__.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/os2forms/documents.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/os2forms/forms.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/romexis/__init__.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/romexis/db_handler.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/romexis/helper_functions.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/sap/__init__.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/sap/create_invoice.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/solteqtand/__init__.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/solteqtand/application/__init__.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/solteqtand/application/app_handler.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/solteqtand/application/appointment.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/solteqtand/application/base_ui.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/solteqtand/application/clinic.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/solteqtand/application/document.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/solteqtand/application/edi_portal.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/solteqtand/application/event.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/solteqtand/application/exceptions.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/solteqtand/application/handler_base.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/solteqtand/application/journal_note.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/solteqtand/application/patient.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/solteqtand/database/__init__.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/solteqtand/database/db_handler.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/utils/__init__.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/utils/db_stored_procedure_executor.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/utils/fernet_encryptor.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/utils/file_handler.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components/utils/json_handler.py +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components.egg-info/SOURCES.txt +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components.egg-info/dependency_links.txt +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components.egg-info/requires.txt +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/mbu_dev_shared_components.egg-info/top_level.txt +0 -0
- {mbu_dev_shared_components-3.0.1 → mbu_dev_shared_components-3.0.3}/setup.cfg +0 -0
|
@@ -39,7 +39,7 @@ from pathlib import PurePath
|
|
|
39
39
|
|
|
40
40
|
from io import BytesIO
|
|
41
41
|
|
|
42
|
-
from typing import Optional, List, Dict, Any
|
|
42
|
+
from typing import Optional, List, Dict, Any, Union
|
|
43
43
|
|
|
44
44
|
from openpyxl.styles import Font, Alignment
|
|
45
45
|
from openpyxl import load_workbook
|
|
@@ -268,16 +268,22 @@ class Sharepoint:
|
|
|
268
268
|
folder_name: str = "",
|
|
269
269
|
excel_file_name: str = "",
|
|
270
270
|
sheet_name: str = "",
|
|
271
|
-
|
|
271
|
+
new_rows: Union[Dict, List[Dict]] = None,
|
|
272
272
|
) -> None:
|
|
273
273
|
"""
|
|
274
|
-
• Appends
|
|
274
|
+
• Appends one or more rows to an existing Excel file.
|
|
275
275
|
• Sorts and formats based on provided parameters.
|
|
276
276
|
"""
|
|
277
277
|
|
|
278
|
+
# Ensure new_rows is a list of dicts
|
|
279
|
+
if isinstance(new_rows, dict):
|
|
280
|
+
new_rows = [new_rows]
|
|
281
|
+
|
|
282
|
+
elif not isinstance(new_rows, list) or not all(isinstance(r, dict) for r in new_rows):
|
|
283
|
+
raise TypeError("new_rows must be a dict or a list of dicts.")
|
|
284
|
+
|
|
278
285
|
# 1. Pull file
|
|
279
286
|
binary_file = self.fetch_file_using_open_binary(excel_file_name, folder_name)
|
|
280
|
-
|
|
281
287
|
if binary_file is None:
|
|
282
288
|
raise FileNotFoundError(f"File '{excel_file_name}' not found in folder '{folder_name}'.")
|
|
283
289
|
|
|
@@ -306,8 +312,11 @@ class Sharepoint:
|
|
|
306
312
|
if all(cell is None for cell in row_values):
|
|
307
313
|
ws.delete_rows(row_idx)
|
|
308
314
|
|
|
309
|
-
# 3. Append new row
|
|
310
|
-
|
|
315
|
+
# 3. Append each new row
|
|
316
|
+
headers = [header.value for header in ws[1]]
|
|
317
|
+
|
|
318
|
+
for row_dict in new_rows:
|
|
319
|
+
ws.append([row_dict.get(header, "") for header in headers])
|
|
311
320
|
|
|
312
321
|
# 4. Save and upload
|
|
313
322
|
temp_stream = BytesIO()
|
|
@@ -318,8 +327,6 @@ class Sharepoint:
|
|
|
318
327
|
|
|
319
328
|
self.upload_file_from_bytes(temp_stream.getvalue(), excel_file_name, folder_name)
|
|
320
329
|
|
|
321
|
-
print(f"✔ Added row + sorted '{sheet_name}' in '{excel_file_name}'.")
|
|
322
|
-
|
|
323
330
|
def format_and_sort_excel_file(
|
|
324
331
|
self,
|
|
325
332
|
folder_name: str,
|
|
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
|