imghdr

Recognize image file formats based on their first few bytes.

what

def what(
    file, h=None
):