EntityEventRecorder

class zvt.contract.recorder.EntityEventRecorder(force_update=False, sleeping_time=10, exchanges=None, entity_id=None, entity_ids=None, code=None, codes=None, day_data=False, entity_filters=None, ignore_failed=True)

Bases: zvt.contract.recorder.Recorder

__init__(force_update=False, sleeping_time=10, exchanges=None, entity_id=None, entity_ids=None, code=None, codes=None, day_data=False, entity_filters=None, ignore_failed=True) None
Parameters
  • code

  • ignore_failed

  • entity_filters

  • exchanges

  • entity_id – for record single entity

  • entity_ids – set entity_ids or (entity_type,exchanges,codes)

  • codes

  • day_data – one record per day,set to True if you want skip recording it when data of today exist

  • force_update

  • sleeping_time

entity_provider: str = None

overwrite them to fetch the entity list

exchanges

setup the entities you want to record

entity_ids

set entity_ids or (entity_type,exchanges,codes)

init_entities()

init the entities which we would record data for

clear_state_data(entity_id=None)

clear state of the entity

Parameters

entity_id – entity id

decode_state(state: str)

decode state

Parameters

state

Returns

encode_state(state: object)

encode state

Parameters

state

Returns

state_schema

alias of zvt.contract.zvt_info.RecorderState

session

using to do db operations