DataReader

class zvt.contract.reader.DataReader(data_schema: Type[zvt.contract.schema.Mixin], entity_schema: Optional[Type[zvt.contract.schema.TradableEntity]] = None, provider: Optional[str] = None, entity_provider: Optional[str] = None, entity_ids: Optional[List[str]] = None, exchanges: Optional[List[str]] = None, codes: Optional[List[str]] = None, start_timestamp: Optional[Union[pandas._libs.tslibs.timestamps.Timestamp, str]] = None, end_timestamp: Union[str, pandas._libs.tslibs.timestamps.Timestamp] = Timestamp('2024-06-16 15:33:22.419779'), columns: Optional[List] = None, filters: Optional[List] = None, order: Optional[object] = None, limit: Optional[int] = None, level: Optional[zvt.contract.IntervalLevel] = None, category_field: str = 'entity_id', time_field: str = 'timestamp', keep_window: Optional[int] = None)

Bases: zvt.contract.drawer.Drawable

__init__(data_schema: Type[zvt.contract.schema.Mixin], entity_schema: Optional[Type[zvt.contract.schema.TradableEntity]] = None, provider: Optional[str] = None, entity_provider: Optional[str] = None, entity_ids: Optional[List[str]] = None, exchanges: Optional[List[str]] = None, codes: Optional[List[str]] = None, start_timestamp: Optional[Union[pandas._libs.tslibs.timestamps.Timestamp, str]] = None, end_timestamp: Union[str, pandas._libs.tslibs.timestamps.Timestamp] = Timestamp('2024-06-16 15:33:22.419779'), columns: Optional[List] = None, filters: Optional[List] = None, order: Optional[object] = None, limit: Optional[int] = None, level: Optional[zvt.contract.IntervalLevel] = None, category_field: str = 'entity_id', time_field: str = 'timestamp', keep_window: Optional[int] = None) None
move_on(to_timestamp: Optional[Union[pandas._libs.tslibs.timestamps.Timestamp, str]] = None, timeout: int = 20) object

using continual fetching data in realtime 1)get the data happened before to_timestamp,if not set,get all the data which means to now 2)if computing_window set,the data_df would be cut for saving memory

Parameters
  • to_timestamp

  • timeout (int) –

Returns

Return type