The official Python parser for YINI (by the YINI-lang project) — a human-readable, INI-inspired, indentation-insensitive configuration format with clear nested sections, explicit structure, comments, and predictable parsing.
Status: Alpha.
This parser is intended for early testing and integration. The public API and edge-case behavior may still change before1.0.0.
Install from PyPI:
pip install yini-parserThe package name on PyPI is:
yini-parser
The Python import name is:
import yini_parser
Example YINI file:
// A small, practical YINI config.
// The App section starts here.
^ App
name = "Demo App"
version = 1.2
features = ["search", "logs"]
debug = false // on/off, yes/no would work too.
pageSize = 25
// Another section, nested under App.
^^ Server
host = "localhost"
port = 8080 # Can comment with # too.
useTLS = off
Parse a YINI file:
from yini_parser import load
data = load("sample/basic.yini")
print(data["App"]["name"]) # Demo App
print(data["App"]["Server"]["port"]) # 8080Parse a YINI string:
from yini_parser import loads
data = loads("""
^ App
name = "Demo App"
version = 1.2
debug = false
""")
print(data["App"]["name"]) # Demo AppUse load(...) to parse a file and loads(...) to parse a string.
See the YINI specification and documentation.
Runnable example projects are available in the YINI demo apps repository.
The Python examples show how to install yini-parser, load .yini files, and access parsed configuration data in small practical scripts.
For local development:
python -m pip install -e ".[dev]"or, if using the project Taskfile:
task install-devThe tests/ directory contains a focused implementation-local test suite, including:
- Tests for the public API.
- Key semantic tests.
- Smoke/golden tests.
- Parser behavior tests for comments, values, sections, strict mode, conflicts, inline objects, and string concatenation.
Run the test suite with:
python -m pytest -vor, if using the project Taskfile:
task testRun the full project check with:
task check^YINI ≡
YINI is a human-readable, INI-inspired, indentation-insensitive configuration format with clear nested sections, explicit structure, and predictable parsing.
It has a formal specification and a defined grammar.