Shutil
The `shutil` module offers high-level file operations for copying, moving, archiving, and deleting files and directories. It handles many edge cases that low-level operations miss. The guide walks through Copying Files, Copying Directories, Moving & Renaming, Removing Trees, Archives & Disk Usage. `shutil.copy(src, dst)` copies a file to a path or directory, returning the destination path. `shutil.copy2(src, dst)` also preserves metadata. `shutil.copyfile(src, dst)` copies content only (no metadata). `shutil.copyfileobj(fsrc, fdst, length)` copies between open file objects. `shutil.copytree(src, dst)` recursively copies an entire directory tree. Use `copy_function` to specify the copy strategy. `ignore` parameter accepts a callable for excluding files. `dirs_exist_ok=True` (Python 3.8+) allows merging into existing directories. `shutil.move(src, dst)` recursively moves a file or directory. It attempts `os.rename` first and falls back to copying then removing. This handles cross-filesystem moves correctly, unlike `os.rename` which fails across devices. The guide is organized into 5 sections that build on each other, each pairing a prose explanation with runnable code.