Skip to main content

A cute, declarative config language with fail-fast behavior and optional type safety.

Project description

・゚ Yumly ・゚

⚠️ Warning — subject to changes.

Yumly is a cute, declarative configuration language with fail-fast behavior and optional type safety, blending elements of YAML and JSON — without relying on indentation.

The parser is written in Nim and exports bindings for Python via NimPy. There's also a native Nim API for direct usage.


✿ What's in Yumly?

  • No indentation — blocks delimited by { } allowing flexible organization
  • Optional type hints — you can declare intent UwU
  • Native env vars$["VAR"] and include { ".env" } are first class ;)
  • Readable — it's easy to read and understand ^_^
  • Extensions .yumly and .yuy (it's so cute!!)

✿ Syntax

Comments
;> this is a comment <;

;>
multiline
comment
<;
Key-value pairs
;> type hints are optional <;
name ;string = "Yumly"
version ;string = "1.0.0"
debug ;bool = true
port ;int = 8080
ratio ;float = 3.14

;> without type hint, type is inferred from value <;
active = true
count = 42
Blocks
(app) {
    name ;string = "Yumly",
    version ;string = "1.0.0",
    debug ;bool = false
}

Blocks can be nested:

(database) {
    (postgres) {
        host = "localhost",
        port ;int = 5432
    },
    (redis) {
        host = "127.0.0.1",
        port = 6379
    }
}
Environment variables
token ;env = $["DISCORD_TOKEN"]
home  ;env = $["HOME"]
Include
include { ".env" }           ;> loads environment variables <;
include { "base.yumly" }     ;> imports blocks from another file <;
include { "shared.yuy" }     ;> also accepts .yuy or .yumly <;
Strings and Escapes
newline = "Line 1\nLine 2"
tab = "Column 1\tColumn 2"
backslash = "C:\\Path\\Windows"
quotes = "He said: \"Hello!\""
Lists and Tuples

Lists — homogeneous, all items of the same type:

tags    ;list[string] = ["api", "v2", "stable"]
ports   ;list[int]    = [8080, 8081, 8082]

;> without type hint, inferred from first element <;
hosts = ["localhost", "0.0.0.0"]

Valid types: string, int, float, bool, env.

Tuples — heterogeneous, different types:

server_info ;tuple = ["localhost", 8080, true]

;> automatically inferred if types are mixed <;
meta = ["staging", 42, false]
Comma rules

Inside blocks, commas separate pairs and sub-blocks. The last item doesn't need a comma:

(block) {
    a = "x",
    b = "y",
    c = "z"    ;> last, no comma <;
}

At root, pairs on the same line need a comma:

name = "John", age = 30
job = "dev"

Complete example

include { ".env" }

(global) {
    project ;string = "Cid",
    version ;string = "6.0.0",
    production ;bool = true,
    tags ;list[string] = ["cloud", "scalable"]
}

(database) {
    host = "localhost",
    port ;int = 6767,
    password ;env = $["DB_PASSWORD"]
}

(services) {
    (api) {
        port = 8080,
        tls ;bool = true,
        endpoints ;list[string] = ["/auth", "/v1/data"]
    }
}

✿ Available types

Type hint Example
;string name ;string = "Yumly"
;int port ;int = 8080
;float ratio ;float = 3.14
;bool debug ;bool = true
;env token ;env = $["TOKEN"]
;list[T] tags ;list[string] = ["a", "b"]
;tuple info ;tuple = ["host", 6767, true]

✿ Python

✦ Installation

git clone https://github.com/Creeper011/Yumly
cd Yumly/
make deps   # install Nim dependencies
pip install . # or path to Yumly repository

✦ Usage

from yumly import Yumly
from typing import Any

PORT = 6767

yumly = Yumly()

data: dict[str, Any] = yumly.load("config.yumly")
print(data["global"]["project"])
print(data["database"]["port"])

data_to_write: dict[str, str] = {
    "port": PORT,
    "uri": "127.0.0.1", 
}
with open("config2.yumly", "w") as file:
    yumly.dump(data_to_write, file)

# or:
content: str = yumly.dumps(data_to_write)
print(content)

result: bool = yumly.validate_content(content)
print(f"Content validation result: {result}")

file_result: bool = yumly.validate_file("config2.yumly")
print(f"File validation result: {file_result}")

✿ Nim

✦ Installation

git clone https://github.com/Creeper011/Yumly
cd Yumly/
nimble install --path:.

✦ Basic usage

import Yumly

let config = loadYumly("config.yumly")

echo config["global"]["project"].getStr()
echo config.getBlock("database")["port"].getInt()
Iteration
for blk in config:
    echo blk.name
    for key, val in blk:
        echo key & " = " & val.getStr()
Mapping to objects with the to macro
type
    App = object
        project: string
        version: string
        production: bool

let app = config.getBlock("global").to(App)
echo app.project   # "Orion"
File writing
var cfg = newYumly()
cfg.addPair("name", newStringValue("Orion"), "string")

var db = newBlock("database")
db.addPair("host", newStringValue("localhost"))
db.addPair("port", newIntValue(5432), "int")
cfg.addBlock(db)

cfg.writeYumly("output.yumly")

✿ CLI

yumly_cli check config.yumly
yumly_cli load config.yumly

✿ VSCode Extension

cd yumly-vscode
npx --yes @vscode/vsce package
code --install-extension yumly.vsix

✿ Tests

python tests/run_tests.py
nim c -r tests/test_encoder.nim

✿ About Projects (Tests)

  • Yumly has a set of PoC (Proof of Concepts) projects that aim to test yumly implementations in a more integrated real-world scenario; they can be found in tests/projects.

★ License ★

MIT — see LICENSE.

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

yumly-0.8.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distributions

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

yumly-0.8.1-py3-none-win_amd64.whl (236.3 kB view details)

Uploaded Python 3Windows x86-64

yumly-0.8.1-py3-none-manylinux_2_28_x86_64.whl (180.7 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

yumly-0.8.1-py3-none-macosx_11_0_arm64.whl (136.6 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

yumly-0.8.1-cp312-cp312-win_amd64.whl (236.3 kB view details)

Uploaded CPython 3.12Windows x86-64

yumly-0.8.1-cp312-cp312-manylinux_2_28_x86_64.whl (180.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

yumly-0.8.1-cp312-cp312-macosx_11_0_arm64.whl (136.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

yumly-0.8.1-cp311-cp311-win_amd64.whl (236.3 kB view details)

Uploaded CPython 3.11Windows x86-64

yumly-0.8.1-cp311-cp311-manylinux_2_28_x86_64.whl (180.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

yumly-0.8.1-cp311-cp311-macosx_11_0_arm64.whl (136.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

yumly-0.8.1-cp310-cp310-win_amd64.whl (236.3 kB view details)

Uploaded CPython 3.10Windows x86-64

yumly-0.8.1-cp310-cp310-manylinux_2_28_x86_64.whl (180.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

yumly-0.8.1-cp310-cp310-macosx_11_0_arm64.whl (136.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file yumly-0.8.1.tar.gz.

File metadata

  • Download URL: yumly-0.8.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for yumly-0.8.1.tar.gz
Algorithm Hash digest
SHA256 a912b8b40ef2f1aec198e5018ea0e268b008fc5fc0676386f48271061fa76753
MD5 58a40a82fbec7ac843296a68bcb8703b
BLAKE2b-256 0c03ee8d6483e5f26649ae6db01633768497918d974b5f8401e3555cf7504cb8

See more details on using hashes here.

File details

Details for the file yumly-0.8.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: yumly-0.8.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 236.3 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for yumly-0.8.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 bb725618d4165507bac2ea70474b4494ae22ed94216dcd8e4fe06da974fd0000
MD5 d147d5053b2e59abe67ed655f01ce30c
BLAKE2b-256 15d04e0386fadeb33f0baccd329e1c8ee6094ec24c8d97b555b139164d494084

See more details on using hashes here.

File details

Details for the file yumly-0.8.1-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for yumly-0.8.1-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 288140285f2c10f028172b57e11fd661fb2e394b318e0020b95d83411f31e2b9
MD5 5b4f7c795a32014d603d26fea9c1e12a
BLAKE2b-256 de340bad5c854fa88744ce76b512ca8e475c3b8c934dbc8820662e4b156a597f

See more details on using hashes here.

File details

Details for the file yumly-0.8.1-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: yumly-0.8.1-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 136.6 kB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for yumly-0.8.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3899a820d000626c7b1a6732ad7c118eb10e8c9a64f50480969f0629bb300316
MD5 081af474bf17e579caf86f505e317459
BLAKE2b-256 094bf4ab6fee567bb5095fbe464c303345732f23ecaf2bead2afddfc942cacdf

See more details on using hashes here.

File details

Details for the file yumly-0.8.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: yumly-0.8.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 236.3 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for yumly-0.8.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1db720ce39fe96ef7c1e9c5750f082d2bcaa50e172562e19f0087499e6a5f888
MD5 6ac0e76fc4797a33be9f467d571fe538
BLAKE2b-256 69b10445f2aed65cfed87d560616ef399fb2769f1ef2a4cb13674f1c70afbf22

See more details on using hashes here.

File details

Details for the file yumly-0.8.1-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for yumly-0.8.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6bf802c8fcb92ae843e3f57059092bc30c39ab0ac727c75abab6ed12b46d4df1
MD5 2b498a0a744d63940c68e2ec1ad2a5db
BLAKE2b-256 3c097e67a3a6074750c7c1e7a4293de524866a26b2b8e1fe190bc1010d9d555c

See more details on using hashes here.

File details

Details for the file yumly-0.8.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for yumly-0.8.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1fb4466fa33a90ca10e9c36bdab35a6fbcc19e10530fc7b27274bbb5a9a47cb2
MD5 7c24e9d78ea5a6ce5fd3d572415d3eeb
BLAKE2b-256 6f6fd6e7f25fec49a6f056619b1119d247bb12cdc7893f6e20e65c214153a8f2

See more details on using hashes here.

File details

Details for the file yumly-0.8.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: yumly-0.8.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 236.3 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for yumly-0.8.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f76d6f05ad749a846aad42a3fac3ac2f1c8d77a50447b8160a5806f82c1c3bf3
MD5 451470d6c1b121f4f9655d962caa638c
BLAKE2b-256 0796c30aa62a81fffae34a73bc7501554d6ad22351c1e0a1c1a692798e20f016

See more details on using hashes here.

File details

Details for the file yumly-0.8.1-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for yumly-0.8.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 05cfa4fb5791929998744b6891dd5b400d945225e95fb1a589afdbd9ea309b59
MD5 2e20c21df2ba1315c884cdf7e5a6d92c
BLAKE2b-256 97b6a2b3a4a10af788d410e0b423ed251cb87f8f22715bd6f68f3e037cd772ce

See more details on using hashes here.

File details

Details for the file yumly-0.8.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for yumly-0.8.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 728da40df78babfe1e2a34629b2837fd995d3500b4362de35cba7a5f0317dbe8
MD5 ed020e69db920a8b6cacc5f856969710
BLAKE2b-256 91b4321679c60a48c9afb5c0ce23b5bbb88f76c8ebf2a0063ad08b2c071508b5

See more details on using hashes here.

File details

Details for the file yumly-0.8.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: yumly-0.8.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 236.3 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for yumly-0.8.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 102642b3cbe5b52ddde1220db8bee6c235e6fd47af14aae4a2f8537b75f68435
MD5 505891cacc0838a1296a84e64af68888
BLAKE2b-256 6937b563f63aaa72fe147f07d04fbeaf5950ca60240fa02849803a3a6a6e687d

See more details on using hashes here.

File details

Details for the file yumly-0.8.1-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for yumly-0.8.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 edd4a4623da4862f430b9edc1876df0bac67ef244cfcadc325e1ee16272ca045
MD5 3cb06ebc98dc1c35150a3a5b613bf84d
BLAKE2b-256 af2a516ee065fe293e941bc090526a843357ca5a80406c11399680f7d1c49766

See more details on using hashes here.

File details

Details for the file yumly-0.8.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for yumly-0.8.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 19c7cb1b84428dc95aed596345c5fffe4f24d48fc4cdf392e46df553dca2914f
MD5 0e7da0d07ebd83fb77781405ade80f4d
BLAKE2b-256 b7fec6a2d710e35c65a96974f2657da375c9a4712cb185234f582a467aee1acd

See more details on using hashes here.

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