def main():
    fpath = '/tmp/input_file.py'
try:
    text = read_file(fpath)
except Exception as e:
    print('Could not load file due to ' + repr(e))
return 1
print(json.dumps(get_classes_from_text(text), indent=4))
if __name__ == '__main__':
    sys.exit(main())
Используйте Python для создания JSON