iniparse
Accessing and Modifying INI files
What it is and what it does
iniparse is a Python INI file parser designed to read and write configuration files while preserving their original structure—comments, blank lines, indentation, and section order remain intact when the file is modified. This is especially valuable for config files that are edited both by users and by programs, where reformatting would be disorienting. The package provides backward-compatible implementations of ConfigParser, RawConfigParser, and SafeConfigParser from the Python standard library, so it can be used as a drop-in replacement. It also offers more convenient access patterns: configuration values can be read using dotted notation (e.g., `cfg.user.name`) or standard dictionary syntax (e.g., `cfg['user']['name']`).
The package depends only on six for Python 2/3 compatibility and installs with low friction. It has been stable since its 2007 release and is classified as Production/Stable. The repository is actively maintained but receives infrequent updates, reflecting its mature and settled state.
Use it for:
- Preserve user-edited INI files when a program needs to update configuration values programmatically
- Build configuration management tools where maintaining file formatting and comments is important for user experience
- Replace the standard ConfigParser in legacy Python projects that need structure preservation
- Create image gallery or similar applications where the order of entries in a config file carries semantic meaning
- Read and modify application settings files while keeping inline documentation and comments intact
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
iniparse is an INI file parser that preserves formatting (comments, indentation, blank lines, section order) while providing ConfigParser-compatible and dotted-notation access to configuration values.
Yes, if you need to read and write INI files while preserving formatting and comments. iniparse is stable, permissively licensed, has no known vulnerabilities, and installs easily. It is a solid choice for config file handling in projects where structure preservation matters. However, if you only need basic INI parsing without formatting concerns, Python's built-in configparser may suffice.
Install
iniparse on PyPI
pip
pip install iniparseuv
uv add iniparsepoetry
poetry add iniparseInstalling iniparse
Before you install
Low install friction with a single runtime dependency (six). Maintained as active, though the latest release was in 2020 and the repository has minimal activity (18 stars). Suitable for stable, long-term use in projects that do not require frequent updates.
License in practice
Licensed under MIT, a permissive open-source license. You may use, modify, and distribute iniparse freely in commercial and private projects with minimal restrictions.
Quickstart
pip install iniparse
from iniparse import INIConfig
cfg = INIConfig(open('config.ini'))
print(cfg.section.option) # dotted notation access
Verify before relying
- Whether iniparse works reliably with modern Python versions beyond 3.4, given classifiers only list up to 3.4
- Performance characteristics when handling large INI files or frequent read/write cycles
- Compatibility with edge cases in INI syntax (e.g., duplicate keys, special characters in values)
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — six |
| Maintenance | actively maintained — 2,389 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 403,554/month — #6,916 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: iniparse-0.5-py2-none-any.whl; iniparse-0.5-py3-none-any.whl
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
commented-configparserExtends Python's standard ConfigParser to…
permissive · top 15,000 on PyPI
crudinicrudini is a command-line utility for reading,…
copyleft · top 15,000 on PyPI
config-formatterAutomatically formats .ini and .cfg…
permissive · top 15,000 on PyPI
configobjConfigObj reads, writes, and validates…
permissive · top 5,000 on PyPI
ConfigUpdaterConfigUpdater reads and modifies INI…
permissive · top 5,000 on PyPI
imperfectParses and edits configparser-compatible INI…
permissive · top 15,000 on PyPI
configparserProvides an updated ConfigParser implementation…
permissive · top 5,000 on PyPI
pyconfiguratorParses command-line arguments and INI…
permissive · top 15,000 on PyPI
INIToolsINITools parses and manipulates INI-style…
permissive · top 15,000 on PyPI
ConfigArgParseExtends Python's argparse to parse command-line…
permissive · top 1,000 on PyPI