Skip to main content

A powerful Python module for intuitive MIME type management, providing utilities for identifying, creating, and manipulating MIME types in various contexts.

Project description

mimetypeplus

A simple python module focused on easy MIME type manipulation and detection.

Documentation

Setup

This module can be installed using:

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:

from mimetypeplus import MimeType

Create a MIME Type Object

mime = MimeType("application/json")

Identify MIME Types

Quickly determine the MIME type of content from various sources:

# 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

# 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

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 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 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

Project details


Download files

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

Source Distribution

mimetypeplus-1.0.0.0.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

mimetypeplus-1.0.0.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file mimetypeplus-1.0.0.0.tar.gz.

File metadata

  • Download URL: mimetypeplus-1.0.0.0.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for mimetypeplus-1.0.0.0.tar.gz
Algorithm Hash digest
SHA256 001b6241568ee7300e07f4f723f61bb2715b9d1fa30c11dbcea26b6d0e0534bc
MD5 39a68521f1f0260fc87232432ba7d4e3
BLAKE2b-256 b587640f698de26862819d4c03bb063331ca0b3a546c767f6d32b218d84a2f92

See more details on using hashes here.

File details

Details for the file mimetypeplus-1.0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mimetypeplus-1.0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d97239d1197cb43e8c65c048d8704d9d6f0e7c8210de6e148a36128954970e9e
MD5 10497db6f91ec21f1bd2d200dc8d1956
BLAKE2b-256 cee709d4b4c85205b5994958e1c5662a6719181bc221d411dabe6e201cfa091b

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