def runGenerator(filename=''):

    #Instantiating the file generator.
    file = FileGenerator(filename)
    file.create_files(kind='clean_file')
Ejemplo n.º 2
0
import os
import yaml
#This script will generate a file that will fail a specific syntax, validity, or quality edit
#(though others may also fail)
#This script relies on the presence of a clean data file

from file_generator import FileGenerator

#Instantiating the file generator.
file = FileGenerator()

#Creates quality that pass syntax and validity for each test file
#in the edits_files directory
file.create_files(kind='error_files')

#The following code validates quality edits to pass syntax and validity edits.
#Stores a list of filenames from the quality edits directory.
quality_files = os.listdir(file.filepaths['quality_filepath'].format(
    bank_name=file.data_map['name']['value']))

#Validates quality edits and stores them in a new directory specified in the test filepaths configuration.
for quality_file in quality_files:
    file.validate_quality_edit_file(quality_filename=quality_file)
#This script is used to create test files that pass all syntax and validity edits that do not require panel data.
#Configuration of the generated data is done in config.yaml.
#This script will write files to the relative path "../edits_files/"
#This script must be run before generate_error_files.py as that script relies on the presence of a clean file to modify.
#2018 Filing Instruction Guide: https://www.consumerfinance.gov/data-research/hmda/static/for-filers/2018/2018-HMDA-FIG.pdf

from file_generator import FileGenerator 

#Instantiating the file generator. 
file = FileGenerator()

file.create_files(kind='clean_file')