INNER CODE UNIT · Python
determine_items_to_extract
lefterisloukas/edgar-crawler · extract_items.py:163
def determine_items_to_extract(self, filing_metadata) -> None:
"""
Determine the items to extract based on the filing type.
Sets the items_to_extract attribute based on the filing type and the items provided by the user.
"""
if filing_metadata["Type"] == "10-K":
items_list = item_list_10k
elif filing_metadata["Type"] == "8-K":
# Prior to August 23, 2004, the 8-K items were named differently
obsolete_cutoff_date_8k = pd.to_datetime("2004-08-23")
if pd.to_datetime(filing_metadata["Date"]) > obsolete_cutoff_date_8k:
items_list = item_list_8k
else:
items_list = item_list_8k_obsolete
elif filing_metadata["Type"] == "10-Q":
items_list = item_list_10q
else: