eegdash.dataset.registry module#

eegdash.dataset.registry.register_openneuro_datasets(summary_file: str | Path, *, base_class=None, namespace: Dict[str, Any] | None = None, add_to_all: bool = True) Dict[str, type][source]

Dynamically create and register dataset classes from a summary file.

This function reads a CSV file containing summaries of OpenNeuro datasets and dynamically creates a Python class for each dataset. These classes inherit from a specified base class and are pre-configured with the dataset’s ID.

Parameters:
  • summary_file (str or pathlib.Path) – The path to the CSV file containing the dataset summaries.

  • base_class (type, optional) – The base class from which the new dataset classes will inherit. If not provided, eegdash.api.EEGDashDataset is used.

  • namespace (dict, optional) – The namespace (e.g., globals()) into which the newly created classes will be injected. Defaults to the local globals() of this module.

  • add_to_all (bool, default True) – If True, the names of the newly created classes are added to the __all__ list of the target namespace, making them importable with from … import *.

Returns:

A dictionary mapping the names of the registered classes to the class types themselves.

Return type:

dict[str, type]