DEV Community

Cover image for ๐ŸŽ‰YINI format: RC 7 Is Here! A New Specification, Updated Parsers, and CLI
Mr Smithnen
Mr Smithnen

Posted on Edited on

๐ŸŽ‰YINI format: RC 7 Is Here! A New Specification, Updated Parsers, and CLI

YINI format: RC 7 Is Here!

Good news for anyone following the YINI project!

I'm happy to announce that YINI 1.0.0 Release Candidate 7 (RC 7) is now released, along with new versions of the official TypeScript and Python parsers and the YINI command-line tool.

This is another step towards YINI 1.0.0, and a milestone in making the format and its surrounding tools work consistently together.

If you're new to YINI, here's a quick introduction.

What is YINI?

YINI (Yet another INI) is an open-source configuration file format designed to be easy for humans to read and write, while keeping its structure clear and predictable for software.

It takes inspiration from INI, JSON, C-like languages, Python, and other familiar formats, but follows its own approach: simple key-value pairs, explicit nested sections, and no dependence on indentation.

Here's a small example:

@yini

^ Application
name = "My Awesome App"
version = "1.0.0"
debug = true

    ^^ Server
    host = "localhost"
    port = 8080

    ^^ Database
    host = "localhost"
    port = 5432
    enabled = true

    ^^ Features
    enabled = ["search", "logging", "notifications"]

/END
Enter fullscreen mode Exit fullscreen mode

The ^ markers define the section hierarchy. One ^ starts a top-level section, two ^^ start a nested section, and so on.

Indentation is entirely optional and is only there to make the file easier to read.

The idea behind YINI is simple: configuration files should remain easy to understand, even as they grow.

What's new with RC 7?

The YINI specification has reached its seventh release candidate.

RC 7 continues the work of refining the format, making its rules clearer, and preparing it for a future stable 1.0.0 release.

But this release is not just about the specification itself. An important part of this milestone is bringing the main tools in the YINI ecosystem into line with the new specification.

So, if you want to start experimenting with RC 7 in an actual project, you don't have to wait for the parsers or CLI to catch up.

๐Ÿ“ฆ Updated TypeScript and JavaScript parser

The official YINI parser for TypeScript and JavaScript has been updated to support RC 7.

This means you can use the latest YINI format directly in your Node.js applications, scripts, and developer tools.

Install or update it with npm:

npm install yini-parser@latest
Enter fullscreen mode Exit fullscreen mode

And use it in your project:

import YINI from 'yini-parser';

const config = YINI.parseFile('config.yini');

console.log(config.Application.Server.port);
// 8080
Enter fullscreen mode Exit fullscreen mode

The TypeScript parser is the primary implementation of YINI and continues to play an important role in the development of the format and its tooling.

๐Ÿ Updated Python parser

The official YINI parser for Python has also been updated to align with RC 7.

This makes it easier to use the same YINI configuration files across different programming languages.

Install or update it from PyPI:

pip install --upgrade yini-parser
Enter fullscreen mode Exit fullscreen mode

Then load your configuration:

from yini_parser import load

config = load("config.yini")

print(config["Application"]["Server"]["port"])
# 8080
Enter fullscreen mode Exit fullscreen mode

Whether you're writing a small Python script, building an application, or working on automation tools, you can now work with the latest YINI specification.

๐Ÿ› ๏ธ Updated YINI CLI

The official YINI CLI has also been updated for RC 7.

The CLI is a handy tool for working with YINI files without having to write any application code.

You can use it to:

  • Validate configuration files.
  • Parse and inspect YINI files.
  • Convert YINI into JSON, YAML, JavaScript, or XML.
  • Read individual configuration values directly from the terminal.

For example, if you have Node.js installed, you can try these commands:

# Validate a YINI file
npx yini-cli validate config.yini

# Parse a YINI file
npx yini-cli parse config.yini

# Read a specific configuration value
npx yini-cli get config.yini Application.Server.port
Enter fullscreen mode Exit fullscreen mode

It's particularly useful for local development, shell scripts, and CI/CD pipelines.

What's next for the YINI ecosystem?

Not every single tool in the ecosystem has caught up with RC 7 yet, so allow some time for the rest of the tools to align with RC 7.

Some of the next steps include:

  • Bringing the official YINI syntax highlighting up to date with RC 7, including the Visual Studio Code extension.
  • Updating the official Go parser, which is currently in alpha.
  • Continuing to improve the shared test suite and compatibility between implementations.
  • Improving documentation, examples, and the overall developer experience.

The long-term goal is for YINI to behave consistently across different languages and tools, so developers can choose their preferred environment without having to worry about different interpretations of the same configuration file.

And there's still more work to do before YINI 1.0.0.

Try it yourself!

If you're curious about YINI, you don't need to install anything to get started.

You can explore the YINI Playground directly in your browser, or take a look at the Getting Started guide.

The project is also available on GitHub, where you'll find the specification, parsers, tools, and more.

I'd love to hear your thoughts

YINI is still a growing open-source project, and feedback from developers is valuable in shaping its future.

If you work with configuration files regularly, I'm curious:

  • What do you like or dislike about the configuration formats you use today?
  • What would make you consider trying a different configuration format?
  • Is there something you'd like to see in YINI before it reaches 1.0.0?

And if you're interested in trying YINI, reporting a bug, suggesting an improvement, or contributing to one of its tools, you're very welcome!

Thanks for reading and for following the journey. ๐Ÿ™‚

One step closer to YINI 1.0.0!


๐ŸŒ YINI Homepage: The YINI website to explore the format, try it in the browser, brows YINI tools.

Top comments (0)