Skip to main content

A simple INI file parser/writer

Project description

Simplini Logo

CI License: MIT

A simple INI file parser and writer for Python that works.

Installation

pip install simplini

Why?

The reasons this library was created:

Comparison

Library Round-trip editing Maintenance Correctness Configurability Multi-line values Error reporting
configparser 🟢 🙂
ConfigObj 🔴 🐛 🤔
python-ini 🙁
ini-parser 🐛 🙁
simplini 🟢 🥰

Features

  • Simple API
  • Round-trip editing preserving comments
  • Non-ambiguous strings encoding
  • Configurable parsing and rendering behavior
  • No surprises like sudden interpolation or lower-casing option names

Usage

Basic usage example:

from simplini import IniConfig

# Create a new INI config
config = IniConfig()

# Add values to the default section
config.set("app_name", "My App")
config.set("version", "1.0.0")

# set values for some named section
config.set("db", "sql", section_name="core")

# Add a comment to the default section
config.unnamed_section.comment = [
    "Configuration for My App",
    "Created on 2025-09-28",
]

# Save to file
config.save("config.ini")

# Load from file
loaded_config = IniConfig.load("config.ini")
app_name = loaded_config.get("app_name")  # My App
core_db = loaded_config.get("db", section_name="core")  # sql

Example config file output:

# Configuration for My App
# Created on 2025-09-28

app_name = "My App"

version = "1.0.0"

[core]

db = "sql"

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simplini-0.0.20.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simplini-0.0.20-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file simplini-0.0.20.tar.gz.

File metadata

  • Download URL: simplini-0.0.20.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for simplini-0.0.20.tar.gz
Algorithm Hash digest
SHA256 2799e1f4541191f70871f34c54650163af5ecff3daf40521f89dd0414e37727c
MD5 faff92f6d632bd4f15f814db82895778
BLAKE2b-256 01a3df8f5cfccc7f90c651c5d227adc496a85edbaabfd60dc78d3e138efda48a

See more details on using hashes here.

File details

Details for the file simplini-0.0.20-py3-none-any.whl.

File metadata

  • Download URL: simplini-0.0.20-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for simplini-0.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 d2298b1286cee2c193a2855beaa182e292ad614c458e4eda5118fef8d6eb15ae
MD5 cd7efd9c94fc9fb25c1a03cd9fd8e8d7
BLAKE2b-256 d339f35d7c205fb951b83e6aebebf08b71b1c4cfe8676e1a1b2ba1bf4ec59f6d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page