Skip to main content

Media Type parsing and creation

Project description

mediatype

Media Type (aka MIME Type) parsing and creation

Installation

pip install mediatype

Usage

>>> import mediatype

Parsing

>>> media_type = mediatype.parse('application/manifest+json')
>>>
>>> media_type
MediaType(
    type='application',
    subtype='manifest',
    suffix='json',
    parameters=None
)
>>>
>>> str(media_type)
'application/manifest+json'

Creation

>>> media_type = mediatype.MediaType(
    type='application',
    subtype='manifest',
    suffix='json',
    parameters=None
)
>>>
>>> str(media_type)
'application/manifest+json'

References

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

mediatype-0.1.6.tar.gz (27.2 kB view hashes)

Uploaded Source

Built Distribution

mediatype-0.1.6-py3-none-any.whl (27.3 kB view hashes)

Uploaded Python 3

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