biothings.hub.dataplugin¶
biothings.hub.dataplugin.assistant¶
- class biothings.hub.dataplugin.assistant.AdvancedPluginLoader(plugin_name)[source]¶
Bases:
BasePluginLoader
- loader_type = 'advanced'¶
- class biothings.hub.dataplugin.assistant.AssistantManager(data_plugin_manager, dumper_manager, uploader_manager, keylookup=None, default_export_folder='hub/dataload/sources', *args, **kwargs)[source]¶
Bases:
BaseSourceManager
- configure(klasses=[<class 'biothings.hub.dataplugin.assistant.GithubAssistant'>, <class 'biothings.hub.dataplugin.assistant.LocalAssistant'>])[source]¶
- export(plugin_name, folder=None, what=['dumper', 'uploader', 'mapping'], purge=False)[source]¶
Export generated code for a given plugin name, in given folder (or use DEFAULT_EXPORT_FOLDER if None). Exported information can be: - dumper: dumper class generated from the manifest - uploader: uploader class generated from the manifest - mapping: mapping generated from inspection or from the manifest If “purge” is true, any existing folder/code will be deleted first, otherwise, will raise an error if some folder/files already exist.
- load(autodiscover=True)[source]¶
Load plugins registered in internal Hub database and generate/register dumpers & uploaders accordingly. If autodiscover is True, also search DATA_PLUGIN_FOLDER for existing plugin directories not registered yet in the database, and register them automatically.
- class biothings.hub.dataplugin.assistant.AssistedDumper[source]¶
Bases:
object
- DATA_PLUGIN_FOLDER = None¶
- class biothings.hub.dataplugin.assistant.AssistedUploader[source]¶
Bases:
object
- DATA_PLUGIN_FOLDER = None¶
- class biothings.hub.dataplugin.assistant.BaseAssistant(url)[source]¶
Bases:
object
- data_plugin_manager = None¶
- dumper_manager = None¶
- handle()[source]¶
Access self.url and do whatever is necessary to bring code to life within the hub… (hint: that may involve creating a dumper on-the-fly and register that dumper to a manager…)
- keylookup = None¶
- property loader¶
Return loader object able to interpret plugin’s folder content
- loaders = {'advanced': <class 'biothings.hub.dataplugin.assistant.AdvancedPluginLoader'>, 'manifest': <class 'biothings.hub.dataplugin.assistant.ManifestBasedPluginLoader'>}¶
- property plugin_name¶
Return plugin name, parsed from self.url and set self._src_folder as path to folder containing dataplugin source code
- plugin_type = None¶
- uploader_manager = None¶
- class biothings.hub.dataplugin.assistant.BasePluginLoader(plugin_name)[source]¶
Bases:
object
- loader_type = None¶
- class biothings.hub.dataplugin.assistant.GithubAssistant(url)[source]¶
Bases:
BaseAssistant
- handle()[source]¶
Access self.url and do whatever is necessary to bring code to life within the hub… (hint: that may involve creating a dumper on-the-fly and register that dumper to a manager…)
- property plugin_name¶
Return plugin name, parsed from self.url and set self._src_folder as path to folder containing dataplugin source code
- plugin_type = 'github'¶
- class biothings.hub.dataplugin.assistant.LocalAssistant(url)[source]¶
Bases:
BaseAssistant
- handle()[source]¶
Access self.url and do whatever is necessary to bring code to life within the hub… (hint: that may involve creating a dumper on-the-fly and register that dumper to a manager…)
- property plugin_name¶
Return plugin name, parsed from self.url and set self._src_folder as path to folder containing dataplugin source code
- plugin_type = 'local'¶
- class biothings.hub.dataplugin.assistant.ManifestBasedPluginLoader(plugin_name)[source]¶
Bases:
BasePluginLoader
- dumper_registry = {'docker': <class 'biothings.hub.dataload.dumper.DockerContainerDumper'>, 'ftp': <class 'biothings.hub.dataload.dumper.LastModifiedFTPDumper'>, 'http': <class 'biothings.hub.dataload.dumper.LastModifiedHTTPDumper'>, 'https': <class 'biothings.hub.dataload.dumper.LastModifiedHTTPDumper'>}¶
- get_code_for_mod_name(mod_name)[source]¶
Returns string literal and name of function, given a path
- Parameters:
mod_name – string with module name and function name, separated by colon
- Returns:
- containing
indented string literal for the function specified
name of the function
- Return type:
Tuple[str, str]
- loader_type = 'manifest'¶
biothings.hub.dataplugin.manager¶
- class biothings.hub.dataplugin.manager.DataPluginManager(job_manager, datasource_path='dataload.sources', *args, **kwargs)[source]¶
Bases:
DumperManager
- class biothings.hub.dataplugin.manager.GitDataPlugin(src_name=None, src_root_folder=None, log_folder=None, archive=None)[source]¶
Bases:
GitDumper
- class biothings.hub.dataplugin.manager.ManualDataPlugin(*args, **kwargs)[source]¶
Bases:
ManualDumper