def get_filetype(filename):
    """
    Gets the filetype of an object based on the extension in its filename

    Args:
        filename (str): The name of the file
    Returns:
        str: The filetype of the file
    """
    # If the filename isn't named according to good practice,
    # this will return nonsense - which is good. If someone is using
    # read_badpractice with an unclear file type, they should have to specify
    filetype = '.'.join(filename.split('.')[1:])
    if filetype == '':
        raise ValueError('S3 path must contain an extension designating '
                         'a valid file type. If you are reading a file, '
                         'that does not have an extension, you can use '
                         '\'rv.read_badpractice\'.')
    return filetype