def main():
    parser = argparse.ArgumentParser(description='BIDS Curation')
    parser.add_argument('--api-key', dest='api_key', action='store', required=True, help='API key')
    parser.add_argument('-p', dest='project_label', action='store', required=False, default=None, help='Project Label on Flywheel instance')
    parser.add_argument('--session', dest='session_id', action='store', required=False, default=None, help='Session ID, used to look up project if project label is not readily available')
    parser.add_argument('--reset', dest='reset', action='store_true', default=False, help='Reset BIDS data before running')
    parser.add_argument('--session-only', dest='session_only', action='store_true', default=False, help='Only curate the session identified by --session')
    parser.add_argument('--template-file', dest='template_file', action='store', default=None, help='Template file to use')
    args = parser.parse_args()
    fw = flywheel.Flywheel(args.api_key)
    if args.project_label:
        project_id = utils.validate_project_label(fw, args.project_label)
    elif args.session_id:
        project_id = utils.get_project_id_from_session_id(fw, args.session_id)
    else:
        print('Either project label or session id is required!')
        sys.exit(1)
    curate_bids_dir(fw, project_id, args.session_id, reset=args.reset, template_file=args.template_file, session_only=args.session_only)
def main():
    parser = argparse.ArgumentParser(description='BIDS Curation')
    parser.add_argument('--api-key', dest='api_key', action='store', required=True, help='API key')
    parser.add_argument('-p', dest='project_label', action='store', required=False, default=None, help='Project Label on Flywheel instance')
    parser.add_argument('--session', dest='session_id', action='store', required=False, default=None, help='Session ID, used to look up project if project label is not readily available')
    parser.add_argument('--reset', dest='reset', action='store_true', default=False, help='Reset BIDS data before running')
    parser.add_argument('--session-only', dest='session_only', action='store_true', default=False, help='Only curate the session identified by --session')
    parser.add_argument('--template-file', dest='template_file', action='store', default=None, help='Template file to use')
    args = parser.parse_args()
    fw = flywheel.Flywheel(args.api_key)
    if args.project_label:
        project_id = utils.validate_project_label(fw, args.project_label)
    elif args.session_id:
        project_id = utils.get_project_id_from_session_id(fw, args.session_id)
    else:
        print('Either project label or session id is required!')
        sys.exit(1)
    curate_bids_dir(fw, project_id, args.session_id, reset=args.reset, template_file=args.template_file, session_only=args.session_only)