Pure python mimesniff implementation of https://mimesniff.spec.whatwg.org
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mimesniff-1.1.1.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for mimesniff-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25d1245f78e4e9940342cc4df1025d5afcd38bc96ad047e84a9a434796b8c20f |
|
MD5 | e6379cda7d7d5109599139a195030011 |
|
BLAKE2b-256 | 92465c7deba62f6c383f6532d820b2c58f7244a9a48fab64d1d4087087f4d182 |