Shift Automator Pro is a Windows desktop app that automates weekly schedule-template printing through Microsoft Word COM automation.
- Production-focused Word automation: open, replace, print, and close with cleanup safeguards
- Domain logic handles complex monthly rotation scheduling (e.g. "third Thursday" patterns)
- Defensive workflow with preflight checks, per-document retry paths, and CSV failure reporting
- Modular architecture with strong unit-test coverage and static quality gates
- Packaged as a single-file executable for non-technical end users via PyInstaller
- Batch print processing for date ranges across day/night template folders
- Date replacement automation with optional header/footer-only mode
- Template path, printer, and date-range preflight validation before any processing begins
- Per-document retry handling for transient COM errors with structured failure logging
- Cancelable background processing with responsive UI progress updates
- Timestamped CSV failure reports for audit and retry workflows
src/main.py— orchestration and workflow controlsrc/ui.py— Tkinter/ttk interface layersrc/word_processor.py— Word COM automation lifecycle (open, replace, print, close)src/scheduler.py— date resolution and template path logicsrc/config.py— config management with migration supportsrc/path_validation.py— path traversal and filename safety checks
| Layer | Technology |
|---|---|
| Language | Python 3.12 |
| UI | Tkinter/ttk |
| Office integration | pywin32 (Word COM) |
| Date picker | tkcalendar |
| Testing | pytest + pytest-cov |
| Quality | black + mypy + pylint |
| Packaging | PyInstaller |
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python main.pyWindows helper scripts:
setup.bat— installs all dependencies into a virtualenvstart_app.bat— activates the environment and launches the app
pip install -r requirements-dev.txt
pytest # run test suite with coverage
black --check src tests # formatting check
mypy src # type checking
pylint src --fail-under=8.0 # linting gateThe test suite mocks all Windows-only modules so it can run on any platform in CI.
- Word documents open in read-only mode during processing; originals are never modified
- Word macros are force-disabled on every document open
- Path validation blocks traversal outside configured template root directories
- Date range limits prevent runaway batch operations
- Config writes are atomic; all operations are logged with structured timestamps
main.py— top-level entry pointsrc/— application modules (controller, UI, scheduler, COM processor, config, validation)tests/— unit tests and module fixtures.github/workflows/build.yml— Windows build and release workflow via PyInstaller
MIT (see LICENSE)
