SchedPlus Python API reference #
The application’s stable integration seam is the scheduler core. UI code should use this layer rather than calling SQLite functions directly.
logic.scheduler #
Task #
A dataclass with id, date, time, text, createdAt, and updatedAt. Additional fields in v0.9.0 include completed, completedAt, notes, priority, duration, category, recurrence, recurrenceEnd, and reminder. New tasks receive a UUID and UTC ISO timestamps by default.
Scheduler #
| Method | Behaviour |
|---|---|
load_tasks() |
Loads the SQLite task list into memory and returns it. |
get_tasks() |
Returns the in-memory task list. |
add_task(date, time, text) |
Validates, persists, appends, and returns a new Task. |
update_task(task) |
Validates and persists changes to an existing task. |
delete_task(task_id) |
Removes a task from persistence and memory. |
complete_task(task_id) |
Marks a task as completed. For recurring tasks, generates the next occurrence. |
uncomplete_task(task_id) |
Reverses completion. |
undo_manager |
UndoManager instance for reversing recent actions. |
from logic.scheduler import Scheduler
scheduler = Scheduler()
scheduler.load_tasks()
task = scheduler.add_task("2026-08-20", "09:30", "Review schedule")
task.text = "Review the weekly schedule"
scheduler.update_task(task)
logic.validation #
validate_task(task) trims and validates a task-like object in place. It raises ValidationError unless the date is a valid YYYY-MM-DD, the time is valid 24-hour HH:MM, and text is non-empty.
logic.storage.sqlite_storage #
Storage functions are used by Scheduler: initialize_database(), create_entry(task), update_entry(task), delete_entry(task_id), get_entry(task_id), and list_entries(). StorageError is the application-safe exception for unavailable, read-only, locked, corrupt, integrity, incompatible schema, or unexpected database conditions. An unsupported newer schema is reported as unavailable and is never modified.
Call initialize_database() before performing work in a new application boundary. It returns RecoveryInfo | None; a recovery result includes the preserved database path and user-facing message.
The storage module is deliberately low-level. Calling it alongside a live Scheduler can make its in-memory list stale; reload the scheduler after external storage changes.