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.unnamed_section.set("app_name", "My App")
config.unnamed_section.set("version", "1.0.0")

# 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.unnamed_section["app_name"].value  # "My App"

Example config file output:

# Configuration for My App
# Created on 2025-09-28
app_name = "My App"
version = "1.0.0"

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.13.tar.gz (11.6 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.13-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simplini-0.0.13.tar.gz
  • Upload date:
  • Size: 11.6 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.13.tar.gz
Algorithm Hash digest
SHA256 5d937dc9e4f854971f725c8a52e4b995ff3e5dd56d9964cf0d8a795dabebcf7b
MD5 81fdfa7a96733021643342712044aac1
BLAKE2b-256 de375290c98f679aa6d28e7ff339f598c31b00a2d43fb615dc3825ee6772bb31

See more details on using hashes here.

File details

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

File metadata

  • Download URL: simplini-0.0.13-py3-none-any.whl
  • Upload date:
  • Size: 11.1 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.13-py3-none-any.whl
Algorithm Hash digest
SHA256 19f0e70ba785b8037bfa495b67270d6cf7fb7e2a26f725063e7211849e7745e6
MD5 743df85a55cc3fa20b978e29e9d05696
BLAKE2b-256 8b2ed769e3d534b429d8e0cbf465f1ca2089d80e77d615c995d06ad3879d4341

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