configparser.ConfigParser.read_string()

read_string(string, source='') Parse configuration data from a string. Optional argument source specifies a context-specific name of the string passed. If not given, '<string>' is used. This should commonly be a filesystem path or a URL. New in version 3.2.

configparser.ConfigParser.read_file()

read_file(f, source=None) Read and parse configuration data from f which must be an iterable yielding Unicode strings (for example files opened in text mode). Optional argument source specifies the name of the file being read. If not given and f has a name attribute, that is used for source; the default is '<???>'. New in version 3.2: Replaces readfp().

configparser.ConfigParser.read_dict()

read_dict(dictionary, source='') Load configuration from any object that provides a dict-like items() method. Keys are section names, values are dictionaries with keys and values that should be present in the section. If the used dictionary type preserves order, sections and their keys will be added in order. Values are automatically converted to strings. Optional argument source specifies a context-specific name of the dictionary passed. If not given, <dict> is used. This method can b

configparser.ConfigParser.readfp()

readfp(fp, filename=None) Deprecated since version 3.2: Use read_file() instead. Changed in version 3.2: readfp() now iterates on f instead of calling f.readline(). For existing code calling readfp() with arguments which don’t support iteration, the following generator may be used as a wrapper around the file-like object: def readline_generator(f): line = f.readline() while line: yield line line = f.readline() Instead of parser.readfp(f) use parser.read_file(read

configparser.ConfigParser.read()

read(filenames, encoding=None) Attempt to read and parse a list of filenames, returning a list of filenames which were successfully parsed. If filenames is a string, it is treated as a single filename. If a file named in filenames cannot be opened, that file will be ignored. This is designed so that you can specify a list of potential configuration file locations (for example, the current directory, the user’s home directory, and some system-wide directory), and all existing configuration fi

configparser.ConfigParser.optionxform()

optionxform(option) Transforms the option name option as found in an input file or as passed in by client code to the form that should be used in the internal structures. The default implementation returns a lower-case version of option; subclasses may override this or client code can set an attribute of this name on instances to affect this behavior. You don’t need to subclass the parser to use this method, you can also set it on an instance, to a function that takes a string argument and r

configparser.ConfigParser.options()

options(section) Return a list of options available in the specified section.

configparser.ConfigParser.items()

items(raw=False, vars=None) items(section, raw=False, vars=None) When section is not given, return a list of section_name, section_proxy pairs, including DEFAULTSECT. Otherwise, return a list of name, value pairs for the options in the given section. Optional arguments have the same meaning as for the get() method. Changed in version 3.2: Items present in vars no longer appear in the result. The previous behaviour mixed actual parser options with variables provided for interpolation.

configparser.ConfigParser.has_section()

has_section(section) Indicates whether the named section is present in the configuration. The default section is not acknowledged.

configparser.ConfigParser.has_option()

has_option(section, option) If the given section exists, and contains the given option, return True; otherwise return False. If the specified section is None or an empty string, DEFAULT is assumed.