tini is a lightweight and straightforward Python library designed for reading and parsing simple .ini and configuration files. It provides a dictionary-like interface for accessing sections and keys, with automatic type conversion for common data types. The current version is 4.0.0, and it follows an infrequent release cadence, with major versions tied to significant API changes or Python version support.
pip install tiniVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to load an INI file using `tini.Ini`, access sections and keys, and observe automatic type conversions for common types like integers, booleans, and comma-separated lists. It also shows how to use `.get()` with a default value.
Replace `config.read()` with `config.load()` and `config.save()` with `config.dump()`.
Ensure your project is running on Python 3.7 or newer. Upgrade your Python environment if necessary.
If a raw string is required for a value that might be auto-converted, cast it: `str(config['section']['key'])`.
Use the `.get()` method with a default value: `config['section'].get('key', 'default_value')` or `config.get('missing_section', {})`.No dependency data recorded yet.