import csv
import click


def _cb_quoting(ctx, param, value):
    """Map quoting parameter to CSV library values."""
    if value == 'all':
        return csv.QUOTE_ALL
    elif value == 'minimal':
        return csv.QUOTE_MINIMAL
    elif value == 'none':
        return csv.QUOTE_NONE
    elif value == 'non-numeric':
        return csv.QUOTE_NONNUMERIC
    else:
        raise click.BadParameter("Bad internal validation")