Skip to main content

Doover Scheduler

Easily manage schedules within your application using the Doover Scheduler.

This library provides a simple way to check the next scheduled time for a task and receive callbacks when a schedule window is started or ended.

Installation

The library is published to PyPI, so you can install it using uv or pip:

uv add doover-scheduler
# or
pip install doover-scheduler

You can install the latest development version directly from GitHub:

uv add git+https://github.com/spaneng/doover-scheduler.git
# or
pip install git+https://github.com/spaneng/doover-scheduler.git

Usage

This first example shows how to use the callbacks to get notified when a schedule starts or ends.

import doover_scheduler

from pydoover.docker import Application

class MyApp(Application):
    async def setup(self):
        self.scheduler = doover_scheduler.ScheduleController(self.device_agent)
        self.scheduler.register(self.on_schedule_start, self.on_schedule_end, self.on_schedule_update)
        await self.scheduler.setup()

        # add a UI component to the application for the scheduler
        self.ui_manager.add_children(doover_scheduler.ScheduleComponent())

    async def main_loop(self):
        await self.scheduler.main_loop()

    @doover_scheduler.on_start
    async def on_schedule_start(self, timeslot):
        print(f"Schedule started: {timeslot}")

    @doover_scheduler.on_end
    async def on_schedule_end(self, timeslot):
        print(f"Schedule finished: {timeslot}")
        
    @doover_scheduler.on_update
    async def on_schedule_update(self, new_schedule):
        print(f"Someone updated the schedule on the website: {new_schedule}")

The second example shows how to check the next scheduled time for a task.

import time

import doover_scheduler

from pydoover.docker import Application

class MyApp(Application):
    async def setup(self):
        self.scheduler = doover_scheduler.ScheduleController(self.device_agent)
        await self.scheduler.setup()
        
        # add a UI component to the application for the scheduler
        self.ui_manager.add_children(doover_scheduler.ScheduleComponent())

    async def main_loop(self):
        await self.scheduler.main_loop()
        
        current_timeslot = self.scheduler.current_timeslot
        if current_timeslot:
            print(f"The current timeslot will finish in {int(current_timeslot.end_time - time.time())} seconds.")

        next_timeslot = self.scheduler.next_timeslot
        if next_timeslot:
            print(f"The next scheduled timeslot will start in {int(next_timeslot - time.time())} seconds.")

Contributing

For more information, please reach out to the maintainers at hello@doover.com

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Metadata

Release files for doover-scheduler 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for doover-scheduler 0.1.1
File Size Uploaded
doover_scheduler-0.1.1.tar.gz 916.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for doover-scheduler 0.1.1
File Interpreter ABI Platform
doover_scheduler-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 925.1 kB

Release files / doover_scheduler-0.1.1.tar.gz

Download URL doover_scheduler-0.1.1.tar.gz
Size 916.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8db4e49952f2b7e0de5e5acca4ff2681b9daa1df1e822eeacd711560ce766b13
BLAKE2b-256 checksum
How to use checksums
0e662bdce1375c3cab7a984b38964ef58948e117c415e805483df0a63b98ba51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.3

Release files / doover_scheduler-0.1.1-py3-none-any.whl

Download URL doover_scheduler-0.1.1-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38c52808bb96e1dea9537f79658774b3cf9efc3fe5c0e4a245aab35e8107c5a0
BLAKE2b-256 checksum
How to use checksums
77fa307f0b38620d17784c20372cb6c80ca2f0c13c7f672a5da00a839287cd03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.3

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page