load
This module contains all the code necessary for loading input documents from files or database.
The documents loaded by this module are intended to be submitted to emtelliPro.
Also see emtellipro.ccd for reading CCD files.
Submodules
data- LoadedFile from various sources.utils- These are utility functions helpful for loading files.
Module Contents
Functions
API
emtellipro.load.readfile
Read documents from the given file path.
This function is used for loading documents from files which will then be
submitted to emtelliPro for processing (using
emtellipro.engine.Emtellipro).
Although CCDs are readable using this function, for more control over how
they’re parsed, see emtellipro.ccd.
For more details on the supported file formats, see /input-formats
Parameters:
The path to the file. May be a string of pathlib.Path instance.
The filetype to use for the given file; this is used to override the automatic detection based on file extensions.
Extra arguments to pass to the file handler for the given/detected filetype.
These may include:
category The default category to use; may be overriden by the value specified in the file in the case of JSON files. If emtelliPro should infer the category, this should be set to “auto”.
This should be set.
subcategory The default subcategory to use; may be overriden by the value specified in the file in the case of JSON files.
This should be set.
section_label The section label value to use when submitting a document to emtelliPro. This is optional.
file_encoding For text files, it’s important to know the file encoding if it’s not utf-8, because the autodetection of file encoding may be slow or get it wrong.
doc_id_filepath Whether to generate a document ID based on the file path; this is mostly helpful for debugging errors.
config An extra config dictionary that is currently only used by the CCD plugin. It should have a mapping where the key is ‘ccd’ and the value is a dictionary with any extra CCD-related options.
See the CCD section of the documentation for more details.
Returns:
The loaded file containing the input documents. Example:
Return type: LoadedFile

