Grouper.io module

Module for working with external libraries.

exception Grouper.io.DelayImportError

Bases: ImportError, SkipTest

Error to allow better import handling.

Grouper.io.import_(module)

Import a module and issue a nice message to stderr if it isn’t installed.

Parameters:

module (str) – The module you’d like to import, as a string

Returns:

module – The module object

Return type:

{module, object}

Examples

>>> # the following two lines are equivalent. the difference is that the
>>> # second will check for an ImportError and print you a very nice
>>> # user-facing message about what's wrong (where you can install the
>>> # module from, etc) if the import fails
>>> import tables
>>> tables = import_('tables')