59e5fe4532
Add postprocess script * Add postprocess script Approved-by: Siddhant Medar
32 lines
729 B
Python
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!")
|
|
|
|
|
|
|
|
|
|
|
|
|