skillfed

config-formatter

An automatic formatter for .ini and .cfg configuration files

config-formatter v1.2.0 286.0K downloads/30d#8,050 on PyPI15
Permissive license MIT AGING released

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-formatter

uv

uv add config-formatter

poetry

poetry add config-formatter

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Quality Assurance

Tags

ini file formattercfg configuration formatterconfig file beautifiernormalize ini syntaxconfigparser formatterconfiguration file linterindent config files
config-managementcode-formatting

More Python Modules packages