Pycontent-type

Latest version: v1.1.0

Safety actively analyzes 687918 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

1.1.0

**Full Changelog**: https://github.com/yezz123/pycontent-type/compare/1.0.0...1.1.0

1.0.0

<p align="center">
<em>A Python library to access all Supported Content-Types/Media-Types ⚡</em>
</p>

Installation

You can add pycontent-type in a few easy steps. First of all, install the dependency:

shell
$ pip install pycontent-type

---> 100%

Successfully installed pycontent-type


Usage

We have a simple API to access all the supported content-types:

As known the categories of content-types are:

- `application`
- `audio`
- `font`
- `image`
- `message`
- `model`
- `multipart`
- `text`
- `video`

Get Content-Type by extension

python
Get content-type for application
import pycontent_type

len(pycontent_type.application)

>>> 1551

Get content-type for specific extension using Name
pycontent_type.application.get(Name='json')

>>> application(Name='json', Template='application/json')

Get content-type for specific extension using Template
pycontent_type.application.get(Template='application/xml')

>>> application(Name='xml', Template='application/xml')


The same applies for all the categories, we have 2 ways to get the content-type:

- Using `Name` attribute
- Using `Template` attribute

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.