configobj
Config file reading, writing and validation.
What it is and what it does
ConfigObj is a mature configuration file library that reads and writes INI-format files with a focus on ease of use and round-trip fidelity—it preserves comments and key order. It handles nested sections to arbitrary depth, list values, multiline values, and full Unicode. The library includes a validation subsystem with automatic type conversion, default values, and support for repeated sections. It also offers an unrepr mode for serializing and deserializing Python data types.
The package is designed for developers who need straightforward configuration management without complex dependencies. It's commonly used in system administration tools, application configuration, and any context where INI files are the preferred format. Recent versions dropped Python 2 support and patched a ReDoS vulnerability.
Use it for:
- Reading and writing application configuration files in INI format with automatic preservation of comments and structure
- Validating configuration values with automatic type conversion and default fallbacks during application startup
- Building admin tools or sysadmin utilities that need to parse and modify INI-based config files
- Storing nested configuration hierarchies in a human-readable format that users can edit directly
- Serializing Python data structures into config files and deserializing them back via unrepr mode
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
ConfigObj reads, writes, and validates INI-format configuration files with support for nested sections, list values, string interpolation, and automatic type checking.
Yes. ConfigObj is a stable, actively maintained library with zero known vulnerabilities, low install friction, and a permissive license. It solves a well-defined problem—INI file handling with validation—and is widely used. Install it if your application needs configuration file support; the lack of dependencies makes it a lightweight choice.
Install
configobj on PyPI
pip
pip install configobjuv
uv add configobjpoetry
poetry add configobjInstalling configobj
Before you install
Low install friction with no runtime dependencies. Actively maintained with recent security fix (CVE-2023-26112 in 5.0.9) and last commit 2026-08-01.
License in practice
BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install configobj
from configobj import ConfigObj
config = ConfigObj('settings.ini')
config['section']['key'] = 'value'
config.write()
Requires Python 3.7 or later (supports 3.7 through 3.12)
Verify before relying
- Whether the ReDoS fix in 5.0.9 affects existing validation patterns or performance
- Specific validation system capabilities beyond type checking and defaults mentioned
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 692 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 7,158,377/month — #1,778 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: configobj-5.0.9-py2.py3-none-any.whl
Keywords: config, ini, dictionary, application, admin, sysadmin, configuration, validation
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
commented-configparserExtends Python's standard ConfigParser to…
permissive · top 15,000 on PyPI
iniparseiniparse is an INI file parser that preserves…
permissive · top 15,000 on PyPI
ConfigUpdaterConfigUpdater reads and modifies INI…
permissive · top 5,000 on PyPI
configparser2Backport of Python 3's configparser module to…
permissive · top 15,000 on PyPI
click-config-fileAdds configuration file support to Click…
permissive · top 15,000 on PyPI
click-configfileExtends click with configuration file support,…
permissive · top 15,000 on PyPI
pyconfiguratorParses command-line arguments and INI…
permissive · top 15,000 on PyPI
iniconfiginiconfig parses INI configuration files while…
permissive · top 100 on PyPI
imperfectParses and edits configparser-compatible INI…
permissive · top 15,000 on PyPI
kvfReads and writes configuration files in KvF…
permissive · top 15,000 on PyPI