linkcheck.mimeutil

File and path utilities.

Functions

add_mimetype(mimedb, mimetype, extension)

Add or replace a mimetype to be used with the given extension.

guess_mimetype(filename[, read])

Return MIME type of file, or 'application/octet-stream' if it could not be determined.

guess_mimetype_read(read)

Try to read some content and do a poor man's file(1).

init_mimedb()

Initialize the local MIME database.

linkcheck.mimeutil.add_mimetype(mimedb, mimetype, extension)[source]

Add or replace a mimetype to be used with the given extension.

linkcheck.mimeutil.guess_mimetype(filename, read=None)[source]

Return MIME type of file, or ‘application/octet-stream’ if it could not be determined.

linkcheck.mimeutil.guess_mimetype_read(read)[source]

Try to read some content and do a poor man’s file(1).

linkcheck.mimeutil.init_mimedb()[source]

Initialize the local MIME database.