o
    *Î®cƒ  ã                   @   s|   d dl mZ ddlmZ ddlmZmZmZmZm	Z	m
Z
 dd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )é    )Úabsolute_importé   )ÚTYPES)Úimage_matchÚ
font_matchÚdocument_matchÚvideo_matchÚaudio_matchÚarchive_matchc                 C   ó   t D ]
}|j| kr dS qdS )a  
    Checks if the given extension string is
    one of the supported by the file matchers.

    Args:
        ext (str): file extension string. E.g: jpg, png, mp4, mp3

    Returns:
        True if the file extension is supported.
        Otherwise False.
    TF)r   Ú	extension)ÚextÚkind© r   ú7/tmp/pip-target-vg8gfxp4/lib/python/filetype/helpers.pyÚis_extension_supported   ó
   
ÿr   c                 C   r   )zû
    Checks if the given MIME type string is
    one of the supported by the file matchers.

    Args:
        mime (str): MIME string. E.g: image/jpeg, video/mpeg

    Returns:
        True if the MIME type is supported.
        Otherwise False.
    TF)r   Úmime)r   r   r   r   r   Úis_mime_supported   r   r   c                 C   ó   t | ƒduS )zû
    Checks if a given input is a supported type image.

    Args:
        obj: path to file, bytes or bytearray.

    Returns:
        True if obj is a valid image. Otherwise False.

    Raises:
        TypeError: if obj is not a supported type.
    N)r   ©Úobjr   r   r   Úis_image/   ó   r   c                 C   r   )zÿ
    Checks if a given input is a supported type archive.

    Args:
        obj: path to file, bytes or bytearray.

    Returns:
        True if obj is a valid archive. Otherwise False.

    Raises:
        TypeError: if obj is not a supported type.
    N)r
   r   r   r   r   Ú
is_archive?   r   r   c                 C   r   )zû
    Checks if a given input is a supported type audio.

    Args:
        obj: path to file, bytes or bytearray.

    Returns:
        True if obj is a valid audio. Otherwise False.

    Raises:
        TypeError: if obj is not a supported type.
    N)r	   r   r   r   r   Úis_audioO   r   r   c                 C   r   )zû
    Checks if a given input is a supported type video.

    Args:
        obj: path to file, bytes or bytearray.

    Returns:
        True if obj is a valid video. Otherwise False.

    Raises:
        TypeError: if obj is not a supported type.
    N)r   r   r   r   r   Úis_video_   r   r   c                 C   r   )zù
    Checks if a given input is a supported type font.

    Args:
        obj: path to file, bytes or bytearray.

    Returns:
        True if obj is a valid font. Otherwise False.

    Raises:
        TypeError: if obj is not a supported type.
    N)r   r   r   r   r   Úis_fonto   r   r   c                 C   r   )a  
    Checks if a given input is a supported type document.

    Args:
        obj: path to file, bytes or bytearray.

    Returns:
        True if obj is a valid document. Otherwise False.

    Raises:
        TypeError: if obj is not a supported type.
    N)r   r   r   r   r   Úis_document   r   r   N)Ú
__future__r   Útypesr   Úmatchr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   Ú<module>   s    