Пример #1
0
	def __init__(self, report, selector):
		self.report_number = report
		self.original_report_number = report
		self.year = selector.report_list['year'][1]
		self.parsed = parse() #for parsing inputs from rows
		self.connection = connect() #connects to the DB
		self.queries = queries() #query text for all tables
		self.agg = agg() #aggregation functions for all tables

		self.json_builder_return = self.JSON_constructor_return()
		self.parse_return_string = self.parse_return()
		self.aggregation = self.aggregation_return(self.year, report)
		self.id_compiler = id_compiler()
		self.report_types = {'A':'Aggregate', 'D':'Disclosure', 'N':'National'}
Пример #2
0
	def __init__(self, report, selector):
		self.report_number = report
		self.original_report_number = report
		self.year = selector.report_list['year'][1]
		self.parsed = parse() #for parsing inputs from rows
		self.connection = connect() #connects to the DB
		self.queries = queries() #query text for all tables
		self.agg = agg() #aggregation functions for all tables

		self.json_builder = self.JSON_constructor_return()
		self.parse_return_string = self.parse_return()
		self.aggregation = self.aggregation_return(self.year, report)
		self.id_compiler = id_compiler()
		self.report_types = {'A':'Aggregate', 'D':'Disclosure', 'N':'National'}
Пример #3
0
 def initdb(self, db):
     self.db = dbclient.dbclient(db)
     self.queries = queries.queries()
     for query in self.queries.createqueries:
         self.db.dbexec(self.queries.queries[query])
Пример #4
0
 def __init__(self):
     self.dbconnector = DatabaseConnector()
     self.dataset = self.dbconnector.fetch_data(query=queries.queries('compare'))
     self.unique = self.dbconnector.fetch_data(query=queries.queries('uniquecompare'))
def main_page():
    if request.method == 'POST':
        stock_symbol = request.form['stock_symbol']
        query1 = request.form['query']
        values = show_open_close(stock_symbol)
        period = request.form['period']
        final_prediction=prediction(stock_symbol)
        fig(stock_symbol,period)
        return render_template("main_page.html", stock_symbol=stock_symbol, values=values, predicted_value=pred_final(stock_symbol), query=queries(stock_symbol,query1),period=period, final_prediction=final_prediction)

    return render_template("main_page.html", stock_symbol=0, values=[], predicted_value=0, query=0, period=0, final_prediction=0)
Пример #6
0
 def __init__(self, dbname='master.db', dbpath=DB_PATH):
     self.db_dir = dbpath
     self.master_db = os.path.join(self.db_dir, dbname)
     #print(self.master_db)
     self.con = sqlite3.connect(self.master_db,check_same_thread=False)
     self.q = queries.queries()
Пример #7
0
def time(qsize,k,number=10,sample_size=100): # Sample size = 500
    """Returns a list of times of trials of the k top results of a query of size qsize"""
    return [_time(q,k,number) for q,k in queries(qsize=qsize,K=k,sample_size=sample_size)] # times each query