# `mimetypeplus`
> A simple python module focused on easy MIME type manipulation and detection.
[Documentation](https://MarkusHammer.github.io/mimetypeplus-python)
## Setup
This module can be installed using:
```bash
pip install mimetypeplus
```
## Usage
This module is intended to be used only as a module, and can be imported after installing using the traditional process:
```python
from mimetypeplus import MimeType
```
### Create a MIME Type Object
```python
mime = MimeType("application/json")
```
### Identify MIME Types
Quickly determine the MIME type of content from various sources:
```python
# Identify MIME type from a file path
mime = MimeType.from_path("data.json")
mime = MimeType.from_path(__file__)
# Identify MIME type from a URI
mime = MimeType.from_uri("https://example.com/api/data")
```
### Facet Manipulation
```python
# Check if the MIME type is experimental
if mime.experimental_facet:
print("This is an experimental MIME type.")
# Set a vendor-specific facet
mime.facet = "vnd"
```
### Quickly Find File Extensions
```python
extension = mime.to_extention()
print(f"The file extension for this MIME type is '{extension}'")
```
### And More
There are a handfull of other ease of use features that this module provides, feel free to reference the [documentation](https://MarkusHammer.github.io/mimetypeplus-python) for more information.
## Licence
This is licensed under the Mozilla Public License 2.0 (MPL 2.0) Licence. See the Licence file in this repository for more information.
## Contribute
Contributions are always welcome!
Use the [github repository](https://github.com/MarkusHammer/mimetypeplus-python) to report issues and contribute to this project.
## Credits
While not required, feel free to credit "Markus Hammer" (or just "Markus") if you find this code or script useful for whatever you may be doing with it.
# Security Policy
While the python source code will be actively maintained, any binary files (if at all provided) are in no way supported.
These are provided as a courtesy and are not intended to be the main usage of this software.
Please keep this in mind when choosing how you wish to use this software.
## Supported Versions
| Version | Supported |
| ----------- | --------- |
| 1.0.0.0 >= | ✅ |
| 1.0.0.0 < | ❌ |
## Reporting a Vulnerability
Please report any issues to the email 107761433+MarkusHammer(THEN THE @ SYMBOL HERE)users.noreply.github.com
Raw data
{
"_id": null,
"home_page": null,
"name": "mimetypeplus",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "MIME, MIME type, content, content type, file, extension, media, type, HTTP, HTML, web, development, content negotiation, file management, internet, utilities",
"author": null,
"author_email": "Markus Hammer <107761433+MarkusHammer@users.noreply.github.com>",
"download_url": "https://files.pythonhosted.org/packages/b5/87/640f698de26862819d4c03bb063331ca0b3a546c767f6d32b218d84a2f92/mimetypeplus-1.0.0.0.tar.gz",
"platform": null,
"description": "\r\n# `mimetypeplus`\r\n\r\n> A simple python module focused on easy MIME type manipulation and detection.\r\n\r\n[Documentation](https://MarkusHammer.github.io/mimetypeplus-python)\r\n\r\n## Setup\r\n\r\nThis module can be installed using:\r\n\r\n```bash\r\npip install mimetypeplus\r\n```\r\n\r\n## Usage\r\n\r\nThis module is intended to be used only as a module, and can be imported after installing using the traditional process:\r\n\r\n```python\r\nfrom mimetypeplus import MimeType\r\n```\r\n\r\n### Create a MIME Type Object\r\n\r\n```python\r\nmime = MimeType(\"application/json\")\r\n```\r\n\r\n### Identify MIME Types\r\n\r\nQuickly determine the MIME type of content from various sources:\r\n\r\n```python\r\n# Identify MIME type from a file path\r\nmime = MimeType.from_path(\"data.json\")\r\nmime = MimeType.from_path(__file__)\r\n\r\n# Identify MIME type from a URI\r\nmime = MimeType.from_uri(\"https://example.com/api/data\")\r\n```\r\n\r\n### Facet Manipulation\r\n\r\n```python\r\n# Check if the MIME type is experimental\r\nif mime.experimental_facet:\r\n print(\"This is an experimental MIME type.\")\r\n\r\n# Set a vendor-specific facet\r\nmime.facet = \"vnd\"\r\n```\r\n\r\n### Quickly Find File Extensions\r\n\r\n```python\r\nextension = mime.to_extention()\r\nprint(f\"The file extension for this MIME type is '{extension}'\")\r\n```\r\n\r\n### And More\r\n\r\nThere are a handfull of other ease of use features that this module provides, feel free to reference the [documentation](https://MarkusHammer.github.io/mimetypeplus-python) for more information.\r\n\r\n## Licence\r\n\r\nThis is licensed under the Mozilla Public License 2.0 (MPL 2.0) Licence. See the Licence file in this repository for more information.\r\n\r\n## Contribute\r\n\r\nContributions are always welcome!\r\nUse the [github repository](https://github.com/MarkusHammer/mimetypeplus-python) to report issues and contribute to this project.\r\n\r\n## Credits\r\n\r\nWhile not required, feel free to credit \"Markus Hammer\" (or just \"Markus\") if you find this code or script useful for whatever you may be doing with it.\r\n\r\n# Security Policy\r\n\r\nWhile the python source code will be actively maintained, any binary files (if at all provided) are in no way supported.\r\nThese are provided as a courtesy and are not intended to be the main usage of this software.\r\nPlease keep this in mind when choosing how you wish to use this software.\r\n\r\n## Supported Versions\r\n\r\n| Version | Supported |\r\n| ----------- | --------- |\r\n| 1.0.0.0\u00a0>= | \u2705 |\r\n| 1.0.0.0\u00a0< | \u274c |\r\n\r\n## Reporting a Vulnerability\r\n\r\nPlease report any issues to the email 107761433+MarkusHammer(THEN THE @ SYMBOL HERE)users.noreply.github.com\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A powerful Python module for intuitive MIME type management, providing utilities for identifying, creating, and manipulating MIME types in various contexts.",
"version": "1.0.0.0",
"project_urls": {
"Documentation": "https://MarkusHammer.github.io/mimetypeplus-python",
"Git": "https://github.com/MarkusHammer/mimetypeplus-python.git",
"Github": "https://github.com/MarkusHammer/mimetypeplus-python",
"Homepage": "https://github.com/MarkusHammer/mimetypeplus-python",
"Issues": "https://github.com/MarkusHammer/mimetypeplus-python/issues",
"Pull Requests": "https://github.com/MarkusHammer/mimetypeplus-python/pulls"
},
"split_keywords": [
"mime",
" mime type",
" content",
" content type",
" file",
" extension",
" media",
" type",
" http",
" html",
" web",
" development",
" content negotiation",
" file management",
" internet",
" utilities"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cee709d4b4c85205b5994958e1c5662a6719181bc221d411dabe6e201cfa091b",
"md5": "10497db6f91ec21f1bd2d200dc8d1956",
"sha256": "d97239d1197cb43e8c65c048d8704d9d6f0e7c8210de6e148a36128954970e9e"
},
"downloads": -1,
"filename": "mimetypeplus-1.0.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "10497db6f91ec21f1bd2d200dc8d1956",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 16065,
"upload_time": "2024-08-14T18:36:24",
"upload_time_iso_8601": "2024-08-14T18:36:24.666079Z",
"url": "https://files.pythonhosted.org/packages/ce/e7/09d4b4c85205b5994958e1c5662a6719181bc221d411dabe6e201cfa091b/mimetypeplus-1.0.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b587640f698de26862819d4c03bb063331ca0b3a546c767f6d32b218d84a2f92",
"md5": "39a68521f1f0260fc87232432ba7d4e3",
"sha256": "001b6241568ee7300e07f4f723f61bb2715b9d1fa30c11dbcea26b6d0e0534bc"
},
"downloads": -1,
"filename": "mimetypeplus-1.0.0.0.tar.gz",
"has_sig": false,
"md5_digest": "39a68521f1f0260fc87232432ba7d4e3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 16083,
"upload_time": "2024-08-14T18:36:26",
"upload_time_iso_8601": "2024-08-14T18:36:26.280077Z",
"url": "https://files.pythonhosted.org/packages/b5/87/640f698de26862819d4c03bb063331ca0b3a546c767f6d32b218d84a2f92/mimetypeplus-1.0.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-14 18:36:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "MarkusHammer",
"github_project": "mimetypeplus-python",
"github_not_found": true,
"lcname": "mimetypeplus"
}