Skip to main content

pycontent-type

A Python library to access all Supported Content-Types/Media-Types ⚡

lint Package version

Installation

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

$ 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

# 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

Development 🚧

Setup environment 📦

You should create a virtual environment and activate it:

python -m venv venv/
source venv/bin/activate

And then install the development dependencies:

# Install dependencies
pip install -e .[test,lint]

Run tests 🌝

You can run all the tests with:

bash scripts/test.sh

Format the code 🍂

Execute the following command to apply pre-commit formatting:

bash scripts/format.sh

License

This project is licensed under the terms of the MIT license.

Metadata

Release files for pycontent-type 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycontent-type 1.1.0
File Size Uploaded Provenance Actions
pycontent_type-1.1.0.tar.gz 30.8 kB Without provenance Details for pycontent_type-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pycontent-type 1.1.0
File Interpreter ABI Platform Actions
pycontent_type-1.1.0-py3-none-any.whl Python 3 none any Details for pycontent_type-1.1.0-py3-none-any.whl

Total release size: 60.2 kB

Release files / pycontent_type-1.1.0.tar.gz

Download URL pycontent_type-1.1.0.tar.gz
Size 30.8 kB
Tags Source
SHA-256 checksum
How to use checksums
978c6315daa40de51f3789465772469dc2c1a5937383f57156b6ff48350e67f5
BLAKE2b-256 checksum
How to use checksums
d189d3857db81a2177564f6817182ce8fd1231b407b9b9511547251073ef941b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.3

Release files / pycontent_type-1.1.0-py3-none-any.whl

Download URL pycontent_type-1.1.0-py3-none-any.whl
Size 29.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e519884ce9f949b00a0e75bb7df76533814e4bf80d8b323df35612767f17017
BLAKE2b-256 checksum
How to use checksums
777614befff13d906c3390b86385a67e2a793b458d1fc24093af5981ada24539
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.3

Security for pycontent-type 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page