def read_sheets(archive):
 xml_source = archive.read(ARC_WORKBOOK)
 tree = fromstring(xml_source)
 for element in safe_iterator(tree, ('{%s}sheet' % SHEET_MAIN_NS)):
  attrib = element.attrib
  attrib['id'] = attrib[('{%s}id' % REL_NS)]
  del attrib[('{%s}id' % REL_NS)]
  if attrib['id']:
   (yield attrib)

def read_sheets ( archive ) : xml_source = archive . read ( ARC_WORKBOOK ) tree = fromstring ( xml_source ) for element in safe_iterator ( tree , ( '{%s}sheet' % SHEET_MAIN_NS ) ) : attrib = element . attrib attrib [ 'id' ] = attrib [ ( '{%s}id' % REL_NS ) ] del attrib [ ( '{%s}id' % REL_NS ) ] if attrib [ 'id' ] : ( yield attrib )
read worksheet titles and ids for a workbook .