funpack.custom
This module provides infrastructure for registering and accessing
funpack
plugins - custom functions for sniffing and loading data files,
and for cleaning and processing.
The following plugin types currently exist:
Plugin type |
|
---|---|
|
Return information about the columns in a file |
|
Load data from a file |
|
Run a cleaning function on a single column |
|
Run a processing function on one or more data columns |
|
Run a function on a |
|
Format a column for output |
|
Export the processed data set |
To ensure that the funpack
command line help and generated documentation
is nicely formatted, all plugin functions should have a docstring of the
form:
"""functionSignature(args)
Short description of function on a single line.
Extended description
"""
Clears and resets the contents of the |
|
Loads the given file, assumed to be a Python module containing funpack plugin functions. |
|
Decorator to register a plugin. |
|
Ensures that all built-in plugins are in the registry. |
|
List plugins of the specified type. |
|
Returns |
|
Return a reference to the specified plugin. |
|
Return a dict containing any arguments for the specified plugin. |
|
Run the specified plugin. |
- class funpack.custom.PluginRegistry[source]
Bases:
object
The
PluginRegistry
keeps track of, and provides access to all registered plugins.A singleton
PluginRegistry
is created at first import of this module, and module-level aliases for all of its methods are created - see below, after the class definition.- args(pluginType, pluginName)[source]
Return a dict containing any arguments for the specified plugin.
- loadPluginFile(filename)[source]
Loads the given file, assumed to be a Python module containing funpack plugin functions.
- funpack.custom.args(pluginType, pluginName)
Return a dict containing any arguments for the specified plugin.
- funpack.custom.cleaner(pluginName=None, **kwargs)
Decorator to register a plugin. If name is not provided, the name of the decorated function is used.
- funpack.custom.clearRegistry()
Clears and resets the contents of the
PluginRegistry
.
- funpack.custom.exists(pluginType, pluginName)
Returns
True
if the given plugin exists,False
otherwise.
- funpack.custom.exporter(pluginName=None, **kwargs)
Decorator to register a plugin. If name is not provided, the name of the decorated function is used.
- funpack.custom.formatter(pluginName=None, **kwargs)
Decorator to register a plugin. If name is not provided, the name of the decorated function is used.
- funpack.custom.get(pluginType, pluginName)
Return a reference to the specified plugin.
- funpack.custom.listPlugins(pluginType)
List plugins of the specified type.
- funpack.custom.loadPluginFile(filename)
Loads the given file, assumed to be a Python module containing funpack plugin functions.
- funpack.custom.loader(pluginName=None, **kwargs)
Decorator to register a plugin. If name is not provided, the name of the decorated function is used.
- funpack.custom.metaproc(pluginName=None, **kwargs)
Decorator to register a plugin. If name is not provided, the name of the decorated function is used.
- funpack.custom.processor(pluginName=None, **kwargs)
Decorator to register a plugin. If name is not provided, the name of the decorated function is used.
- funpack.custom.registerPlugin(pluginType, pluginName=None, **kwargs)
Decorator to register a plugin. If name is not provided, the name of the decorated function is used.
- funpack.custom.run(pluginType, pluginName, *args, **kwargs)
Run the specified plugin.
- funpack.custom.runCleaner(pluginName, *args, **kwargs)
Run the specified plugin.
- funpack.custom.runExporter(pluginName, *args, **kwargs)
Run the specified plugin.
- funpack.custom.runFormatter(pluginName, *args, **kwargs)
Run the specified plugin.
- funpack.custom.runLoader(pluginName, *args, **kwargs)
Run the specified plugin.
- funpack.custom.runMetaproc(pluginName, *args, **kwargs)
Run the specified plugin.
- funpack.custom.runProcessor(pluginName, *args, **kwargs)
Run the specified plugin.
- funpack.custom.runSniffer(pluginName, *args, **kwargs)
Run the specified plugin.
- funpack.custom.sniffer(pluginName=None, **kwargs)
Decorator to register a plugin. If name is not provided, the name of the decorated function is used.