pydoc > configparser

```html

📖 NAME

configparser — Configuration file parser.

🚀 Quick Reference

Use Case Command Description
📄 Create a parser ConfigParser(defaults=None) Create a new configuration parser.
📂 Read a file parser.read('file.ini') Read and parse one or more .ini files.
🔍 Get a value parser.get('section', 'option') Return a string value for an option.
🔢 Get an integer parser.getint('section', 'option') Return an integer value.
🔢 Get a float parser.getfloat('section', 'option') Return a float value.
✅ Get a boolean parser.getboolean('section', 'option') Return a boolean (0/1, false/true, no/yes, off/on).
📋 List sections parser.sections() Return a list of section names, excluding DEFAULT.
📝 Write configuration parser.write(file_object) Write the configuration state in .ini format.
➕ Add a section parser.add_section('section') Create a new section.
✏️ Set an option parser.set('section', 'option', 'value') Set an option value.

📝 DESCRIPTION

A configuration file consists of sections, lead by a "[section]" header, and followed by "name: value" entries, with continuations and such in the style of RFC 822.

Intrinsic defaults can be specified by passing them into the ConfigParser constructor as a dictionary.

🔗 MODULE REFERENCE

https://docs.python.org/3.10/library/configparser.html

The following documentation is automatically generated from the Python source files. It may be incomplete, incorrect or include features that are considered implementation detail and may vary between Python implementations. When in doubt, consult the module reference at the location listed above.

🏛️ CLASSES

Hierarchy:

🔧 RawConfigParser

ConfigParser that does not do interpolation.

Constructor:

RawConfigParser(defaults=None, dict_type=<class 'dict'>, allow_no_value=False, *,
                delimiters=('=', ':'), comment_prefixes=('#', ';'), inline_comment_prefixes=None,
                strict=True, empty_lines_in_values=True, default_section='DEFAULT',
                interpolation=<unset>, converters=<unset>)

Methods:

Properties: converters (readonly).

Data attributes: BOOLEAN_STATES, NONSPACECRE, OPTCRE, OPTCRE_NV, SECTCRE.

🔧 ConfigParser

ConfigParser implementing interpolation.

Additional methods:

Data attributes: __abstractmethods__ = frozenset().

🔧 SafeConfigParser

Alias for ConfigParser for backwards compatibility. Identical interface.

🔧 SectionProxy

A proxy for a single section.

Methods:

Properties: name, parser.

🔧 Interpolation

Base class for interpolation. Dummy implementation passes value through unchanged.

Methods:

🔧 BasicInterpolation

Classic ConfigParser interpolation. Uses %(name)s format strings.

Methods:

🔧 ExtendedInterpolation

Advanced interpolation supporting ${section:option} syntax (zc.buildout style).

Methods:

🔧 LegacyInterpolation

Deprecated interpolation from older versions.

Methods:

🔧 ConverterMapping

Enables reuse of get*() methods between parser and section proxies.

Methods:

Data attributes: GETTERCRE.

❌ Error Classes

All exception classes inherit from Error (which derives from builtins.Exception).

📊 DATA

📁 FILE

/usr/lib/python3.10/configparser.py

```
configparser
📖 NAME 🚀 Quick Reference 📝 DESCRIPTION 🔗 MODULE REFERENCE 🏛️ CLASSES
🔧 RawConfigParser 🔧 ConfigParser 🔧 SafeConfigParser 🔧 SectionProxy 🔧 Interpolation 🔧 BasicInterpolation 🔧 ExtendedInterpolation 🔧 LegacyInterpolation 🔧 ConverterMapping ❌ Error Classes
📊 DATA 📁 FILE

Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-18 13:11 @216.73.216.114
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^