$npx skillfedfor your agent

imperfect

A CST-based config editor for configparser

With conditionsPyPI Build ToolsReleased Apr 2025745.7K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — imperfect-0.4.0-py3-none-any.whl
v0.4.0 · released 2025-04-24 · Python >=3.8 · 1 runtime deps: moreorless

Yes, if you need to edit INI-format config files programmatically and preserving formatting matters. The package is stable, low-friction to install, and solves a real problem that standard configparser cannot. The aging maintenance status (477 days since last release) is not a blocker for a mature tool, but verify it handles your specific INI dialect before relying on it in production.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.8 or later
  • Low friction: pure Python wheel with a single runtime dependency (moreorless).
  • Maintenance status is aging—last release was 477 days ago, though the repository remains active and stable since its initial 2019 release.

License · maintenance · safety

MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions, making it suitable for both open-source and commercial projects.

last release 2025-04-24 (477 days) · last repo commit 2025-04-24 · 3 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 745,667 downloads/mo, #5,171 on PyPI

Verify before relying

import imperfect
with open("setup.cfg") as f:
    data = f.read()
conf = imperfect.parse_string(data)
conf.set_value("metadata", "long_description_content_type", "text/markdown")
with open("setup.cfg", "w") as f:
    f.write(conf.text)
  • Whether the CST implementation handles all edge cases in real-world setup.cfg or other INI files beyond the hypothesis-tested scenarios
  • Performance characteristics when editing large or deeply nested configuration files
Same gist for agents: .md · .json

What it is and what it does

imperfect is a CST-based configuration file editor designed to work with files that follow the configparser format (INI-style). Unlike standard configparser, which reads and discards formatting, imperfect parses the file into a tree of nodes that preserves every detail—whitespace, comments, line breaks—so you can make surgical edits and write the file back without losing its original structure and readability.

You parse a file with `parse_string()`, then manipulate sections and entries directly. For simple cases, you can use `set_value()` to add or change a key-value pair. For precise control over placement and formatting, you construct `ConfigEntry` and `ValueLine` objects with explicit whitespace control, then insert them into the tree. The package follows configparser's quirks for compatibility, including lenient section name parsing and specific whitespace handling conventions. It requires Python 3.8 or later and depends only on moreorless for diff utilities.

Use it for

  • Programmatically update setup.cfg while preserving developer comments and formatting
  • Build configuration management tools that need to edit INI files without destroying readability
  • Automated code generation or build-system integration that modifies config files in place
  • Testing frameworks that need to verify or modify configuration files while keeping diffs human-readable

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need to edit INI-format config files programmatically and preserving formatting matters.

The package is stable, low-friction to install, and solves a real problem that standard configparser cannot. The aging maintenance status (477 days since last release) is not a blocker for a mature tool, but verify it handles your specific INI dialect before relying on it in production.

Install

imperfect on PyPI

Before you install

Low friction: pure Python wheel with a single runtime dependency (moreorless). Maintenance status is aging—last release was 477 days ago, though the repository remains active and stable since its initial 2019 release.

Requires Python 3.8 or later

License in practice

MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions, making it suitable for both open-source and commercial projects.

Quickstart

import imperfect
with open("setup.cfg") as f:
    data = f.read()
conf = imperfect.parse_string(data)
conf.set_value("metadata", "long_description_content_type", "text/markdown")
with open("setup.cfg", "w") as f:
    f.write(conf.text)

Verify before relying

  • Whether the CST implementation handles all edge cases in real-world setup.cfg or other INI files beyond the hypothesis-tested scenarios
  • Performance characteristics when editing large or deeply nested configuration files

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.8
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
moreorless
MaintenanceAging 477 days since the last release
Last repo commit
First released
Downloads745,667 / month, #5,171 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14

Evidence: imperfect-0.4.0-py3-none-any.whl

Tags

Capabilities
ini file editor preserving commentsconfigparser CST parseredit config files preserve formattingsetup.cfg programmatic editingwhitespace-preserving ini parser
Topics
config-managementcst-parser

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 › “ini file editor preserving comments”

  • imperfectParses and edits configparser-compatible INI files while preserving…
  • ConfigUpdaterConfigUpdater reads and modifies INI configuration files while…
  • commented-configparserExtends Python's standard ConfigParser to preserve comments and…

Give your agent the search over MCP, or paste the wish link into any chat.

More Build Tools packages

packaging Worth it
PyPI · Build Tools · released Aug 2026

Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.

Apache-2.0 OR BSD-2-Clausepure Python · 3.9+
2.2Bdownloads / mo
tqdm Worth it
PyPI · Libraries · released Jul 2026

Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.

copyleftpure Python · 3.8+
648.6Mdownloads / mo
pip Worth it
PyPI · Build Tools · released Aug 2026

pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.

MITpure Python · 3.10+
617.5Mdownloads / mo
hatchling Worth it
PyPI · Python Modules · released Aug 2026

Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.

MITpure Python · 3.10+
484.2Mdownloads / mo
grpcio-tools Worth it
PyPI · Build Tools · released Jul 2026

Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.

Apache-2.0compiled wheel · 3.10+
278.2Mdownloads / mo
pre-commit Worth it
PyPI · Build Tools · released Aug 2026

pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.

Install it if your team needs consistent, automated validation at commit time.

permissive licensepure Python · 3.10+
179.9Mdownloads / mo

See also codemod-yaml · config-formatter · iniparse · ConfigUpdater · crudini · iniconfig · commented-configparser · untokenize · confection · libcst