Skip to main content

Official Python parser for YINI, an INI-inspired, indentation-insensitive configuration format with clear nested sections and explicit structure.

Project description

yini-parser-python

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 (0.1.0a1).
This parser is intended for early testing and integration. The public API and edge-case behavior may still change before 1.0.0.


Installation

Install from PyPI:

pip install yini-parser

The package name on PyPI is:

yini-parser

The Python import name is:

import yini_parser

Quick Start

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"])  # 8080

Parse a YINI string:

from yini_parser import loads

data = loads("""
^ App
name = "Demo App"
version = 1.2
debug = false
""")

print(data["App"]["name"])  # Demo App

Use load(...) to parse a file and loads(...) to parse a string.

See the YINI specification and documentation.


Examples

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.


Development

For local development:

python -m pip install -e ".[dev]"

or, if using the project Taskfile:

task install-dev

Tests

The 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 -v

or, if using the project Taskfile:

task test

Run the full project check with:

task check

Links


^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.

yini-lang.org · YINI-lang on GitHub

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

yini_parser-0.1.0a2.tar.gz (38.5 kB view details)

Uploaded Source

Built Distribution

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

yini_parser-0.1.0a2-py3-none-any.whl (36.5 kB view details)

Uploaded Python 3

File details

Details for the file yini_parser-0.1.0a2.tar.gz.

File metadata

  • Download URL: yini_parser-0.1.0a2.tar.gz
  • Upload date:
  • Size: 38.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for yini_parser-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 ca948a5f8b1c78315b17c84d71c0e59bba84807d0acbc2265f97140ae6f85830
MD5 6531fd96d9845f199b47a13d7ff3d6fd
BLAKE2b-256 fd0543a97f9744abdef5c13f793a31579f9c453c4f205f1c624e723c7d53303b

See more details on using hashes here.

Provenance

The following attestation bundles were made for yini_parser-0.1.0a2.tar.gz:

Publisher: publish-to-pypi.yml on YINI-lang/yini-parser-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yini_parser-0.1.0a2-py3-none-any.whl.

File metadata

  • Download URL: yini_parser-0.1.0a2-py3-none-any.whl
  • Upload date:
  • Size: 36.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for yini_parser-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 5240d55505fefe871383e344e3c2db4c74a8f773f438c626a6e9b65a3560af87
MD5 3e8c1e46f3f04c9f8ce2f9e51b0e6935
BLAKE2b-256 fc99efa2392f43561989e0ee346985b1cc898f88d303f83bf888715920960e73

See more details on using hashes here.

Provenance

The following attestation bundles were made for yini_parser-0.1.0a2-py3-none-any.whl:

Publisher: publish-to-pypi.yml on YINI-lang/yini-parser-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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