Skip to main content

mime.py

Source: src/sunholo/utils/mime.py

Functions

guess_mime_type(file_path: str) -> str

Guess the mime type based on the file extension.

Args: file_path (str): The path or URL of the image file.

Returns: str: The guessed image type (e.g., "jpeg", "png", "gif", etc.) or None if the extension is not recognized.

get_mime_type_gemini(file_path: str) -> str

Determine the MIME type based on file extension. Only returns valid Gemini formats, or None if they are not supported.

Args: file_path (str): Path to the file

Returns: str: The appropriate MIME type for the file

Sunholo Multivac

Get in touch to see if we can help with your GenAI project.

Contact us

Other Links

Sunholo Multivac - GenAIOps

Copyright ©

Holosun ApS 2025