Files
doczyai-pipelines/fieldExtraction/scripts/postprocess_existing_output.py
T
Katon Minhas 59e5fe4532 Merged in feature/postprocess-script (pull request #843)
Add postprocess script

* Add postprocess script


Approved-by: Siddhant Medar
2026-01-22 16:05:10 +00:00

32 lines
729 B
Python

import pandas as pd
from constants.constants import Constants
from src.investment.postprocess import postprocess
# File paths
input_excel_path = "input.xlsx"
output_csv_path = "output.csv"
# Read Excel file into DataFrame
print(f"Reading Excel file: {input_excel_path}")
df = pd.read_excel(input_excel_path, dtype=str)
print(f"Loaded {len(df)} rows from Excel")
# Initialize Constants
constants = Constants()
# Process the DataFrame
print("Processing data through postprocess()...")
df_processed = postprocess(df, constants)
print(f"Processing complete. Output has {len(df_processed)} rows")
# Write to CSV
print(f"Writing CSV file: {output_csv_path}")
df_processed.to_csv(output_csv_path, index=False)
print("Done!")