ocrd_utils.os module¶
Operating system functions.
- ocrd_utils.os.is_file_in_directory(directory, file)[source]¶
Return True if
file
is indirectory
(by checking that all components ofdirectory
are infile.parts
)
- ocrd_utils.os.get_processor_resource_types(executable, ocrd_tool=None)[source]¶
Determine what type of resource parameters a processor needs.
Return a list of MIME types (with the special value */* to designate that arbitrary files or directories are allowed).
- ocrd_utils.os.guess_media_type(input_file: str, fallback: str | None = None, application_xml: str = 'application/xml')[source]¶
Guess the media type of a file path