I recently added a number of examples on working with files and directories with Python and PyFilesystem.
The first example, is count_py.py which recursively sums up the number of bytes stored in a directory, and renders it in a "friendly" format.
This script takes a path or a URL. For instance
python3 count_py.py ~/projects will sum up the bytes of Python in your projects folder.
For me, this gives the following output: