Read / Write Extension#

class metacatalog.ext.io.IOExtension(entry: Entry)#

Input / Output extension. This is the default extension for all kind of CRUD operations on the actual data described by metacatalog. It can be used on two different levels. As a class, it offers classmethods to add and return new functions for performing the actual TODO: finish documentation

append(data, **kwargs)#

Execute an append operation on the datasource. To load the registered function and run the after_append converter, you can simply call the abstractmethod template from the new Interface like:

class IOInterface(IOExtensionInterface):
    def append(self, data, **kwargs):
        return super(IOInterface, self).append(data, **kwargs)
delete(**kwargs)#

Execute a delete operation on the datasource. To load the registered function and run the after_delete converter, you can simply call the abstractmethod template from the new Interface like:

class IOInterface(IOExtensionInterface):
    def delete(self, **kwargs):
        return super(IOInterface, self).delte(**kwargs)
import_(data, **kwargs)#

Execute an import operation on the datasource. To load the registered function and run the after_import converter, you can simply call the abstractmethod template from the new Interface like:

class IOInterface(IOExtensionInterface):
    def import_(self, data, **kwargs):
        return super(IOInterface, self).import_(data, **kwargs)
classmethod init_extension()#

Add the IOExtension as an attribute to the Entry model

read(**kwargs)#

Execute a read operation on the datasource. To load the registered function and run the after_read converter, you can simply call the abstractmethod template from the new Interface like:

class IOInterface(IOExtensionInterface):
    def read(self, **kwargs):
        return super(IOInterface, self).read(**kwargs)