예제 #1
0
 def run(self):
     df = em_api.get_tradable_list(entity_type="stockus")
     self.logger.info(df)
     df_to_db(df=df,
              data_schema=self.data_schema,
              provider=self.provider,
              force_update=self.force_update)
예제 #2
0
 def run(self):
     for exchange in [Exchange.sh, Exchange.sz]:
         df = em_api.get_tradable_list(entity_type='stock',
                                       exchange=exchange)
         self.logger.info(df)
         df_to_db(df=df,
                  data_schema=self.data_schema,
                  provider=self.provider,
                  force_update=True)
예제 #3
0
    def run(self):
        df_south = em_api.get_tradable_list(entity_type="stockhk",
                                            hk_south=True)
        df_south = df_south.set_index("code", drop=False)
        df_south["south"] = True

        df = em_api.get_tradable_list(entity_type="stockhk")
        df = df.set_index("code", drop=False)
        df_other = df.loc[~df.index.isin(df_south.index)].copy()
        df_other["south"] = False
        df_to_db(df=df_south,
                 data_schema=self.data_schema,
                 provider=self.provider,
                 force_update=self.force_update)
        df_to_db(df=df_other,
                 data_schema=self.data_schema,
                 provider=self.provider,
                 force_update=self.force_update)
예제 #4
0
 def run(self):
     for block_category in [BlockCategory.concept, BlockCategory.industry]:
         df = em_api.get_tradable_list(entity_type="block", block_category=block_category)
         self.logger.info(df)
         df_to_db(df=df, data_schema=self.data_schema, provider=self.provider, force_update=self.force_update)