commented-configparser
A custom ConfigParser class that preserves comments and most formatting when writing loaded config out.
Decision gist · record as of 2026-08-14
Yes, if you need to programmatically edit INI configuration files while preserving comments. The package is lightweight, has no dependencies, and solves a real gap in the standard library. Maintenance is aging but the repository is not abandoned; consider it stable for its narrow use case. No known security issues.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- Low friction: pure Python wheel with no runtime dependencies.
- Maintenance is aging—last release was 418 days ago, though the repository remains active and the package supports current Python versions (3.9+).
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
last release 2025-06-22 (418 days) · last repo commit 2025-10-11 · 10 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 501,381 downloads/mo, #6,315 on PyPI
Alternatives
Verify before relying
from commentedconfigparser import CommentedConfigParser
config = CommentedConfigParser()
config.read("myconfig.ini")
# modify config as needed
with open("myconfig.ini", "w") as f:
config.write(f)- Whether indentation outside multi-line values is truly lost or recoverable in edge cases.
- Performance characteristics when handling very large configuration files.
- Compatibility with ConfigParser subclasses or custom interpolation schemes.
What it is and what it does
commented-configparser is a drop-in replacement for Python's standard library ConfigParser that preserves comments and most formatting when you read and write configuration files. When you load an INI file, modify it, and save it back, your original comments stay in place—a feature the standard library discards. The package normalizes spacing around assignment operators and does not preserve indentation outside of multi-line values, but it retains both hash and semicolon comments, blank lines between sections, and trailing comments.
You use it exactly like the standard ConfigParser: instantiate it, call read() to load a file, modify the configuration as needed, and call write() to save it back. It has no external dependencies and runs on Python 3.9 and later, making it a lightweight addition to projects that need to edit configuration files while respecting user comments.
Use it for
- Edit application config files programmatically while preserving user comments and structure.
- Build configuration management tools that round-trip INI files without losing documentation.
- Maintain configuration templates where comments explain each setting to end users.
- Update config values in scripts while keeping inline and section-level comments intact.
- Generate or modify INI files from code and have them remain human-readable and annotated.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to programmatically edit INI configuration files while preserving comments.
The package is lightweight, has no dependencies, and solves a real gap in the standard library. Maintenance is aging but the repository is not abandoned; consider it stable for its narrow use case. No known security issues.
Install
commented-configparser on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Maintenance is aging—last release was 418 days ago, though the repository remains active and the package supports current Python versions (3.9+).
Requires Python 3.9 or later.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
from commentedconfigparser import CommentedConfigParser
config = CommentedConfigParser()
config.read("myconfig.ini")
# modify config as needed
with open("myconfig.ini", "w") as f:
config.write(f)
Verify before relying
- Whether indentation outside multi-line values is truly lost or recoverable in edge cases.
- Performance characteristics when handling very large configuration files.
- Compatibility with ConfigParser subclasses or custom interpolation schemes.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 418 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 501,381 / month, #6,315 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: Implementation :: CPython |
Evidence: commented_configparser-3.0.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “configparser preserve comments”
- commented-configparserExtends Python's standard ConfigParser to preserve comments and…
- imperfectParses and edits configparser-compatible INI files while preserving…
- ConfigUpdaterConfigUpdater reads and modifies INI configuration files while…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also config-formatter · configobj · ConfigUpdater · iniparse · iniconfig · ConfigArgParse · imperfect · ast-comments · comment-parser · jsoncomment