# 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:
```bash
uv add doover-scheduler
# or
pip install doover-scheduler
```
You can install the latest development version directly from GitHub:
```bash
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.
```python
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.
```python
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](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": null,
"name": "doover-scheduler",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "doover, doover-scheduler, scheduler",
"author": null,
"author_email": "Doover Team <developers@doover.com>",
"download_url": "https://files.pythonhosted.org/packages/0e/66/2bdce1375c3cab7a984b38964ef58948e117c415e805483df0a63b98ba51/doover_scheduler-0.1.1.tar.gz",
"platform": null,
"description": "# Doover Scheduler\n\nEasily manage schedules within your application using the Doover Scheduler.\n\nThis 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.\n\n# Installation\n\nThe library is published to PyPI, so you can install it using uv or pip:\n\n```bash\nuv add doover-scheduler\n# or\npip install doover-scheduler\n```\n\nYou can install the latest development version directly from GitHub:\n\n```bash\nuv add git+https://github.com/spaneng/doover-scheduler.git\n# or\npip install git+https://github.com/spaneng/doover-scheduler.git\n```\n\n# Usage\nThis first example shows how to use the callbacks to get notified when a schedule starts or ends.\n\n```python\nimport doover_scheduler\n\nfrom pydoover.docker import Application\n\nclass MyApp(Application):\n async def setup(self):\n self.scheduler = doover_scheduler.ScheduleController(self.device_agent)\n self.scheduler.register(self.on_schedule_start, self.on_schedule_end, self.on_schedule_update)\n await self.scheduler.setup()\n\n # add a UI component to the application for the scheduler\n self.ui_manager.add_children(doover_scheduler.ScheduleComponent())\n\n async def main_loop(self):\n await self.scheduler.main_loop()\n\n @doover_scheduler.on_start\n async def on_schedule_start(self, timeslot):\n print(f\"Schedule started: {timeslot}\")\n\n @doover_scheduler.on_end\n async def on_schedule_end(self, timeslot):\n print(f\"Schedule finished: {timeslot}\")\n \n @doover_scheduler.on_update\n async def on_schedule_update(self, new_schedule):\n print(f\"Someone updated the schedule on the website: {new_schedule}\")\n\n```\n\nThe second example shows how to check the next scheduled time for a task.\n\n```python\nimport time\n\nimport doover_scheduler\n\nfrom pydoover.docker import Application\n\nclass MyApp(Application):\n async def setup(self):\n self.scheduler = doover_scheduler.ScheduleController(self.device_agent)\n await self.scheduler.setup()\n \n # add a UI component to the application for the scheduler\n self.ui_manager.add_children(doover_scheduler.ScheduleComponent())\n\n async def main_loop(self):\n await self.scheduler.main_loop()\n \n current_timeslot = self.scheduler.current_timeslot\n if current_timeslot:\n print(f\"The current timeslot will finish in {int(current_timeslot.end_time - time.time())} seconds.\")\n\n next_timeslot = self.scheduler.next_timeslot\n if next_timeslot:\n print(f\"The next scheduled timeslot will start in {int(next_timeslot - time.time())} seconds.\")\n```\n\n## Contributing\n\nFor more information, please reach out to the maintainers at hello@doover.com\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n",
"bugtrack_url": null,
"license": null,
"summary": "Python package for managing Doover scheduled tasks.",
"version": "0.1.1",
"project_urls": null,
"split_keywords": [
"doover",
" doover-scheduler",
" scheduler"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "77fa307f0b38620d17784c20372cb6c80ca2f0c13c7f672a5da00a839287cd03",
"md5": "c9ffb856852ffa89512fd3b2eb009460",
"sha256": "38c52808bb96e1dea9537f79658774b3cf9efc3fe5c0e4a245aab35e8107c5a0"
},
"downloads": -1,
"filename": "doover_scheduler-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c9ffb856852ffa89512fd3b2eb009460",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 8821,
"upload_time": "2025-07-25T04:20:10",
"upload_time_iso_8601": "2025-07-25T04:20:10.978724Z",
"url": "https://files.pythonhosted.org/packages/77/fa/307f0b38620d17784c20372cb6c80ca2f0c13c7f672a5da00a839287cd03/doover_scheduler-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0e662bdce1375c3cab7a984b38964ef58948e117c415e805483df0a63b98ba51",
"md5": "f207830365e92641a949aa851c7675d5",
"sha256": "8db4e49952f2b7e0de5e5acca4ff2681b9daa1df1e822eeacd711560ce766b13"
},
"downloads": -1,
"filename": "doover_scheduler-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "f207830365e92641a949aa851c7675d5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 916280,
"upload_time": "2025-07-25T04:20:11",
"upload_time_iso_8601": "2025-07-25T04:20:11.908547Z",
"url": "https://files.pythonhosted.org/packages/0e/66/2bdce1375c3cab7a984b38964ef58948e117c415e805483df0a63b98ba51/doover_scheduler-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-25 04:20:11",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "doover-scheduler"
}