Exemplo n.º 1
0
 def pull_xml_data_to_dict(self, start_date):
     all_files = os.listdir(output_path)
     self.change_dict_values()
     for files in all_files:
         if '.zip' not in files:
             extract.ExtractXMLData(files).fix_xml_encoding(output_path)
             self.xml_handler = extract.ExtractXMLData(
                 output_path + files).row_name_entry_handler(header=True)
             self.change_handler_values()
Exemplo n.º 2
0
    def extract_data(self):

        print "Unzipping and modifying Analysis Tool results..."
        fw.FileHandler().zip_file_open('Ryan Job Rollup Suggestor EAC.zip',
                                       self.temp_out_files)
        extract.ExtractXMLData(
            'Ryan Job Rollup Suggestor EAC_0.xml').fix_xml_encoding(
                self.temp_out_files)
        count_dict = extract.ExtractXMLData(self.temp_out_files + 'Ryan Job Rollup Suggestor EAC_0.xml')\
            .overall_medians_list_return()

        return count_dict
Exemplo n.º 3
0
    def gather_results(self):
        self.DTO = AlumniDTO()
        for xml_files in os.listdir(const.anon_out):
            if ".xml" in xml_files and 'Gina Alumni Analytics' in xml_files:
                my_xml.fix_xml_encoding(const.anon_out, xml_files)

            if 'Gina Alumni Analytics Query 1' in xml_files and '.xml' in xml_files:
                self.update_string_progress.emit("Pulling from %s... " %
                                                 (xml_files))
                data_dict = extract.ExtractXMLData(
                    const.anon_out +
                    xml_files).table_def_medians_list_handler()
                main_key = 'Gina %s Query 01' % self.affiliate_id
                self.update_dictionaries(xml_files, main_key, data_dict,
                                         self.DTO.query_01)

            elif 'Gina Alumni Analytics Query Large' in xml_files and '.xml' in xml_files:
                self.update_string_progress.emit("Pulling from %s... " %
                                                 (xml_files))
                data_dict = extract.ExtractXMLData(
                    const.anon_out +
                    xml_files).table_def_medians_list_handler()
                main_key = 'Gina %s Query 02' % self.affiliate_id
                self.update_dictionaries(xml_files, main_key, data_dict,
                                         self.DTO.query_02)

            elif 'Gina Alumni Analytics Query 2' in xml_files and '.xml' in xml_files:
                self.update_string_progress.emit("Pulling from %s... " %
                                                 (xml_files))
                data_dict = extract.ExtractXMLData(
                    const.anon_out +
                    xml_files).table_def_medians_list_handler()
                main_key = 'Gina %s Query 03' % self.affiliate_id
                self.update_dictionaries(xml_files, main_key, data_dict,
                                         self.DTO.query_03)

            elif 'Gina Alumni Analytics Query 3' in xml_files and '.xml' in xml_files:
                self.update_string_progress.emit("Pulling from %s... " %
                                                 (xml_files))
                data_dict = extract.ExtractXMLData(
                    const.anon_out +
                    xml_files).table_def_medians_list_handler()
                main_key = 'Gina %s Query 04' % self.affiliate_id
                self.update_dictionaries(xml_files, main_key, data_dict,
                                         self.DTO.query_04)

            elif 'Gina Alumni Analytics Query 4' in xml_files and '.xml' in xml_files:
                self.update_string_progress.emit("Pulling from %s... " %
                                                 (xml_files))
                data_dict = extract.ExtractXMLData(
                    const.anon_out +
                    xml_files).table_def_medians_list_handler()
                main_key = 'Gina %s Query 05' % self.affiliate_id
                self.update_dictionaries(xml_files, main_key, data_dict,
                                         self.DTO.query_05)

            elif 'Gina Alumni Analytics Query 5' in xml_files and '.xml' in xml_files:
                self.update_string_progress.emit("Pulling from %s... " %
                                                 (xml_files))
                data_dict = extract.ExtractXMLData(
                    const.anon_out +
                    xml_files).sample_def_alumni_analytics_handler()
                main_key = 'Gina %s Query 06' % self.affiliate_id
                self.update_dictionaries(xml_files, main_key, data_dict,
                                         self.DTO.query_06)
Exemplo n.º 4
0
    def pull_model_data_from_xml(xml_file):

        return extract.ExtractXMLData(xml_file).model_content_handler()
Exemplo n.º 5
0
    def pull_unconfirmed_data_from_xml(xml_file):

        return extract.ExtractXMLData(xml_file).row_name_entry_handler()
Exemplo n.º 6
0
    def pull_iqr_data_from_xml(xml_file):

        return extract.ExtractXMLData(xml_file).iqr_content_handler()
Exemplo n.º 7
0
    def pull_job_data_from_xml(xml_file):

        return extract.ExtractXMLData(xml_file).overall_data_count()
Exemplo n.º 8
0
anon_out = "\\\\filer02\\public\\Data_Analytics\\AnonReports\\TempOut\\"


class AlumniDTO:
    def __init__(self):
        self.query_01 = {}
        self.query_02 = {}
        self.query_03 = {}
        self.query_04 = {}
        self.query_05 = {}
        self.query_06 = {}


test = AlumniDTO()

for xml_files in os.listdir(anon_out):
    if ".xml" in xml_files and 'Gina Alumni Analytics Query 1' in xml_files:
        my_xml.fix_xml_encoding(anon_out, xml_files)

    if 'Gina Alumni Analytics Query 4' in xml_files and '.xml' in xml_files:
        data_dict = extract.ExtractXMLData(
            anon_out + xml_files).table_def_medians_list_handler()
        main_key = 'Gina %s Query 04' % 1234
        if main_key not in test.query_01.keys():
            test.query_01[main_key] = data_dict
        else:
            copy_dict = test.query_01[main_key]
            copy_dict.update(data_dict)
            test.query_01[main_key] = copy_dict

print test.query_01
Exemplo n.º 9
0
    def pull_medians_data(self, file_name):

        return extract.ExtractXMLData(self.temp_out_files +
                                      file_name).overall_medians_list_return()
Exemplo n.º 10
0
    def pull_monthly_count_data(self, file_name):

        return extract.ExtractXMLData(self.temp_out_files +
                                      file_name).row_name_entry_handler()
Exemplo n.º 11
0
    def pull_count_data(self, file_name):

        return extract.ExtractXMLData(self.temp_out_files +
                                      file_name).overall_data_count()