boltons.fileutils
Python's os
, os.path
, and shutil
modules provide good coverage of file wrangling fundamentals, and these functions help close a few remaining gaps.
boltons.fileutils.mkdir_p
boltons.fileutils.iter_find_files
boltons.fileutils.copytree
Ideally, the road to success should never put current progress at risk. And that's exactly why atomic_save
and AtomicSaver
exist.
Using the same API as a writable file, all output is saved to a temporary file, and when the file is closed, the old file is replaced by the new file in a single system call, portable across all major operating systems. No more partially-written or partially-overwritten files.
boltons.fileutils.atomic_save
boltons.fileutils.AtomicSaver
boltons.fileutils.atomic_rename
boltons.fileutils.replace
Linux, BSD, Mac OS, and other Unix-like operating systems all share a simple, foundational file permission structure that is commonly complicit in accidental access denial, as well as file leakage. FilePerms
was built to increase clarity and cut down on permission-related accidents when working with files from Python code.
boltons.fileutils.FilePerms
boltons.fileutils.DummyFile