<commit_before>"""
Command line module for access to GMDSP converters

This will convert the specified input to an xml file in RDF format

General specification is:

>>> python main.py converter -i input -o output

Where converter is one of the following supported converters:
- allotments
- gritting
- parking
- planning
- recycling
- streetlight

For example:

>>> python main.py allotments -i ./sourcedata/allotments/allotments.csv -o ./output/allotments.rdf

"""
__author__ = 'jond'

import argparse
import importlib
from gmdspconverters import utils

parser = argparse.ArgumentParser(description="Command line module for access to the GMDSP converters.")
parser.add_argument(
    'converter',
    choices=[
        'allotments', 'gritting', 'parking', 'planning', 'recycling', 'streetlight',
    ],
    help="The converter to use"
)
parser.add_argument("-i", type=str, required=True, help="The input file.")
parser.add_argument("-o", type=str, required=True, help="The output file.")

args = parser.parse_args()


MODULE_MAP = {
    'allotments': 'allotments',
    'gritting': 'gritting',
    'parking': 'parking',
    'planning': 'planning',
    'recycling': 'recycling',
    'streetlight': 'streetlight',
}

def main(convertertype, inputfile_path, outputfile_path):
    m = importlib.import_module('gmdspconverters.' + MODULE_MAP[convertertype])
    g = utils.create_graph(outputfile_path)
    m.convert(g, inputfile_path)
    utils.output_graph(g, outputfile_path)


if __name__ == "__main__":
    main(args.converter, args.i, args.o)<commit_msg>removed reliance on output file<commit_after>"""
Command line module for access to GMDSP converters

This will convert the specified input to an xml file in RDF format

General specification is:

>>> python main.py converter -i input -o output

Where converter is one of the following supported converters:
- allotments
- gritting
- parking
- planning
- recycling
- streetlight

For example:

>>> python main.py allotments -i ./sourcedata/allotments/allotments.csv -o ./output/allotments.rdf

"""
__author__ = 'jond'

import argparse
import importlib
from gmdspconverters import utils

parser = argparse.ArgumentParser(description="Command line module for access to the GMDSP converters.")
parser.add_argument(
    'converter',
    choices=[
        'allotments', 'gritting', 'parking', 'planning', 'recycling', 'streetlight',
    ],
    help="The converter to use"
)
parser.add_argument("-i", type=str, required=True, help="The input file.")
parser.add_argument("-o", type=str, required=True, help="The output file.")

args = parser.parse_args()


MODULE_MAP = {
    'allotments': 'allotments',
    'gritting': 'gritting',
    'parking': 'parking',
    'planning': 'planning',
    'recycling': 'recycling',
    'streetlight': 'streetlight',
}

def main(convertertype, inputfile_path, outputfile_path):
    m = importlib.import_module('gmdspconverters.' + MODULE_MAP[convertertype])
    g = utils.create_graph()
    m.convert(g, inputfile_path)
    utils.output_graph(g, outputfile_path)


if __name__ == "__main__":
    main(args.converter, args.i, args.o)
{'fraction_non_alphanumeric': 0.12407585985213758, 'fraction_numerical': 0.0, 'mean_word_length': 4.567084078711986, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '456801', 'n_tokens_mistral': 1013, 'n_tokens_neox': 1003, 'n_words': 273}