def read(self, filename):
with tarfile.open(filename, "<STR_LIT>") as arc:<EOL><INDENT>temp_dir = tempfile.mkdtemp()<EOL>arc.extractall(path=temp_dir, members=_safemembers(arc))<EOL>tribe_dir = glob.glob(temp_dir + os.sep + '<STR_LIT:*>')[<NUM_LIT:0>]<EOL>self._read_from_folder(dirname=tribe_dir)<EOL><DEDENT>shutil.rmtree(temp_dir)<EOL>return self<EOL>
Read a tribe of templates from a tar formatted file.

:type filename: str
:param filename: File to read templates from.

.. rubric:: Example

>>> tribe = Tribe(templates=[Template(name='c', st=read())])
>>> tribe.write('test_tribe')
Tribe of 1 templates
>>> tribe_back = Tribe().read('test_tribe.tgz')
>>> tribe_back == tribe
True