mne.get_config#

mne.get_config(key=None, default=None, raise_error=False, home_dir=None, use_env=True)[source]#

Read MNE-Python preferences from environment or config file.

Parameters:
keyNone | str

The preference key to look for. The os environment is searched first, then the mne-python config file is parsed. If None, all the config parameters present in environment variables or the path are returned. If key is an empty string, a list of all valid keys (but not values) is returned.

defaultstr | None

Value to return if the key is not found.

raise_errorbool

If True, raise an error if the key is not found (instead of returning default).

home_dirstr | None

The folder that contains the .mne config folder. If None, it is found automatically.

use_envbool

If True, consider env vars, if available. If False, only use MNE-Python configuration file values.

New in version 0.18.

Returns:
valuedict | str | None

The preference key value.

See also

set_config

Examples using mne.get_config#

Configuring MNE-Python

Configuring MNE-Python

Configuring MNE-Python