lqf 0.1.0

A lightweight, easy-to-read config format with clean section syntax and simple parsing.
Documentation
  • Coverage
  • 3.85%
    1 out of 26 items documented0 out of 3 items with examples
  • Size
  • Source code size: 12.69 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.56 MB This is the summed size of all files generated by rustdoc for all configured targets
  • ร˜ build duration
  • this release: 22s Average build duration of successful builds.
  • all releases: 29s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • smit4k

lqf ๐Ÿชถ

lqf is a lightweight configuration format featuring a clean, sectioned syntax centered around the use of the > symbol โ€” designed to be easy to read, easy to write, and dead simple to parse.

This Rust crate provides a parser for .lqf files using pest.rs, ready for use in config-heavy projects or DSL exploration.

โœจ Features

  • Simple syntax for sectioned key-value configuration
  • Supports:
    • Strings, numbers, booleans
    • Arrays
    • null values
  • Built with pest โ€” robust and expressive PEG-based parser

๐Ÿงช Example

Given this .lqf file:

> database
host >> "localhost"
port >> 5432

> features
enabled >> ["search", "logging", "metrics"]

You can parse it like this in Rust:

use lqf::parse_lqf;
fn main() {
    let input = r#"
        > database
        host >> "localhost"
        port >> 5432

        > features
        enabled >> ["search", "logging", "metrics"]
    "#;

    let parsed = parse_lqf(input).expect("failed to parse LQF");
    println!("{:#?}", parsed);
}

Output:

{
    "database": {
        "host": String("localhost"),
        "port": Number(5432.0),
    },
    "features": {
        "enabled": Array([
            String("search"),
            String("logging"),
            String("metrics"),
        ])
    }
}

๐Ÿ“ฆ Installation

Add this to your Cargo.toml

[dependencies]
lqf = "0.1.0"

๐Ÿ“ Syntax Overview

  • > introduces a new section
  • >> assigns values to keys
  • Supported value types:
    • Strings: "text"
    • Numbers: 123, 3.14
    • Booleans true, false
    • Arrays: [1, 2, 3], ["a", "b"]
    • Null: null

๐Ÿค Contributing

Contributions are welcome! Feel free to open issues, submit pull requests, or discuss ideas.