Una libreria Python per rilevare il tipo MIME di file locali e URL remoti
Project description
MIMEDetector
MIMEDetector is a Python library that makes it easy to detect MIME types of local files and remote URLs.
Italian Documentation (Documentazione in Italiano)
Installation
pip install mimedetector
Usage
from mimedetector import MIMEDetector
# English debug messages (default)
detector = MIMEDetector()
# Italian debug messages
detector_it = MIMEDetector(language="it")
# Check a local file
mime_type = detector.get_MIME("path/to/local/file.pdf")
print(f"Local file MIME type: {mime_type}")
# Check a remote URL
mime_type = detector.get_MIME("https://example.com/file.pdf")
print(f"URL MIME type: {mime_type}")
Features
- Automatic detection between local files and remote URLs
- Support for Path and string paths
- Robust error handling
- Optional debugging for URL requests
- Multilanguage support (English and Italian)
Requirements
- Python 3.7+
- requests
License
This project is distributed under the MIT license.
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
mimedetector-0.1.0.tar.gz
(6.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mimedetector-0.1.0.tar.gz.
File metadata
- Download URL: mimedetector-0.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3184560c2d8bb0aa43f6f49614be506db9d7d1580c15523038e3ad13906c8b0c
|
|
| MD5 |
82f86c59c2a4c0129c786d88cf59d3bb
|
|
| BLAKE2b-256 |
aba69a70a0450134442dc680e9f9853c872de1b8f0d893c5092856377d5c1955
|
File details
Details for the file mimedetector-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mimedetector-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f09676b445b84b51c74167e99261b5e2cea4fae30cc97f85df7baa712b29045
|
|
| MD5 |
93b3c912ed63de6b4661f51e0e664e5e
|
|
| BLAKE2b-256 |
1410c43922a9a5bdc70132fc289038ae4e77452d280becceee0ddf9badc06fc5
|