Skip to content

corona10/mimesniff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mimesniff

https://travis-ci.org/corona10/mimesniff.svg?branch=master https://img.shields.io/pypi/v/mimesniff.svg?style=flat

Pure python mimesniff implementation of https://mimesniff.spec.whatwg.org

API interface is similar with API of python standard library

Install

pip install mimesniff

Usage

import mimesniff

res = mimesniff.what('sample.mp3')
print(res)
# audio/mpeg
with open('sample.mp3', 'rb') as fin:
    res = mimesniff.what(fin)
    print(res)
    # audio/mpeg

with open('sample.mp3', 'rb') as fin:
    header = fin.read(512)
    res = mimesniff.what(header)
    print(res)
    # audio/mpeg
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy