Skip to main content

iniconfig: brain-dead simple parsing of ini files

iniconfig is a small and simple INI-file parser module having a unique set of features:

  • maintains order of sections and entries

  • supports multi-line values with or without line-continuations

  • supports “#” comments everywhere

  • raises errors with proper line-numbers

  • no bells and whistles like automatic substitutions

  • iniconfig raises an Error if two sections have the same name.

If you encounter issues or have feature wishes please report them to:

https://github.com/RonnyPfannschmidt/iniconfig/issues

Basic Example

If you have an ini file like this:

# content of example.ini
[section1] # comment
name1=value1  # comment
name1b=value1,value2  # comment

[section2]
name2=
    line1
    line2

then you can do:

>>> import iniconfig
>>> ini = iniconfig.IniConfig("example.ini")
>>> ini['section1']['name1'] # raises KeyError if not exists
'value1'
>>> ini.get('section1', 'name1b', [], lambda x: x.split(","))
['value1', 'value2']
>>> ini.get('section1', 'notexist', [], lambda x: x.split(","))
[]
>>> [x.name for x in list(ini)]
['section1', 'section2']
>>> list(list(ini)[0].items())
[('name1', 'value1'), ('name1b', 'value1,value2')]
>>> 'section1' in ini
True
>>> 'inexistendsection' in ini
False

Release files for iniconfig 2.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iniconfig 2.3.0
File Size Uploaded
iniconfig-2.3.0.tar.gz 20.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iniconfig 2.3.0
File Interpreter ABI Platform
iniconfig-2.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.0 kB

Release files / iniconfig-2.3.0.tar.gz

Download URL iniconfig-2.3.0.tar.gz
Size 20.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730
BLAKE2b-256 checksum
How to use checksums
723414ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2025.

Transparency log

Release files / iniconfig-2.3.0-py3-none-any.whl

Download URL iniconfig-2.3.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12
BLAKE2b-256 checksum
How to use checksums
cbb13846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

2.3.0 This release

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.1.1

2 release files

1.1.0

1 release file

1.0.1

2 release files

1.0.0

1 release file

0.1

1 release file

0.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page