conversion_utils/scripts/install_jos_specifications.py

14 lines
590 B
Python
Raw Normal View History

import pickle
import argparse
from conversion_utils.jos_msds_and_properties import SpecificationsParser
arg_parser = argparse.ArgumentParser(description='Parse source TEI specifications file and save as pickle.')
arg_parser.add_argument('-xml', type=str, help='input XML file', required=True)
arg_parser.add_argument('-pickle', type=str, help='output pickle file', required=True)
arguments = arg_parser.parse_args()
parser = SpecificationsParser()
specifications = parser.parse(arguments.xml)
with open(arguments.pickle, 'wb') as pickle_file:
pickle.dump(specifications, pickle_file)