Sniffpy
Sniffpy is a python implementation of MIME Sniffing Standard
MIME sniffing describes algorithms that attempt to discern the correct MIME type of some given
data. The MIME type of a file or byte stream describes its format. For example, the MIME type of an image could be
image/jpeg or image/png depending on its exact format. MIME types consist of:
- the
typewhich describesthe broad category of the data - the
subtypewhich describes the exact kind of data - an optional
parameterwhich gives further information about the data
The exact specification of MIME types can be found here
Example
The following is an example on how to use sniffpy to guess the MIME type of an HTTP response using requests
import requests
r = requests.get("https://httpbin.org/image/jpeg")
mime_type = sniffpy.sniff(r.content) #returns a MIMEType object
print(mime_type.type) #prints "image"
print(mime_type.subtype) #prints "jpeg"
print(mime_type) #prints "image/jpeg"
Documentation on how to use the package and how to contribute can be found on here
Metadata
Release files for sniffpy 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sniffpy-1.0.0.tar.gz | 13.2 kB | Without provenance | Details for sniffpy-1.0.0.tar.gz |
Release files / sniffpy-1.0.0.tar.gz
| Download URL | sniffpy-1.0.0.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
978b6eb7615b67e9bb2214aa019ac8512f2cb090faba01562038036bac4dcf9d
|
|
BLAKE2b-256 checksum How to use checksums |
b67e9beb770947a6e911e3c61ca86acb7f7b11d00d93be25dbd3e8fa231d425e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.3
|
Security for sniffpy 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.