Fast MIME
Support Rails/Marcel style MIME for Python.
It uses Apache Tike's rule.
It's customizable.
Install
pip install fast-mime
Usage
Detect MIME
from fast_mime import MIME
with open("a.pdf") as fi:
mime = MIME(file=fi, name="a.pdf", declared_type="application/pdf", extension=".pdf")
# all parameters are optional
Customize MIME rules
from fast_mime import Mime
# define your own mime rule
MIME = Mime.from_xmls(your_rule_file_name)
Patch MIME
class MyMime(Mime):
def _patch(self):
super()._patch()
...
Metadata
Release files for fast-mime 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fast_mime-0.1.3.tar.gz | 48.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fast_mime-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 99.4 kB
Release files / fast_mime-0.1.3.tar.gz
| Download URL | fast_mime-0.1.3.tar.gz |
|---|---|
| Size | 48.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1bd1c62ce9110cd246b9bb9ac82c5543d74d0d01460e5ddec2256aed2d00668b
|
|
BLAKE2b-256 checksum How to use checksums |
a99509e6af2490b2781baf9a8ab81d64cfab2442bb161424aed53227e77423ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.2 Darwin/23.5.0
|
Release files / fast_mime-0.1.3-py3-none-any.whl
| Download URL | fast_mime-0.1.3-py3-none-any.whl |
|---|---|
| Size | 50.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
67fc11e77dfba07a4c88520fdf0a529aafe2db81ae593462495eb0b726b38cf6
|
|
BLAKE2b-256 checksum How to use checksums |
10779050e403b587327fc5e1862f4c14976a6b3a51561f3262883c2d20f2d097
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.2 Darwin/23.5.0
|