add default value to getattr_from_file
add caching to getattr_from_file()