<jupyter_start><jupyter_text>LOG<jupyter_code>import glob
import os
import yaml
from fddc.log.cin_log import build_cinrecord
from fddc.log.annexa_log import build_annexarecord
from fddc.log.log import build_log<jupyter_output><empty_output><jupyter_text>Config<jupyter_code># Config file
with open('config/cin_to_annexa.yaml') as FILE:
    config = yaml.load(FILE, Loader=yaml.FullLoader)

# Output file
output_file = 'log.csv'<jupyter_output><empty_output><jupyter_text>Define if the log includes CIN Census and / or Annex A. At least one must be True.<jupyter_code># CIN
include_cincensus = True

# CIN data
cin_folder = '.../clean_cin' # Change filepath if needed
cin_files = glob.glob(os.path.join(cin_folder, "*.xml"))
# Annex A
include_annexa = False

# Consolidated Annex A
annexa_file = 'annex-a-cleaned.xlsx' # Change filepath if needed<jupyter_output><empty_output><jupyter_text>Run programme (takes a few minutes depending on quantity of data)<jupyter_code># 1/ Create CIN log
cin = build_cinrecord(cin_files, include_cincensus)

# 2/ Create Annex A log
annexa = build_annexarecord(annexa_file, include_annexa)

# 3/ Create master log
log = build_log(annexa, cin, output_file, config)
log.head()<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup