An automatic formatter for .ini and .cfg configuration files
Reason this release was yanked:
Binaries did not include the module
Project description
config-formatter
An automatic formatter for .ini and .cfg configuration files.
Installation
pip install config-formatter
Usage
from config_formatter import ConfigFormatter
with open("config.ini", "r") as file:
formatter = ConfigFormatter()
formatted = formatter.prettify(file.read())
print(formatted)
Example
Before:
[main] # Comments are preserved.
# Error-prone indentation is removed.
[section1]
key1: value1
key2=value2 # Value assignment is normalized.
[section2]
lists =
are
indented
# including
comments
multiline = text that spans
on several lines
is properly aligned.
After:
[main] # Comments are preserved.
# Error-prone indentation is removed.
[section1]
key1 = value1
key2 = value2 # Value assignment is normalized.
[section2]
lists =
are
indented
# including
comments
multiline = text that spans
on several lines
is properly aligned.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
config-formatter-1.0.0.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for config_formatter-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c25295c85a014fbcc6ca6e3fdf6df9fc19a1d8a642085856bf16db4ef167fa0f |
|
MD5 | 4cc32845e22fd98990fb1585fb8bee50 |
|
BLAKE2b-256 | f22b4797e7e3833be50a3dc1e2a8eeff5a7f138e836bb954f4ff30aaef510ee1 |