save state

This commit is contained in:
Jun-te Kim 2025-05-30 09:09:36 +00:00
parent f2c2abc4da
commit 48b807da20

View file

@ -10,6 +10,8 @@ from etl.scraper.scraper import SharePointScraper
# board_id = "4965130190"
# liz green
board_id = "6097500103"
# Cocuun
# board_id = "5185076280"
monday_key = "eyJhbGciOiJIUzI1NiJ9.eyJ0aWQiOjQ5ODc2ODQxOCwiYWFpIjoxMSwidWlkIjozNjE3ODAzNCwiaWFkIjoiMjAyNS0wNC0xMVQxMToyMzoxNy40NjdaIiwicGVyIjoibWU6d3JpdGUiLCJhY3RpZCI6MTM5OTc4MjMsInJnbiI6InVzZTEifQ.-2Lit4s46ZF6AXuMW9t0TxIaFLkHqD4Yo-PyM9i2XZY"
monday = MondayClient(monday_key)
@ -24,6 +26,7 @@ parent_folder = "/Osmosis ACD/Osmosis ACD Projects/"
# Change this per installer
# parent_folder += "Stonewater/Wates/REDO"
parent_folder += "Installer Documentation/Platform Housing Group/Liv Green"
# parent_folder += "Installer Documentation/Platform Housing Group/Cocuun/REDO"
import re
@ -32,7 +35,7 @@ def sanitize_name(name: str, ignore_dot = False) -> str:
if ignore_dot:
name = ''.join(char for char in name if char.isalnum() or char.isspace() or char == ")" or char == "(").strip()
else:
name = ''.join(char for char in name if char.isalnum() or char.isspace() or char == "." or char == ")" or char == "(").strip()
name = ''.join(char for char in name if char.isalnum() or char.isspace() or char == "." or char == ")" or char == "(" or char == "-" or char == "_").strip()
name = re.sub(r'\s+', ' ', name)
# Remove or replace other SharePoint-invalid characters if necessary
@ -138,7 +141,7 @@ if not name_id or not files_id:
items = get_all_items(board_id, monday)
for i,item in enumerate(tqdm(items)):
if i>123:
if i>329:
item_name = item["name"]
item_name = sanitize_name(item_name, ignore_dot=True)
print(f"Item name is {item_name}")