import pathlib


def get_file_type(input_file):
    """Get file type from extension (xls, xlsx or csv) or `None`."""
    suffix = pathlib.PurePath(input_file.name).suffix.lower()
    if suffix == '.xls':
        return 'xls'
    if suffix == '.xlsx':
        return 'xlsx'
    if suffix == '.csv':
        return 'csv'
    return None