<commit_before>from openpyxl import load_workbook
import argparse
import csv
import os

# ---
# Get arguments
# ---
# TODO: let user specify more encodings
# TODO: let user strip newlines from fields (replace by space)

parser = argparse.ArgumentParser(description='Convert XLSX file to CSV using openpyxl')
parser.add_argument('-i','--input', help='Full path to XLSX file', required=True)
parser.add_argument('-o','--outputDir', help='Full path output directory')
parser.add_argument('--delimiter', help='Delimiter used in output, defaults to ,', choices=[',', ';', '|', 'tab'], default=',')
parser.add_argument('--encoding', help='Output encoding, defaults to utf-8', choices=['ascii', 'latin-1', 'utf-8', 'utf-16'], default='utf-8')
parser.add_argument('--extension', help='Extension of output, defaults to csv', default='csv')
parser.add_argument('--noprefix', help='Do not prefix ouput with workbook name', nargs='?', const=1, default=0)
parser.add_argument('--prefix', help='Use specified prefix instead of prefixing output with workbook name')
parser.add_argument('--version', action='version', version='%(prog)s 1.0.0dev')
args = parser.parse_args()

inputPath = args.input
outputDir = args.outputDir
noPrefix = args.noprefix
customPrefix = args.prefix
outputExtension = args.extension
outputDelimiter = args.delimiter
outputEncoding = args.encoding

if not os.path.isfile(inputPath):
    print('xlsx-conv: error: No such file or directory:', inputPath)
    parser.print_usage()
    exit(1)

inputDir, inputFile = os.path.split(inputPath)
inputBaseFn, inputExt = os.path.splitext(inputFile)

if outputDir:
    if not os.path.isdir(outputDir):
        parser.print_usage()
        print('xlsx-conv: error: No such file or directory:', outputDir)
        exit(1)
else:
   outputDir = inputDir

print("Dumping", inputPath)
<commit_msg>bumped dev version nr<commit_after>from openpyxl import load_workbook
import argparse
import csv
import os

# ---
# Get arguments
# ---
# TODO: let user specify more encodings
# TODO: let user strip newlines from fields (replace by space)

parser = argparse.ArgumentParser(description='Convert XLSX file to CSV using openpyxl')
parser.add_argument('-i','--input', help='Full path to XLSX file', required=True)
parser.add_argument('-o','--outputDir', help='Full path output directory')
parser.add_argument('--delimiter', help='Delimiter used in output, defaults to ,', choices=[',', ';', '|', 'tab'], default=',')
parser.add_argument('--encoding', help='Output encoding, defaults to utf-8', choices=['ascii', 'latin-1', 'utf-8', 'utf-16'], default='utf-8')
parser.add_argument('--extension', help='Extension of output, defaults to csv', default='csv')
parser.add_argument('--noprefix', help='Do not prefix ouput with workbook name', nargs='?', const=1, default=0)
parser.add_argument('--prefix', help='Use specified prefix instead of prefixing output with workbook name')
parser.add_argument('--version', action='version', version='%(prog)s 1.0.0dev1')
args = parser.parse_args()

inputPath = args.input
outputDir = args.outputDir
noPrefix = args.noprefix
customPrefix = args.prefix
outputExtension = args.extension
outputDelimiter = args.delimiter
outputEncoding = args.encoding

if not os.path.isfile(inputPath):
    print('xlsx-conv: error: No such file or directory:', inputPath)
    parser.print_usage()
    exit(1)

inputDir, inputFile = os.path.split(inputPath)
inputBaseFn, inputExt = os.path.splitext(inputFile)

if outputDir:
    if not os.path.isdir(outputDir):
        parser.print_usage()
        print('xlsx-conv: error: No such file or directory:', outputDir)
        exit(1)
else:
   outputDir = inputDir

print("Dumping", inputPath)

{'fraction_non_alphanumeric': 0.14746543778801843, 'fraction_numerical': 0.007319056654920032, 'mean_word_length': 5.318493150684931, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5122677', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1141, 'n_words': 319}