def get_update_log(self):
     file_name = self.file_name_dict['update_log']
     # check if file exists
     if file_name in self.update_csv.blobs:
         df = download_blob(self.storage_client, self.bucket_name,
                            file_name)
     else:
         df = None
     return df
 def get_finno_status_ts(self):
     file_name = self.file_name_dict['finno_port_status']
     # check if file exists
     if file_name in self.update_csv.blobs:
         df = download_blob(self.storage_client, self.bucket_name,
                            file_name)
     else:
         df = None
     return df
 def get_finno_compo(self):
     file_name = self.file_name_dict['finno_port_compo']
     # check if file exists
     if file_name in self.update_csv.blobs:
         df = download_blob(self.storage_client,
                            self.bucket_name,
                            file_name,
                            header=[0, 1])
     else:
         df = None
     return df
    def __init__(self, bucket_name='portfolio-dashboard-poch.appspot.com'):

        self.storage_client = storage.Client()
        self.bucket_name = bucket_name

        self.usr_pass = download_blob(self.storage_client, self.bucket_name,
                                      'usr_pass.yaml')
        self.finno_api = finnomenaAPI(
            email=self.usr_pass['finnomena']['usr'],
            password=self.usr_pass['finnomena']['password'])

        self.file_name_dict = load_yaml('config/keys.yaml')['file_name']

        self.update_csv = UpdateCSV()
Beispiel #5
0
 def download_blob(self, blob_name,header=0):
     data = download_blob(self.storage_client, self.bucket_name, blob_name, header=header)      
     return data