def __init__(self): if Interfaces()['win32com'].available and _attempt_open_excel(): SheetTable.__init__(self, ctype='win32com') elif Interfaces()['xlrd'].available: SheetTable.__init__(self, ctype='xlrd') else: raise RuntimeError("No excel interface is available; install %s" % self.requirements())
def available(self): _inter = Interfaces() return (_inter['win32com'].available and _attempt_open_excel()) \ or _inter['openpyxl'].available