cwepr.io.factory module

Factory classes.

Currently, there is only one factory class:

  • cwepr.io.factory.DatasetImporterFactory

    Factory for creating importer objects based on the source provided.

    This class is necessary in context of recipe-driven data analysis and allows to automatically import data in all supported formats without need to explicitly provide either the file format or an importer.

class cwepr.io.factory.DatasetImporterFactory

Bases: aspecd.io.DatasetImporterFactory

Factory for creating importer objects based on the source provided.

Currently, the data formats are distinguished by their file extensions.

If the source string does not match any of the importers handled by this module, the standard importers from the ASpecD framework are checked. See the documentation of the aspecd.io.DatasetImporterFactory base class for details.

supported_formats

Dictionary whose keys correspond to the base name of the respective importer (i.e., without the suffix “Importer”) and whose values are a list of file extensions to detect the correct importer.

Type

dict

data_format

Name of the format that has been given or detected.

Type

str

.. versionchanged:: 0.4

File extension is taken into account, so that two files with the same name and different extension can reside next to each other and the correct one is taken into account.