`importlib.resources` access whole directories as resources

You can call as_file() on a directory resource. I’m not sure what version that started in, but you can use the latest importlib_resources to ensure that behavior is available for any Python version.

2 Likes