Skip to main content

QuickINI

A simple and fast INI file parser for Python with support for loading from URLs and automatic type conversion.

Installation

pip install quick_ini

Quick Start

from quick_ini import QuickIni

# Load from file, before any get_value() or get_all() (those raise RuntimeError otherwise)
QuickIni.load_file("config.ini")

# Load from URL
QuickIni.load_file("https://example.com/config.ini")

# Get values with automatic type conversion
debug = QuickIni.get_value("debug", False)  # Returns boolean
port = QuickIni.get_value("port", 8080)     # Returns integer

# Values inside a [section]
db_port = QuickIni.get_value("port", section="database")  # or get_value("database.port")

# Get everything, or everything in one section
settings = QuickIni.get_all()
database = QuickIni.get_all("database")

# Write values back to file
QuickIni.write_value("new_setting", "value", add_if_not_found=True)
QuickIni.write_value("port", 5433, section="database")

Keeping config.ini up to date with a template

Projects often ship a config.ini.template that you copy to config.ini. When the template gets new settings later, QuickINI can update config.ini for you:

QuickIni.load_file("config.ini", template=True)            # uses config.ini.template
QuickIni.load_file("config.ini", template="defaults.ini")  # uses defaults.ini
  • If config.ini doesn't exist, it is created from the template
  • The template decides which settings exist, their order, sections and comments. Your values are kept exactly as you wrote them
  • New settings from the template are added with their default values
  • Settings that are no longer in the template are kept at the end of their section, under a comment
  • The file is only rewritten when something changed, and the previous version is saved as config.ini.bak
  • With template=True a missing template is skipped, so deployed copies without one still load. A template given by name must exist
report = QuickIni.get_sync_report()
if report and report["added"]:
    print("New settings added to config.ini:", ", ".join(report["added"]))

The report also has created, changed, orphaned (settings kept that aren't in the template) and backup. Use QuickIni.sync_template("config.ini") to sync without loading.

File Format

# Comments start with #
debug = yes          # comments can also go after a value
port = 8080
timeout = 2.5e1
color = \#fff        # use \# to put a # in a value

# Lists
parts =
|one
|two

[database]
host = localhost
port = 5432

Features

  • Load INI files from local filesystem or URLs
  • Automatic type conversion: int, float (including -1.5 and 1e5), bool (true/false, yes/no, on/off) and str
  • Sections, plus # comments, including after a value (escape # as \# in values)
  • Lists using | lines
  • Keep config.ini up to date with a template file
  • Write values back to files safely, the file is never left half written
  • Error handling with detailed messages
  • Static class design for easy use across modules

Examples

Runnable examples are in the examples folder:

  • basic: loading a file, defaults, types and lists
  • sections: reading keys in [sections] and get_all()
  • writing: changing and adding values
  • template_sync: creating and updating config.ini from config.ini.template

Run one with python examples/basic/basic.py after installing QuickINI.

Metadata

Release files for quick-ini 4.1

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

Source distribution (sdist)

Source distribution for quick-ini 4.1
File Size Uploaded Provenance
quick_ini-4.1.tar.gz 18.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for quick-ini 4.1
File Interpreter ABI Platform
quick_ini-4.1-py3-none-any.whl Python 3 none any Details

Total release size: 29.2 kB

Release files / quick_ini-4.1.tar.gz

Download URL quick_ini-4.1.tar.gz
Size 18.3 kB
Tags Source
SHA-256 checksum
How to use checksums
12ff8095aeee5c335468087f1c6a7320a5d0c3407f415d22802ec2da6942e952
BLAKE2b-256 checksum
How to use checksums
8116da1f3cde1537ef330ab5c42f622bf239a1f80ec2aad4ff9fe1a95d3068ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 25, 2026.

Transparency log

Release files / quick_ini-4.1-py3-none-any.whl

Download URL quick_ini-4.1-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39f0c36b46adffd3b9c865201ebbd2d815610383ab1ed3f4433535d1db85f095
BLAKE2b-256 checksum
How to use checksums
41cf08100f05edb732f52233cbaaa6bdc0cb06aa03b462d10ee7bcbc4927b43a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 25, 2026.

Transparency log

Security for quick-ini 4.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for quick_ini-4.1.tar.gz

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 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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