import mimetypes


def get_mime_type(file_path: str) -> str:
    """
    Get the MIME type of a file based on the file path.

    Parameters:
        file_path (str): The path to the file from which to determine the MIME type.

    Returns:
        str: The MIME type of the file.
    """
    mime_type, encoding = mimetypes.guess_type(file_path)
    return mime_type


def categorize_mime_type(mime_type: str) -> str:
    image_types = {
        "image/jpeg",
        "image/png",
        "image/bmp",
        "image/tiff",
        "image/webp",
        "image/svg+xml",
        "image/heif",
        "image/heic",
    }
    gif_types = {"image/gif"}
    video_types = {
        "video/mp4",
        "video/mpeg",
        "video/quicktime",
        "video/x-msvideo",
        "video/x-matroska",
        "video/webm",
        "video/ogg",
    }
    flash_types = {"application/x-shockwave-flash", "application/vnd.adobe.flash.movie"}
    archive_types = {
        "application/zip",
        "application/x-rar-compressed",
        "application/x-tar",
        "application/gzip",
        "application/x-7z-compressed",
        "application/x-bzip2",
    }
    pdf_types = {"application/pdf"}
    audio_types = {"audio/mpeg", "audio/wav", "audio/ogg", "audio/flac", "audio/aac"}

    if mime_type in image_types:
        return "image"
    elif mime_type in gif_types:
        return "gif"
    elif mime_type in video_types:
        return "video"
    elif mime_type in flash_types:
        return "flash"
    elif mime_type in archive_types:
        return "archive"
    elif mime_type in pdf_types:
        return "pdf"
    elif mime_type in audio_types:
        return "audio"
    else:
        return "other"