sections() Return all the configuration section names, sans DEFAULT.
has_section(section) Return whether the given section exists.
has_option(section, option) Return whether the given option exists in the given section.
options(section) Return list of configuration options for the named section.
read(filenames, encoding=None) Read and parse the iterable of named configuration files, given by name. A single filename is also allowed. Non-existing files are ignored. Return list of successfully read files.
read_file(f, filename=None) Read and parse one configuration file, given as a file object. The filename defaults to f.name; it is only used in error messages (if f has no `name' attribute, the string `<???>' is used).
read_string(string) Read configuration from a given string.
read_dict(dictionary) Read configuration from a dictionary. 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.
get(section, option, raw=False, vars=None, fallback=_UNSET) Return a string value for the named option. All % interpolations are expanded in the return values, based on the defaults passed into the constructor and the DEFAULT section. Additional substitutions may be provided using the `vars' argument, which must be a dictionary whose contents override any pre-existing defaults. If `option' is a key in `vars', the value from `vars' is used.
getint(section, options, raw=False, vars=None, fallback=_UNSET) Like get(), but convert value to an integer.
getfloat(section, options, raw=False, vars=None, fallback=_UNSET) Like get(), but convert value to a float.
getboolean(section, options, raw=False, vars=None, fallback=_UNSET) Like get(), but convert value to a boolean (currently case insensitively defined as 0, false, no, off for False, and 1, true, yes, on for True). Returns False or True.
items(section=_UNSET, raw=False, vars=None) If section is given, return a list of tuples with (name, value) for each option in the section. Otherwise, return a list of tuples with (section_name, section_proxy) for each section, including DEFAULTSECT.
remove_section(section) Remove the given file section and all its options.
remove_option(section, option) Remove the given option from the given section.
set(section, option, value) Set the given option.
write(fp, space_around_delimiters=True) Write the configuration state in .ini format. If `space_around_delimiters' is True (the default), delimiters between keys and values are surrounded by spaces.
|