import csv


def _get_dsv_reader(dsv_file):
    """
    Detect the delimiter used in opened dsv (delimiter-separated values) file
    and return csv.DictReader object initialized to iterate over file contents

    Args:
        dsv_file(file object): opened dsv file object

    Returns:
        csv.DictReader: reader object initialized to iterate over file contents
    """
    dialect = csv.Sniffer().sniff(dsv_file.readline())
    dsv_file.seek(0)
    return csv.DictReader(dsv_file, dialect=dialect, quoting=csv.QUOTE_NONE)