Data Manager

Data manager is a module that handles all the information necessary to bootstrap the bot into a state where more abstract data management systems can take over.

redbot.core.data_manager.bundled_data_path(cog_instance)[source]

Get the path to the “data” directory bundled with this cog.

The bundled data folder must be located alongside the .py file which contains the cog class.

Important

You should NEVER write to this directory.

Parameters:

cog_instance – An instance of your cog. If calling from a command or method of your cog, this should be self.

Returns:

Path object to the bundled data folder.

Return type:

pathlib.Path

Raises:

FileNotFoundError – If no bundled data folder exists.

redbot.core.data_manager.cog_data_path(cog_instance=None, raw_name=None)[source]

Gets the base cog data path. If you want to get the folder with which to store your own cog’s data please pass in an instance of your cog class.

Either cog_instance or raw_name will be used, not both.

Parameters:
  • cog_instance – The instance of the cog you wish to get a data path for. If calling from a command or method of your cog, this should be self.

  • raw_name (str) – The name of the cog to get a data path for.

Returns:

If cog_instance is provided it will return a path to a folder dedicated to a given cog. Otherwise it will return a path to the folder that contains data for all cogs.

Return type:

pathlib.Path

redbot.core.data_manager.data_path()[source]

Gets the base data path.

Returns:

Storage type.

Return type:

str

redbot.core.data_manager.instance_name()[source]

Gets instance’s name.

Returns:

Instance name.

Return type:

str

redbot.core.data_manager.metadata_file()[source]

Gets the path of metadata file.

Returns:

Storage type.

Return type:

str

redbot.core.data_manager.storage_details()[source]

Gets any details necessary for config drivers to load.

These are set on setup.

Returns:

Storage details.

Return type:

Dict[str, str]

redbot.core.data_manager.storage_type()[source]

Gets the storage type as a string.

Returns:

Storage type.

Return type:

str