How to use the xlsx2csv.Xlsx2csv.convert function in xlsx2csv

To help you get started, we’ve selected a few xlsx2csv examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dilshod / xlsx2csv / xlsx2csv.py View on Github external
def convert_recursive(path, sheetid, outfile, kwargs):
    for name in os.listdir(path):
        fullpath = os.path.join(path, name)
        if os.path.isdir(fullpath):
            convert_recursive(fullpath, sheetid, outfile, kwargs)
        else:
            outfilepath = outfile
            if len(outfilepath) == 0 and fullpath.lower().endswith(".xlsx"):
                outfilepath = fullpath[:-4] + 'csv'

            print("Converting %s to %s" % (fullpath, outfilepath))
            try:
                Xlsx2csv(fullpath, **kwargs).convert(outfilepath, sheetid)
            except zipfile.BadZipfile:
                print("File %s is not a zip file" % fullpath)

xlsx2csv

xlsx to csv converter

MIT
Latest version published 3 days ago

Package Health Score

82 / 100
Full package analysis

Similar packages