@cli.command()
@click.argument('data')
@click.option('--format', default='csv', type=click.Choice(['csv', 'excel']))
@click.option('--fail_fast', is_flag=True)
@click.option('--row_limit', default=20000, type=int)
@click.option('--report_limit', default=1000, type=int)
@click.option('--output', default='txt', type=click.Choice(['txt', 'json']))
def structure(data, format, fail_fast, row_limit, report_limit, output):

    """Run a Good Tables StructureProcessor."""

    processor = processors.StructureProcessor(format=format, fail_fast=fail_fast,
                                              row_limit=row_limit,
                                              report_limit=report_limit)

    valid, report, data = processor.run(data)

    valid_msg = 'Well done! The data is valid :)\n'.upper()
    invalid_msg = 'Oops.The data is invalid :(\n'.upper()

    if output == 'json':
        exclude = None
    else:
        exclude = ['result_context', 'processor', 'row_name', 'result_category',
                   'column_index', 'column_name', 'result_level']

    if valid:
        click.echo(click.style(valid_msg, fg='green'))
    else:
        click.echo(click.style(invalid_msg, fg='red'))

    click.echo(report.generate(output, exclude=exclude))
dataset/ETHPy150Open frictionlessdata/goodtables/goodtables/cli/main.py/structure/original