Python's filesystem abstraction layer
pip install fsPyFilesystem2
Python's Filesystem abstraction layer.
Documentation
Introduction
Think of PyFilesystem's FS objects as the next logical step to
Python's file objects. In the same way that file objects abstract a
single file, FS objects abstract an entire filesystem.
Let's look at a simple piece of code as an example. The following function uses the PyFilesystem API to count the number of non-blank lines of Python code in a directory. It works recursively, so it will find files in all sub-directories.