Skip to main content

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

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

mimesniff-1.1.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file mimesniff-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: mimesniff-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for mimesniff-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85c14c96052f80aecaf744771f4f72beee93e4d860d3c42742fea12218fb2e51
MD5 01dd0bef6f1ec920556fbad8e3fb77f9
BLAKE2b-256 103254e00f6757fc9044a2782a1ce629e4816be5e8c0b830a37095557dc42831

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page