Skip to content

ConfigFile

Methods

fileio.ConfigFile.__init__(self, path, **kwargs) special

A class to access config files through an object with indexing, either for geting or seting values. Seamless and easy integration in code, ability to load or set multiple variables at once for more readability when using in static environments.

(e.g. functions or simple classes)

If not existing, the file will be created (but folder must exist) when key values are assigned.

Python standard variables are supported, as well as numpy arrays, internally represented as nested lists. Avoid using complex numpy structures as they could be erroneously loaded from file. (no specific dtypes support #TODO)

Parameters

path : str Path to the config file. **kwargs : TYPE DESCRIPTION.

Returns

A variable which is also a handle to the file. Can be used to load values with tho text indexes (two layer dictionary) or set values in the same way (immediately applies changes to the text file on setting variable value)

Back to top