2024-10-28 23:39:36 +00:00
|
|
|
import utils
|
|
|
|
|
import config
|
|
|
|
|
|
|
|
|
|
import pandas as pd
|
|
|
|
|
|
|
|
|
|
print(f"Input Dir: {config.LOCAL_PATH}")
|
|
|
|
|
print(f"S3 Bucket: {config.S3_BUCKET}")
|
|
|
|
|
print(f"S3 Prefix: {config.S3_PREFIX}")
|
|
|
|
|
|
2024-11-04 22:54:31 +00:00
|
|
|
input_dict = (
|
|
|
|
|
utils.read_input()
|
|
|
|
|
) # keys are contract names, values are full contract text
|
2024-10-28 23:39:36 +00:00
|
|
|
total_files = len(input_dict)
|
|
|
|
|
|
2024-11-04 22:54:31 +00:00
|
|
|
print(f"Total Input Files : {len(input_dict)}")
|
2024-10-28 23:39:36 +00:00
|
|
|
|
2024-11-04 22:54:31 +00:00
|
|
|
# Filter B
|
|
|
|
|
input_dict_b = {
|
2024-11-13 17:08:19 +00:00
|
|
|
k: v for k, v in input_dict.items() if utils.contains_reimbursement(str(v))
|
2024-11-04 22:54:31 +00:00
|
|
|
} # Filter out non-contracts
|
2024-10-28 23:39:36 +00:00
|
|
|
print(
|
2024-11-04 22:54:31 +00:00
|
|
|
f"B Input Files after reimbursement filter: {len(input_dict_b)} | {total_files-len(input_dict_b)} files removed"
|
2024-10-28 23:39:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Filter already processed
|
|
|
|
|
if config.FILTER_ALREADY_PROCESSED:
|
2024-11-13 17:08:19 +00:00
|
|
|
input_dict_ac, input_dict_b = utils.filter_already_processed(
|
|
|
|
|
input_dict, input_dict_b
|
|
|
|
|
)
|
2024-11-04 22:54:31 +00:00
|
|
|
print(f"AC Input Files left to be processed : {len(input_dict_ac)}")
|
2024-11-13 17:08:19 +00:00
|
|
|
print(f"B Input Files left to be processed : {len(input_dict_b)}")
|