python-fsutil provides a collection of high-level, convenient utilities for common file-system operations, simplifying tasks like reading, writing, copying, moving, and deleting files and directories. It aims to offer a more Pythonic and less verbose alternative to direct `os` and `shutil` module usage. The current version is 0.16.1, and the library maintains an active release cadence with minor updates every few months.
pip install python-fsutilVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates basic file and directory operations: creating a temporary file and directory, writing and reading file content, checking existence, getting file size, and finally cleaning up both the file and the created directory.
Upgrade to `python-fsutil` version 0.16.0 or newer to ensure robust and cross-platform atomic file operations with improved permission handling and Windows compatibility.
Update to `python-fsutil` version 0.16.1 or newer for corrected and consistent path handling in search operations, especially when using relative paths or expecting OS-specific path separators.
Upgrade to `python-fsutil` version 0.14.0 or newer to ensure correct behavior of `join_filename` with empty name components.
pip install python-fsutil
fsutil.remove_dir('/path/to/directory')from fsutil import read_file
fsutil.read_file('/path/to/file.txt') # Ensure path argument is a string or pathlib.Path objectNo dependency data recorded yet.