resource_path = '/'.join(('templates', 'temp_file'))
template = pkg_resources.resource_string(resource_package, resource_path)
template = pkg_resources.resource_stream(resource_package, resource_path)
Python: How to read a (static) file from inside a package?