def get_number_of_parts(xml_source):
 parts_size = {}
 parts_names = []
 root = fromstring(xml_source)
 heading_pairs = root.find(QName('http://schemas.openxmlformats.org/officeDocument/2006/extended-properties', 'HeadingPairs').text)
 vector = heading_pairs.find(QName(NAMESPACES['vt'], 'vector').text)
 children = vector.getchildren()
 for child_id in range(0, len(children), 2):
  part_name = children[child_id].find(QName(NAMESPACES['vt'], 'lpstr').text).text
  if (not (part_name in parts_names)):
   parts_names.append(part_name)
  part_size = int(children[(child_id + 1)].find(QName(NAMESPACES['vt'], 'i4').text).text)
  parts_size[part_name] = part_size
 return (parts_size, parts_names)

def get_number_of_parts ( xml_source ) : parts_size = { } parts_names = [ ] root = fromstring ( xml_source ) heading_pairs = root . find ( QName ( 'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties' , 'HeadingPairs' ) . text ) vector = heading_pairs . find ( QName ( NAMESPACES [ 'vt' ] , 'vector' ) . text ) children = vector . getchildren ( ) for child_id in range ( 0 , len ( children ) , 2 ) : part_name = children [ child_id ] . find ( QName ( NAMESPACES [ 'vt' ] , 'lpstr' ) . text ) . text if ( not ( part_name in parts_names ) ) : parts_names . append ( part_name ) part_size = int ( children [ ( child_id + 1 ) ] . find ( QName ( NAMESPACES [ 'vt' ] , 'i4' ) . text ) . text ) parts_size [ part_name ] = part_size return ( parts_size , parts_names )
get a list of contents of the workbook .