sdk/python/File System/PyMimetypes
File System

PyMimetypes

Python stdlib module — mimetypes. Auto-indexed from CDN. Method-level security roles have not been annotated; rule writers should inspect the source before use.

Other Methods

.add_type()Neutral
#
Signature
add_type(type, ext, strict)

Add a mapping between a type and an extension.

.guess_all_extensions()Neutral
#
Signature
guess_all_extensions(type, strict)

Guess the extensions for a file based on its MIME type.

.guess_extension()Neutral
#
Signature
guess_extension(type, strict)

Guess the extension for a file based on its MIME type.

.guess_type()Neutral
#
Signature
guess_type(url, strict)

Guess the type of a file based on its URL.

.init()Neutral
#
Signature
init(files)

init function.

.read_mime_types()Neutral
#
Signature
read_mime_types(file)

read_mime_types function.

.MimeTypes()Neutral
#
Signature
MimeTypes(...)

MIME-types datastore.

Fully-Qualified Names

FQNField
mimetypesfqns[0]

Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.

Import

rule.py
import mimetypes