{"id":22940571,"url":"https://github.com/stardustdl/schemdule","last_synced_at":"2025-09-14T09:30:30.468Z","repository":{"id":38217172,"uuid":"379896869","full_name":"StardustDL/schemdule","owner":"StardustDL","description":"A tiny tool using script as schema to schedule one day and remind you to do something during a day.","archived":false,"fork":false,"pushed_at":"2023-01-30T20:05:21.000Z","size":119,"stargazers_count":4,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-08T02:09:18.105Z","etag":null,"topics":["python","scheduler","schemdule","tool"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StardustDL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-24T11:08:35.000Z","updated_at":"2021-09-13T04:41:34.000Z","dependencies_parsed_at":"2023-02-04T14:02:09.421Z","dependency_job_id":null,"html_url":"https://github.com/StardustDL/schemdule","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StardustDL%2Fschemdule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StardustDL%2Fschemdule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StardustDL%2Fschemdule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StardustDL%2Fschemdule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StardustDL","download_url":"https://codeload.github.com/StardustDL/schemdule/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232962563,"owners_count":18603379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","scheduler","schemdule","tool"],"created_at":"2024-12-14T13:23:25.522Z","updated_at":"2025-01-08T02:09:36.790Z","avatar_url":"https://github.com/StardustDL.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Schemdule](https://socialify.git.ci/StardustDL/schemdule/image?description=1\u0026font=Bitter\u0026forks=1\u0026issues=1\u0026language=1\u0026owner=1\u0026pattern=Plus\u0026pulls=1\u0026stargazers=1\u0026theme=Light)](https://github.com/StardustDL/schemdule)\n\n![](https://github.com/StardustDL/schemdule/workflows/CI/badge.svg) ![](https://img.shields.io/github/license/StardustDL/schemdule.svg) [![](https://img.shields.io/pypi/v/schemdule.svg?logo=pypi)](https://pypi.org/project/schemdule/) [![Downloads](https://pepy.tech/badge/schemdule)](https://pepy.tech/project/schemdule)\n\n[Schemdule](https://github.com/StardustDL/schemdule) is a tiny tool using script as schema to schedule one day and remind you to do something during a day.\n\n- Platform ![](https://img.shields.io/badge/Linux-yes-success?logo=linux) ![](https://img.shields.io/badge/Windows-yes-success?logo=windows) ![](https://img.shields.io/badge/MacOS-yes-success?logo=apple) ![](https://img.shields.io/badge/BSD-yes-success?logo=freebsd)\n- Python ![](https://img.shields.io/pypi/implementation/schemdule.svg?logo=pypi) ![](https://img.shields.io/pypi/pyversions/schemdule.svg?logo=pypi) ![](https://img.shields.io/pypi/wheel/schemdule.svg?logo=pypi)\n\n![](https://raw.githubusercontent.com/StardustDL/own-staticfile-hosting/master/schemdule/terminal.png)\n\n## Install\n\nUse pip:\n\n```sh\npip install schemdule\n```\n\nOr use pipx:\n\n```sh\n# Install pipx\npip install --user pipx\npipx ensurepath\n\n# Install Schemdule\npipx install schemdule\n\n# Install extension\npipx inject schemdule schemdule-extensions-{extension name}\n\n# Upgrade\npipx upgrade schemdule --include-injected\n```\n\n## Usage\n\n### Write a Schema\n\nAn example schema.\n\n```python\n# Schema\nat(\"6:30\", \"Get up\")\ncycle(\"8:00\", \"12:00\", \"00:30:00\", \"00:10:00\", \"Working\")\n# Import other schema by `load` function\n# load(\"other_schema.py\")\n\nprompter.useTkinterMessageBox()\n\n# ext(\"simplegui\") # use simplegui extension (package schemdule-extensions-simplegui)\n\n# use multiple prompter:\n# prompter.useBroadcaster().useConsole().useMessageBox(True)\n```\n\nThe built timetable is like the following one from the results of the command `schemdule run schema.py --preview`.\n\n```\n🕡 06:30:00 - 🕗 08:00:00 🔔 Get up\n🕗 08:00:00 - 🕣 08:30:00 💼 Working (cycle 1 starting)\n🕣 08:30:00 - 🕣 08:40:00 ☕ Working (cycle 1 resting starting)\n🕣 08:40:00 - 🕘 09:10:00 💼 Working (cycle 2 starting)\n🕘 09:10:00 - 🕘 09:20:00 ☕ Working (cycle 2 resting starting)\n🕘 09:20:00 - 🕤 09:50:00 💼 Working (cycle 3 starting)\n🕤 09:50:00 - 🕙 10:00:00 ☕ Working (cycle 3 resting starting)\n🕙 10:00:00 - 🕥 10:30:00 💼 Working (cycle 4 starting)\n🕥 10:30:00 - 🕥 10:40:00 ☕ Working (cycle 4 resting starting)\n🕥 10:40:00 - 🕚 11:10:00 💼 Working (cycle 5 starting)\n🕚 11:10:00 - 🕚 11:20:00 ☕ Working (cycle 5 resting starting)\n🕚 11:20:00 - 🕦 11:50:00 💼 Working (cycle 6 starting)\n🕦 11:50:00 - 🕦 11:50:00 ☕ Working (cycle 6 resting starting)\n```\n\n### Run\n\n```sh\n# load and run from the schema\nschemdule run schema.py\n# or use python\n# python -m schemdule run schema.py\n\n# preview the built timetable\nschemdule run schema.py --preview\n\n# try the builtin demo (just for testing)\nschemdule demo\n```\n\n## Schema Specification\n\nSchema is a pure python script, so you can use any python statement in it.\n\nSchemdule provide `at`, `cycle`, `load` and `ext` functions for registering events, and a `PrompterBuilder` variable named `prompter` to config prompter.\n\n\u003e These functions and variable can be accessed and modified in the variable `env`, a dict for these items provided by Schemdule. You can change the `env` variable to change the execute environment for `load` function.\n\n```python\n# raw_time can be {hh:mm} or {hh:mm:ss} or a datetime.time object\n\ndef at(rawTime: Union[str, time], message: str = \"\", payload: Any = None) -\u003e None:\n    # register an event at time with message\n    # if payload is a PayloadBuilder, Schemdule will build the final payload automaticly\n    ...\n\ndef cycle(rawStart: Union[str, time], rawEnd: Union[str, time], rawWorkDuration: Union[str, time, timedelta], rawRestDuration: Union[str, time, timedelta], message: str = \"\", workPayload: Optional[Callable[[int], Any]] = None, restPayload: Optional[Callable[[int], Any]] = None) -\u003e None:\n    # register a series of events in cycle during start to end\n    # the duration of one cycle = workDuration + restDuration\n    # For each cycle, register 2 event: cycle starting, cycle resting\n    # workPayload and restPayload is the payload generator such as:\n    #   def generator(index: int) -\u003e Any: ...\n    # if the returened payload is a PayloadBuilder, Schemdule will build the final payload automaticly, \n    ...\n\n\ndef loadRaw(source: str) -\u003e None:\n    # load from a schema source code\n    ...\n\ndef load(file: str, encoding: str = \"utf8\") -\u003e None:\n    # load from a schema source code file\n    ...\n\ndef ext(name: Optional[str] = None) -\u003e None:\n    # use an extension or use all installed extensions (if name is None)\n    # provided by packages `schemdule-extensions-{extension name}`\n    ...\n\ndef payloads() -\u003e PayloadBuilder:\n    # create a payload builder\n    ...\n\ndef prompters() -\u003e PrompterBuilder:\n    # create a prompter builder\n    ...\n\n# the class PayloadBuilder\n\nclass PayloadBuilder:\n    def use(self, payload: Any) -\u003e \"PayloadBuilder\": ...\n\n# the class of the variable `prompter`\n\nclass PrompterBuilder:\n    def use(self, prompter: Union[Prompter, \"PrompterBuilder\"]) -\u003e \"PrompterBuilder\":\n\n    def useBroadcaster(self, final: bool = False) -\u003e \"PrompterBuilder\": ...\n\n    def useSwitcher(self, final: bool = False) -\u003e \"PrompterBuilder\": ...\n\n    def useConsole(self, final: bool = False) -\u003e \"PrompterBuilder\": ...\n\n    def useCallable(self, final: bool = False) -\u003e \"PrompterBuilder\": ...\n\n    def useTkinterMessageBox(self, final: bool = False) -\u003e \"PrompterBuilder\": ...\n\n    def clear(self) -\u003e \"PrompterBuilder\": ...\n\n# the default value of the variable `prompter`\n\ndef default_prompter_builder() -\u003e PrompterBuilder:\n    prompter = PrompterBuilder()\n    prompter.useSwitcher().useConsole().useCallable(True).useTkinterMessageBox()\n    return prompter\n```\n\nHere are the type annotions for schema.\n\n```python\n# Type annotions\nfrom typing import Callable, Union, Any, Dict, Optional\nfrom datetime import time, timedelta\nfrom schemdule.prompters.builders import PrompterBuilder, PayloadBuilder\nfrom schemdule.prompters import Prompter, PrompterHub\nat: Callable[[Union[str, time], str, Any], None]\ncycle: Callable[[Union[str, time], Union[str, time], Union[str, time, timedelta], Union[str, time, timedelta], str, Optional[Callable[[int], Any]], Optional[Callable[[int], Any]]], None]\nloadRaw: Callable[[str], None]\nload: Callable[[str], None]\next: Callable[[Optional[str]], None]\npayloads: Callable[[], PayloadBuilder]\npayloads: Callable[[], PrompterBuilder]\nprompter: PrompterBuilder\nenv: Dict[str, Any]\n```\n\n## Extensions\n\n- [SimpleGUI](https://github.com/StardustDL/schemdule/tree/master/src/extensions/simplegui) [![](https://img.shields.io/pypi/v/schemdule-extensions-simplegui.svg?logo=pypi)](https://pypi.org/project/schemdule-extensions-simplegui/) [![Downloads](https://pepy.tech/badge/schemdule-extensions-simplegui)](https://pepy.tech/project/schemdule-extensions-simplegui)\n- [Miaotixing](https://github.com/StardustDL/schemdule/tree/master/src/extensions/miaotixing) [![](https://img.shields.io/pypi/v/schemdule-extensions-miaotixing.svg?logo=pypi)](https://pypi.org/project/schemdule-extensions-miaotixing/) [![Downloads](https://pepy.tech/badge/schemdule-extensions-miaotixing)](https://pepy.tech/project/schemdule-extensions-miaotixing)\n- [AudioPlay](https://github.com/StardustDL/schemdule/tree/master/src/extensions/audioplay) [![](https://img.shields.io/pypi/v/schemdule-extensions-audioplay.svg?logo=pypi)](https://pypi.org/project/schemdule-extensions-audioplay/) [![Downloads](https://pepy.tech/badge/schemdule-extensions-audioplay)](https://pepy.tech/project/schemdule-extensions-audioplay)\n- [All extensions on PyPI](https://pypi.org/search/?q=schemdule)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstardustdl%2Fschemdule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstardustdl%2Fschemdule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstardustdl%2Fschemdule/lists"}