Unified Filesystem Operations with Python's Pathlib Module
Filesystem operations in Python can feel clumsy, because the relevant
operations are distributed over so many different modules in the
standard library: some are in os (itself very large and bloated),
some in os.path, then there is shutil, and you may also need either
glob or fnmatch. Why does this need to be so complicated?
Turns out, it isn’t. Python’s pathlib module provides unified access
to a complete set of filesystem objects and operations. Unfortunately,
the pathlib module itself can appear a bit daunting. But in reality,
it’s really very simple.