Document Connectors
get_source
. This method takes a document as input and returns the bytes of the original content.
Let’s examine a simple example of a connector implementation:
LocalFilesystemConnector
class defines a get_source
method that opens the file specified by the document’s source attribute and reads its contents as bytes. This implementation allows easy access to files stored in the local filesystem.
Connectors can be implemented for various source types, such as cloud storage services, databases, or remote file systems, providing a uniform interface for accessing original document content regardless of its location or storage mechanism.
By leveraging connectors, Kodexa offers a flexible and powerful way to maintain a link between processed documents and their original sources, enabling more sophisticated document analysis and processing workflows.