MCPcopy
hub / github.com/microsoft/qlib / get_data

Method get_data

scripts/data_collector/pit/collector.py:195–219  ·  view source on GitHub ↗
(
        self,
        symbol: str,
        interval: str,
        start_datetime: pd.Timestamp,
        end_datetime: pd.Timestamp,
    )

Source from the content-addressed store, hash-verified

193 return growth_df
194
195 def get_data(
196 self,
197 symbol: str,
198 interval: str,
199 start_datetime: pd.Timestamp,
200 end_datetime: pd.Timestamp,
201 ) -> pd.DataFrame:
202 if interval != self.INTERVAL_QUARTERLY:
203 raise ValueError(f"cannot support {interval}")
204 symbol, exchange = symbol.split(".")
205 exchange = "sh" if exchange == "ss" else "sz"
206 code = f"{exchange}.{symbol}"
207 start_date = start_datetime.strftime("%Y-%m-%d")
208 end_date = end_datetime.strftime("%Y-%m-%d")
209
210 performance_express_report_df = self.get_performance_express_report_df(code, start_date, end_date)
211 profit_df = self.get_profit_df(code, start_date, end_date)
212 forecast_report_df = self.get_forecast_report_df(code, start_date, end_date)
213 growth_df = self.get_growth_df(code, start_date, end_date)
214
215 df = pd.concat(
216 [performance_express_report_df, profit_df, forecast_report_df, growth_df],
217 axis=0,
218 )
219 return df
220
221
222class PitNormalize(BaseNormalize):

Callers

nothing calls this directly

Calls 4

get_profit_dfMethod · 0.95
get_growth_dfMethod · 0.95

Tested by

no test coverage detected