Further Reading — Chapter 17: Automating Repetitive Office Tasks
Official Documentation
Python Standard Library — pathlib
https://docs.python.org/3/library/pathlib.html
The authoritative reference for pathlib.Path. Covers every method with examples. The "Correspondence to tools in the os module" table at the bottom is particularly useful for translating os.path muscle memory to pathlib syntax.
Python Standard Library — shutil
https://docs.python.org/3/library/shutil.html
Documents copy, copy2, copytree, move, rmtree, make_archive, and unpack_archive. Pay particular attention to the note about copy vs. copy2 and when metadata preservation matters.
Python Standard Library — os.path
https://docs.python.org/3/library/os.path.html
Still useful for understanding legacy code and for a handful of operations not in pathlib. The os.walk() generator for recursive directory traversal is worth knowing.
watchdog Documentation https://python-watchdog.readthedocs.io/ The official watchdog documentation covers all event types, the Observer and Handler API, and platform-specific notes about how file watching works differently on Windows, macOS, and Linux.
Books
Automate the Boring Stuff with Python (3rd Edition) Al Sweigart — No Starch Press Chapters 9 and 10 cover file handling and PDF/Word operations with a similar practical orientation. Sweigart's approach is deliberately non-theoretical; every example is a real task you might encounter. Available free online at automatetheboringstuff.com.
Python Cookbook (3rd Edition) David Beazley and Brian K. Jones — O'Reilly Chapter 5 (Files and I/O) and Chapter 13 (Utility Scripting and System Administration) contain professional-grade recipes for file handling patterns, including cross-platform path handling edge cases that introductory texts don't cover.
The Pragmatic Programmer (20th Anniversary Edition) David Thomas and Andrew Hunt — Addison-Wesley Not a Python book, but the chapter on "DRY — The Evils of Duplication" and the sections on automation and shells provide the philosophical foundation for why automation matters in professional software work.
Online Resources
Real Python: Python's pathlib Module: Taming the File System
https://realpython.com/python-pathlib/
A comprehensive tutorial on pathlib with detailed explanations of each method. Well-suited for readers who want to go deeper than the chapter covers without reading raw documentation.
Real Python: Working with Files in Python
https://realpython.com/working-with-files-in-python/
Covers os.walk(), directory listings, and file operations with clear examples. Useful for understanding the os module's older patterns before they were superseded by pathlib.
Python Docs HOWTO: Logging https://docs.python.org/3/howto/logging.html The official logging HOWTO, including the cookbook section. Covers logging to files, rotation, formatting, and multiple handlers — all relevant for production automation scripts that need reliable audit trails.
Tools and Libraries
watchdog (PyPI)
pip install watchdog
Cross-platform file system monitoring. Required for the folder_watcher.py script in this chapter.
schedule
pip install schedule
A lightweight in-process job scheduler. Alternative to OS-level schedulers for simpler automation needs. Useful when you want a Python process itself to manage timing rather than Task Scheduler or cron.
loguru
pip install loguru
A drop-in replacement for Python's built-in logging module with a simpler API and better defaults. Worth evaluating for automation scripts where you want good logging with minimal configuration.
Going Deeper
Windows Task Scheduler documentation
https://docs.microsoft.com/en-us/windows/win32/taskschd/task-scheduler-start-page
Full documentation for Task Scheduler including the schtasks command-line tool, triggers, conditions, and action types. The "Creating Tasks" section covers the GUI and command-line approaches.
crontab.guru https://crontab.guru/ An interactive cron expression editor and reference. Invaluable for verifying that your cron schedule string means what you think it means before deploying it.
Python Docs: subprocess — Subprocess Management
https://docs.python.org/3/library/subprocess.html
Chapter 17 focuses on pure file operations, but many real-world office automation tasks require running external programs (converting file formats, calling CLI tools, running database exports). The subprocess module is the standard way to do this. The subprocess.run() function covers most needs.