class dipdup.context.DipDupContext(datasources: Dict[str, dipdup.datasources.datasource.Datasource], config: dipdup.config.DipDupConfig, callbacks: dipdup.context.CallbackManager)

Class to store application context

Parameters
  • datasources – Mapping of available datasources

  • config – DipDup configuration

  • callbacks – Low-level callback interface (intented for internal use)

  • logger – Context-aware logger instance

async execute_sql(name: str) None

Execute SQL script with given name

Parameters

name – SQL script name within <project>/sql directory

async fire_handler(name: str, index: str, datasource: dipdup.datasources.tzkt.datasource.TzktDatasource, fmt: Optional[str] = None, *args, **kwargs: Any) None

Fire handler with given name and arguments.

Parameters
  • name – Handler name

  • index – Index name

  • datasource – An instance of datasource that triggered the handler

  • fmt – Format string for ctx.logger messages

async fire_hook(name: str, fmt: Optional[str] = None, wait: bool = True, *args, **kwargs: Any) None

Fire hook with given name and arguments.

Parameters
  • name – Hook name

  • fmt – Format string for ctx.logger messages

  • wait – Wait for hook to finish or fire and forget

async reindex(reason: Optional[Union[str, dipdup.enums.ReindexingReason]] = None, **context) None

Drop the whole database and restart with the same CLI arguments

async restart() None

Restart indexer preserving CLI arguments

class dipdup.context.HandlerContext(datasources: Dict[str, dipdup.datasources.datasource.Datasource], config: dipdup.config.DipDupConfig, callbacks: dipdup.context.CallbackManager, logger: dipdup.utils.FormattedLogger, handler_config: dipdup.config.HandlerConfig, datasource: dipdup.datasources.tzkt.datasource.TzktDatasource)

Common handler context.

class dipdup.context.HookContext(datasources: Dict[str, dipdup.datasources.datasource.Datasource], config: dipdup.config.DipDupConfig, callbacks: dipdup.context.CallbackManager, logger: dipdup.utils.FormattedLogger, hook_config: dipdup.config.HookConfig)

Hook callback context.

class dipdup.context.TemplateValuesDict(ctx, **kwargs)