mirror of
https://github.com/Hestia-Homes/survey-extraction.git
synced 2026-06-30 13:10:56 +00:00
Merge pull request #132 from Hestia-Homes/feature/live_tracker_documentation
new and improved script
This commit is contained in:
commit
f706f281fa
1 changed files with 6 additions and 25 deletions
|
|
@ -48,7 +48,7 @@ def retry(max_attempts: int = 3, base_delay: float = 1.0):
|
|||
# Folder Creation Logic (Wrapped with retry)
|
||||
# --------------------------------------------------
|
||||
|
||||
@retry(max_attempts=3)
|
||||
@retry(max_attempts=5)
|
||||
def process_asset(address: pd.Series):
|
||||
folder_name = f"{address['Name']} {address['Postcode']}"
|
||||
print(f"\n📁 Processing {folder_name}")
|
||||
|
|
@ -97,7 +97,7 @@ def process_asset(address: pd.Series):
|
|||
results = []
|
||||
failed_rows = []
|
||||
|
||||
MAX_WORKERS = 5
|
||||
MAX_WORKERS = 10
|
||||
|
||||
with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
|
||||
futures = [
|
||||
|
|
@ -121,26 +121,7 @@ print(f"❌ Failed: {len(failed_rows)}")
|
|||
if failed_rows:
|
||||
pd.DataFrame(failed_rows).to_excel("failed_rows.xlsx", index=False)
|
||||
print("📄 Saved failed rows to failed_rows.xlsx")
|
||||
# # Run this is you just want to get url
|
||||
# def just_url(asset_list):
|
||||
# new_asset_list = []
|
||||
# for index, address in tqdm(asset_list.iterrows()):
|
||||
# folder_name = address['Name'] + " " + address['Postcode']
|
||||
# webUrl = osmosis.create_dir(folder_name, parent_folder)
|
||||
# asset_data = {
|
||||
# "Name": address['Name'],
|
||||
# "Postcode": address['Postcode'],
|
||||
# "Sharepoint": webUrl,
|
||||
# }
|
||||
# print(asset_data)
|
||||
|
||||
# new_asset_list.append(asset_data)
|
||||
# return new_asset_list
|
||||
|
||||
# # new_asset_list = just_url(asset_list=asset_list)
|
||||
|
||||
# df = pd.DataFrame(new_asset_list)
|
||||
# df.to_csv("output.csv", index=False)
|
||||
|
||||
|
||||
|
||||
if results:
|
||||
results_df = pd.DataFrame(results)
|
||||
results_df.to_csv("sharepoint_results.csv", index=False)
|
||||
print("📄 Saved successful results to sharepoint_results.csv")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue