config-formatter
An automatic formatter for .ini and .cfg configuration files
What it is and what it does
config-formatter is a Python library that reads .ini and .cfg configuration files and reformats them with standardized indentation, spacing, and key-value syntax. It preserves inline and block comments while normalizing inconsistent formatting—removing errant indentation, aligning multiline values, and unifying assignment operators (= vs :). The package wraps configupdater as its core dependency and exposes a simple ConfigFormatter class with a prettify() method.
It's designed for developers who need to programmatically clean up configuration files as part of build pipelines, linting workflows, or configuration management tools. The library supports Python 3.6 through 3.10 and runs on CPython and PyPy. With no known security vulnerabilities and a stable API, it's suitable for production use in scenarios where configuration file consistency matters.
Use it for:
- Normalize configuration files in a CI/CD pipeline before deployment to ensure consistent formatting across environments.
- Lint and auto-fix .ini files in a configuration management tool or IDE plugin.
- Reformat legacy or manually-edited config files to a standard before version control commit.
- Programmatically clean up multiline configuration values with inconsistent indentation in application setup scripts.
- Integrate into a build tool to enforce configuration file style as part of code quality checks.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Automatically formats .ini and .cfg configuration files with consistent indentation, spacing, and value assignment syntax while preserving comments.
Yes, if you need to programmatically format .ini or .cfg files. Low install friction, no security issues, and a stable MIT license make it a safe choice. The aging maintenance status (last release 2023-11-18) is a minor concern for long-term support, but the package is marked Production/Stable and the underlying dependency (configupdater) is widely used, so breakage risk is low for typical use.
Install
config-formatter on PyPI
pip
pip install config-formatteruv
uv add config-formatterpoetry
poetry add config-formatterInstalling config-formatter
Before you install
Low friction—pure Python wheel with a single runtime dependency (configupdater). Last release was 2023-11-18, and the repository remains active but shows aging maintenance signals (1000 days since last release as of the fact sheet date).
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
from config_formatter import ConfigFormatter
with open("config.ini", "r") as file:
formatter = ConfigFormatter()
formatted = formatter.prettify(file.read())
print(formatted)
Verify before relying
- Whether the package handles edge cases in multiline values or complex comment placement reliably
- Performance characteristics on very large configuration files
- Whether configupdater's own maintenance status affects long-term compatibility
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — configupdater |
| Maintenance | aging — 1,000 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 285,996/month — #8,050 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: config_formatter-1.2.0-py3-none-any.whl
Keywords: config, formatter, ini, cfg, configuration, configparser
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
beautyshBeautysh automatically formats and beautifies…
permissive · top 15,000 on PyPI
commented-configparserExtends Python's standard ConfigParser to…
permissive · top 15,000 on PyPI
confectionConfection is a configuration system for Python…
permissive · top 5,000 on PyPI
imperfectParses and edits configparser-compatible INI…
permissive · top 15,000 on PyPI
iniconfiginiconfig parses INI configuration files while…
permissive · top 100 on PyPI
mbakembake formats and lints Makefiles, enforcing…
permissive · top 15,000 on PyPI
yamlfixyamlfix is a command-line YAML formatter that…
copyleft · top 5,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
pyinkPyink is a Python code formatter forked from…
permissive · top 15,000 on PyPI