Ejemplo n.º 1
0
def database_check():
    if gui.UIForm.current_date_check():
        print "Database is up to date \n"
    else:
        print "Updating database \n"
        all_consumer_logs = os.listdir(c.Constants().log_path)
        log_files_already_used = database.DataBaseQueries.pull_all_used_dates()
        file_cycle.ReadLogFiles(all_consumer_logs, log_files_already_used).run()
Ejemplo n.º 2
0
 def __init__(self):
     QtCore.QThread.__init__(self)
     self.log_path = c.Constants().log_path
     self.denominator_dict = {}
     self.xml_handler = None
     self.start_date = None
     self.numerator_dict = {}
     self.numerator_compare = None
     self.denominator_compare = None
     self.soc_map = cb.QuestionDashSupport().soc_code_map()
     self.zip_file_name = "Kayla Question Activation Counts.zip"
Ejemplo n.º 3
0
def auto_email_alert():
    file_list = ["FastTrack_", "FastTrack-Edit_",
                 "JobOffer_"]
    #FROM = "*****@*****.**"
    FROM = "Data [email protected]"
    TO = ["Data [email protected]"]

    msg = MIMEMultipart()
    msg['Subject'] = "Conversion Level Alert"
    msg['To'] = 'Data [email protected]'

    body = ""
    alert_path = c.Constants().consumer_alert_files
    main_message = "The weekly conversion level tests have finished. You can find them at %s, %s, and %s" % \
                   (os.path.normpath(alert_path + file_list[0] + today + "_Conversion_Alert_Comparison.csv"),
                    os.path.normpath(alert_path + file_list[1] + today + "_Conversion_Alert_Comparison.csv"),
                    os.path.normpath(alert_path + file_list[2] + today + "_Conversion_Alert_Comparison.csv"))

    msg.attach(MIMEText(main_message))

    server = smtplib.SMTP('owa.payscale.com')
    server.sendmail(FROM, TO, msg.as_string())
    server.quit()
Ejemplo n.º 4
0
from PyQt4 import QtCore
import AnalysisTool.deserialize_xml as my_xml
import RyanBot.DataDashboard.dashboard_support as ds
dash = ds.DashboardSupport()
import AnalysisTool.extract_data_xml as extract
import Constants.constant_strings as cs
const = cs.Constants()
import DateFunctions.datetimes_in as dat
dates = dat.DateTimeFormats()
import AnalysisTool.run_queries as rq
import datetime
import os
import csv

report_measure = 'EAC Measure'
return_type = 'Medians'
ranges = 'Fixed'

file_dimension = {
    1: 'Alumni Analytics File Dimension 1',
    2: 'Alumni Analytics EducationalLevelAffiliateSchool',
    3: 'Alumni Analytics File Dimension YG',
    4: '&& ALL',
    5: '&& ALL'
}

table_dimension = {
    1: 'Alumni Analytics Table Dimension 1',
    2: 'Alumni Analytics Table Dimension Jobs',
    3: 'Alumni Analytics Table Dimension YG',
    4: 'Alumni Analytics Schools',
Ejemplo n.º 5
0
import xml.etree.cElementTree as ET
import csv
import os
import DateFunctions.datetimes_in as df
import xml.dom.minidom as minidom
from Constants import constant_strings as c

automated_dashboard_path = c.Constants().automated_dashboard_files

#helper function to create custom dimensions
def build_custom_dimension(ET, dimension_name, custom_dimension_tuple):
    sub_def = ET.SubElement(dimension_name, 'Def')
    field = ET.SubElement(sub_def, 'Field')
    field.set('xsi:type', 'StringAnswerCell')
    field.set('IsConfirmed', 'false')
    field.set('ValueId', '0')
    field.set('AnswerSetID', '0')


    props = ET.SubElement(field, 'Properties')
    name_value_one = ET.SubElement(props, 'NameValuePair')
    name_value_one.set('Name', 'fieldgroup')
    name_value_one.set('Value', custom_dimension_tuple[0])

    name_value_two = ET.SubElement(props, 'NameValuePair')
    name_value_two.set('Name', 'Field')
    name_value_two.set('Value', custom_dimension_tuple[1])

    multi_value = ET.SubElement(sub_def, 'MultiValue')
    '''May want to change this to be set as well eventually'''
    multi_value.text = 'false'
Ejemplo n.º 6
0
import csv
import sqlite3
import time
from Constants import constant_strings as c
from PyQt4 import QtCore

from AnalyticsTools.ConversionMetricsGUI import levels
from database import DataBaseQueries as dbq

constant = c.Constants()
log_path = constant.log_path
log_path_write = constant.consumer_level_conversion


class ReadLogFiles(QtCore.QThread):

    relevant_files = []
    update_progress = QtCore.pyqtSignal(int)
    update_string_progress = QtCore.pyqtSignal(str)

    def __init__(self, all_consumer_logs, log_files_already_used):
        QtCore.QThread.__init__(self)
        #self.last_updated_date = last_updated_date
        self.all_consumer_logs = all_consumer_logs
        self.log_files_already_used = log_files_already_used
        self.who_cares = [
            'Informational', 'Informational-Edit', 'JobOffer-Edit'
        ]
        self.relevant_logs()
        self.names = None
        self.month_counts = {}
Ejemplo n.º 7
0
import data_extract_thread as analysis
import DateFunctions.datetimes_in as dates
import csv
import gui_code_behind as cb
import question_database as db
import Constants.constant_strings as c
import os

data_pull_thread = analysis.ExtractDataThread()
start_date = dates.DateTimeFormats().find_first_of_last_month()
current_month = dates.DateTimeFormats().return_last_month_as_y_m("-")

out_file_path = c.Constants().question_dashboard + current_month + "\\"

if not os.path.exists(out_file_path):
    os.makedirs(out_file_path)

if not data_pull_thread.isRunning():
    data_pull_thread.get_date_non_gui(start_date)
    data_pull_thread.start()


def write_data_to_file():

    file_name = "Question_Dashboard.csv"

    update_line = "Writing to file at %s" % out_file_path
    print update_line
    with open(out_file_path + file_name, 'wb') as W:
        writer = csv.writer(W, lineterminator='\n')
Ejemplo n.º 8
0
import os
import sys
import Constants.constant_strings as c
sys.path.append(c.Constants().payscale_analytics)
import AnalysisTool.deserialize_xml as my_xml
import dashboard_support as ds


class DataDashboard:

    job_count_dict = {}
    job_iqr_dict = {}
    rollup_iqr_dict = {}
    job_model_dict = {}
    psp_reports = []
    unc_counts = {}

    def __init__(self):
        """
        This is the class that calls the admin and analysis tool
        to pull all the data used for the Taxonomy Data Dashboard
        """
        self.automated_file_path = '\\\\filer01\\public\\Data Dashboards\\Automated Dashboard Files\\'
        self.out_file = '\\\\filer01\\public\\Data Dashboards\\Temp Files\\Out Files\\'

    def run_analysis_tool_overall_jobs_reports(self):

        query = ds.DashboardSupport()
        job_files = []
        dash_files = os.listdir(self.automated_file_path)