Skip to content

updater module

Classes for scheduling data updates.


DataUpdater class

DataUpdater(
    data,
    schedule_manager=None,
    update_kwargs=None,
    **kwargs
)

Base class for scheduling data updates.

Args

data : Data
Data instance.
update_kwargs : dict
Default keyword arguments for DataSaver.update.
**kwargs
Keyword arguments passed to the constructor of Configured.

Superclasses

Inherited members

Subclasses


data property

Data instance.

See Data.


schedule_manager property

Schedule manager instance.

See ScheduleManager.


update method

DataUpdater.update(
    **kwargs
)

Method that updates data.

Override to do pre- and postprocessing.

To stop this method from running again, raise CancelledError.


update_every method

DataUpdater.update_every(
    *args,
    to=None,
    tags=None,
    in_background=False,
    replace=True,
    start=True,
    start_kwargs=None,
    **update_kwargs
)

Schedule DataUpdater.update() as a job.

For *args, to and tags, see ScheduleManager.every().

If in_background is set to True, starts in the background as an asyncio task. The task can be stopped with ScheduleManager.stop().

If replace is True, will delete scheduled jobs with the same tags, or all jobs if tags are omitted.

If start is False, will add the job to the scheduler without starting.

**update_kwargs are merged over DataUpdater.update_kwargs and passed to DataUpdater.update().


update_kwargs property

Keyword arguments passed to DataSaver.update.