예제 #1
0
                'pb_ratio': 'pb',
                'ps_ratio': 'ps',
                'pcf_ratio': 'pcf'
            },
            axis='columns')

        df['market_cap'] = df['market_cap'] * 100000000
        df['circulating_market_cap'] = df['circulating_market_cap'] * 100000000
        df['capitalization'] = df['capitalization'] * 10000
        df['circulating_cap'] = df['circulating_cap'] * 10000
        df['turnover_ratio'] = df['turnover_ratio'] * 0.01
        df_to_db(df=df,
                 data_schema=self.data_schema,
                 provider=self.provider,
                 force_update=self.force_update)

        return None


__all__ = ['JqChinaStockValuationRecorder']

if __name__ == '__main__':
    # 上证50
    df = Etf.get_stocks(code='510050')
    stocks = df.stock_id.tolist()
    print(stocks)
    print(len(stocks))

    JqChinaStockValuationRecorder(entity_ids=['stock_sh_600000'],
                                  force_update=True).run()
예제 #2
0
                "ps_ratio": "ps",
                "pcf_ratio": "pcf"
            },
            axis="columns",
        )

        df["market_cap"] = df["market_cap"] * 100000000
        df["circulating_market_cap"] = df["circulating_market_cap"] * 100000000
        df["capitalization"] = df["capitalization"] * 10000
        df["circulating_cap"] = df["circulating_cap"] * 10000
        df["turnover_ratio"] = df["turnover_ratio"] * 0.01
        df_to_db(df=df,
                 data_schema=self.data_schema,
                 provider=self.provider,
                 force_update=self.force_update)

        return None


if __name__ == "__main__":
    # 上证50
    df = Etf.get_stocks(code="510050")
    stocks = df.stock_id.tolist()
    print(stocks)
    print(len(stocks))

    JqChinaStockValuationRecorder(entity_ids=["stock_sz_300999"],
                                  force_update=True).run()
# the __all__ is generated
__all__ = ["JqChinaStockValuationRecorder"]
예제 #3
0
        df['circulating_cap'] *= 10000
        df['turnover_ratio'] *= 0.01

        if 'timestamp' not in df.columns:
            df['timestamp'] = pd.to_datetime(
                df[self.get_original_time_field()])
        elif not isinstance(df['timestamp'].dtypes, datetime):
            df['timestamp'] = pd.to_datetime(df['timestamp'])

        df['entity_id'] = entity.id
        df['provider'] = self.provider.value
        df['code'] = entity.code
        df['name'] = entity.name

        df['id'] = self.generate_domain_id(entity, df)
        return df


if __name__ == '__main__':
    # 上证50
    df = Etf.get_stocks(timestamp=now_pd_timestamp(Region.CHN), code='510050')
    stocks = df.stock_id.tolist()
    print(stocks)
    print(len(stocks))

    JqChinaStockValuationRecorder(entity_ids=['stock_sh_600000'],
                                  force_update=True).run()

# the __all__ is generated
__all__ = ['JqChinaStockValuationRecorder']
예제 #4
0
 def get_etf_list(provider: Provider):
     Etf.record_data(provider=provider, sleeping_time=0)