class MediaType:

    aac = {'extension': '.aac', 'document_type': 'AAC audio file', 'mime': 'audio/aac'}
    abw = {'extension': '.abw', 'document_type': 'Document AbiWord', 'mime': 'application/x-abiword'}
    arc = {'extension': '.arc', 'document_type': 'Archive document (multiple files embedded)', 'mime': 'application/octet-stream'}
    avi = {'extension': '.avi', 'document_type': 'Audio and video file  Merge AVI', 'mime': 'video/x-msvideo'}
    azw = {'extension': '.azw', 'document_type': 'Amazon Kindle eBook Format', 'mime': 'application/vnd.amazon.ebook'}
    bin = {'extension': '.bin', 'document_type': 'Any kind of binary data', 'mime': 'application/octet-stream'}
    bz = {'extension': '.bz', 'document_type': 'Compressed file  BZip', 'mime': 'application/x-bzip'}
    bz2 = {'extension': '.bz2', 'document_type': 'Compressed file BZip2', 'mime': 'application/x-bzip2'}
    csh = {'extension': '.csh', 'document_type': 'C-Shell script', 'mime': 'application/x-csh'}
    css = {'extension': '.css', 'document_type': 'Cascading Style Sheets (CSS)', 'mime': 'text/css'}
    csv = {'extension': '.csv', 'document_type': 'Comma-separated values (CSV)', 'mime': 'text/csv'}
    doc = {'extension': '.doc', 'document_type': 'Microsoft Word', 'mime': 'application/msword'}
    eot = {'extension': '.eot', 'document_type': 'MS Embedded OpenType fonts', 'mime': 'application/vnd.ms-fontobject'}
    epub = {'extension': '.epub', 'document_type': 'Electronic publication (EPUB)', 'mime': 'application/epub+zip'}
    gif = {'extension': '.gif', 'document_type': 'Graphics Interchange Format (GIF)', 'mime': 'image/gif'}
    htm = {'extension': '.htm', 'document_type': 'HyperText Markup Language (HTML)', 'mime': 'text/html'}
    html = {'extension': '.html', 'document_type': 'HyperText Markup Language (HTML)', 'mime': 'text/html'}
    ico = {'extension': '.ico', 'document_type': 'Icon format', 'mime': 'image/x-icon'}
    ics = {'extension': '.ics', 'document_type': 'iCalendar format', 'mime': 'text/calendar'}
    jar = {'extension': '.jar', 'document_type': 'Java Archive (JAR)', 'mime': 'application/java-archive'}
    jpeg = {'extension': '.jpeg', 'document_type': 'JPEG images', 'mime': 'image/jpeg'}
    jpg = {'extension': '.jpg', 'document_type': 'JPEG images', 'mime': 'image/jpeg'}
    js = {'extension': '.js', 'document_type': 'JavaScript (ECMAScript)', 'mime': 'application/javascript'}
    json = {'extension': '.json', 'document_type': 'JSON format', 'mime': 'application/json'}
    mid = {'extension': '.mid', 'document_type': 'Musical Instrument Digital Interface (MIDI)', 'mime': 'audio/midi'}
    midi = {'extension': '.midi', 'document_type': 'Musical Instrument Digital Interface (MIDI)', 'mime': 'audio/midi'}
    mpeg = {'extension': '.mpeg', 'document_type': 'MPEG Video', 'mime': 'video/mpeg'}
    mpkg = {'extension': '.mpkg', 'document_type': 'Apple Installer Package', 'mime': 'application/vnd.apple.installer+xml'}
    odp = {'extension': '.odp', 'document_type': 'OpenDocument presentation document', 'mime': 'application/vnd.oasis.opendocument.presentation'}
    ods = {'extension': '.ods', 'document_type': 'OpenDocument spreadsheet document', 'mime': 'application/vnd.oasis.opendocument.spreadsheet'}
    odt = {'extension': '.odt', 'document_type': 'OpenDocument text document', 'mime': 'application/vnd.oasis.opendocument.text'}
    oga = {'extension': '.oga', 'document_type': 'OGG audio', 'mime': 'audio/ogg'}
    ogv = {'extension': '.ogv', 'document_type': 'OGG video', 'mime': 'video/ogg'}
    ogx = {'extension': '.ogx', 'document_type': 'OGG', 'mime': 'application/ogg'}
    otf = {'extension': '.otf', 'document_type': 'OpenType font', 'mime': 'font/otf'}
    png = {'extension': '.png', 'document_type': 'Portable Network Graphics', 'mime': 'image/png'}
    pdf = {'extension': '.pdf', 'document_type': 'Adobe Portable Document Format (PDF)', 'mime': 'application/pdf'}
    ppt = {'extension': '.ppt', 'document_type': 'Microsoft PowerPoint', 'mime': 'application/vnd.ms-powerpoint'}
    rar = {'extension': '.rar', 'document_type': 'RAR archive', 'mime': 'application/x-rar-compressed'}
    rtf = {'extension': '.rtf', 'document_type': 'Rich Text Format (RTF)', 'mime': 'application/rtf'}
    sh = {'extension': '.sh', 'document_type': 'Bourne shell script', 'mime': 'application/x-sh'}
    svg = {'extension': '.svg', 'document_type': 'Scalable Vector Graphics (SVG)', 'mime': 'image/svg+xml'}
    swf = {'extension': '.swf', 'document_type': 'Small web format (SWF) or Adobe Flash document', 'mime': 'application/x-shockwave-flash'}
    tar = {'extension': '.tar', 'document_type': 'Tape Archive (TAR)', 'mime': 'application/x-tar'}
    tif = {'extension': '.tif', 'document_type': 'Tagged Image File Format (TIFF)', 'mime': 'image/tiff'}
    tiff = {'extension': '.tiff', 'document_type': 'Tagged Image File Format (TIFF)', 'mime': 'image/tiff'}
    ts = {'extension': '.ts', 'document_type': 'Typescript file', 'mime': 'application/typescript'}
    ttf = {'extension': '.ttf', 'document_type': 'TrueType Font', 'mime': 'font/ttf'}
    vsd = {'extension': '.vsd', 'document_type': 'Microsoft Visio', 'mime': 'application/vnd.visio'}
    wav = {'extension': '.wav', 'document_type': 'Waveform Audio Format', 'mime': 'audio/x-wav'}
    weba = {'extension': '.weba', 'document_type': 'WEBM audio', 'mime': 'audio/webm'}
    webm = {'extension': '.webm', 'document_type': 'WEBM video', 'mime': 'video/webm'}
    webp = {'extension': '.webp', 'document_type': 'WEBP image', 'mime': 'image/webp'}
    woff = {'extension': '.woff', 'document_type': 'Web Open Font Format (WOFF)', 'mime': 'font/woff'}
    woff2 = {'extension': '.woff2', 'document_type': 'Web Open Font Format (WOFF)', 'mime': 'font/woff2'}
    xhtml = {'extension': '.xhtml', 'document_type': 'XHTML', 'mime': 'application/xhtml+xml'}
    xls = {'extension': '.xls', 'document_type': 'Microsoft Excel', 'mime': 'application/vnd.ms-excel'}
    xlsx = {'extension': '.xlsx', 'document_type': 'Microsoft Excel', 'mime': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'}
    xml = {'extension': '.xml', 'document_type': 'XML', 'mime': 'application/xml'}
    xul = {'extension': '.xul', 'document_type': 'XUL', 'mime': 'application/vnd.mozilla.xul+xml'}
    zip = {'extension': '.zip', 'document_type': 'ZIP archive', 'mime': 'application/zip'}

    all_medias = [aac, abw, arc, avi, azw, bin, bz, bz2, csh, css, csv, doc, eot, epub, gif, htm, html, ico, ics, jar, jpeg, jpg, js, json, mid, midi, mpeg, mpkg, odp, ods, odt, oga, ogv, ogx, otf, png, pdf, ppt, rar, rtf, sh, svg, swf, tar, tif, tiff, ts, ttf, vsd, wav, weba, webm, webp, woff, woff2, xhtml, xls, xlsx, xml, xul, zip]

    def get_type(self, file_name):

        answer = ""
        for m in self.all_medias:
            # if m['extension'] in file_name:
            if file_name.endswith(m['extension']):
                return m
            else:
                answer = "No identified"

        return answer


if __name__ == '__main__':
    media = MediaType()