All Projects → lbovet → Yglu

lbovet / Yglu

Licence: mit
Yglu ᕄ !? - YAML glue for structural templating and processing

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Yglu

Carvel Ytt
YAML templating tool that works on YAML structure instead of text
Stars: ✭ 816 (+1500%)
Mutual labels:  yaml, devops, templating
Config Lint
Command line tool to validate configuration files
Stars: ✭ 118 (+131.37%)
Mutual labels:  yaml, devops
Kapitan
Generic templated configuration management for Kubernetes, Terraform and other things
Stars: ✭ 1,383 (+2611.76%)
Mutual labels:  yaml, devops
Wflow
🐆 EXPERIMENTAL -- Runs GitHub Actions workflows locally (local) -- Don't run your YAML like a 🐪
Stars: ✭ 187 (+266.67%)
Mutual labels:  yaml, devops
Gomplate
A flexible commandline tool for template rendering. Supports lots of local and remote datasources.
Stars: ✭ 1,270 (+2390.2%)
Mutual labels:  devops, templating
Genesis
Templating, scaffolding and generation tool
Stars: ✭ 122 (+139.22%)
Mutual labels:  yaml, templating
Juju
Universal Operator Lifecycle Manager (OLM) for Kubernetes operators, and operators for traditional Linux and Windows apps, with declarative integration between operators for automated microservice integration.
Stars: ✭ 1,942 (+3707.84%)
Mutual labels:  yaml, devops
Shon
A simple tool to convert json or yaml into a shell-compliant data structure.
Stars: ✭ 47 (-7.84%)
Mutual labels:  yaml, devops
Prinder
Free Pull Request reminder for Github. Has configurations to post reminders to Slack and email along with jinja templating
Stars: ✭ 21 (-58.82%)
Mutual labels:  yaml, templating
Ahoy
Create self-documenting cli programs from YAML files. Easily wrap bash, grunt, npm, docker, (anything) to standardize your processes and make the lives of the people working on your project better.
Stars: ✭ 201 (+294.12%)
Mutual labels:  yaml, devops
Iamy
A cli tool for importing and exporting AWS IAM configuration to YAML files
Stars: ✭ 200 (+292.16%)
Mutual labels:  yaml, devops
qaz
qaz—A CLI tool for Templating & Managing stacks in AWS Cloudformation
Stars: ✭ 89 (+74.51%)
Mutual labels:  yaml, templating
Ios Dev Playbook
不会运维的 iOS 开发不是好设计师。这个 Ansible Playbook 能快速配置 iOS 开发需要的服务,安装如 Gogs、GitLab、Jenkins、Ghost、Ajenti 等常用服务。
Stars: ✭ 542 (+962.75%)
Mutual labels:  yaml, devops
Octopod
🐙🛠️ Open-source self-hosted solution for managing multiple deployments in a Kubernetes cluster with a user-friendly web interface.
Stars: ✭ 47 (-7.84%)
Mutual labels:  devops
Run Vcpkg
GitHub Action to automatically cache and run vcpkg to build C++ dependencies for your C++ based applications. Available as Azure DevOps tasks also: https://marketplace.visualstudio.com/items?itemName=lucappa.cmake-ninja-vcpkg-tasks
Stars: ✭ 49 (-3.92%)
Mutual labels:  devops
Inferno Most Fp Demo
A demo for the ReactJS Tampa Bay meetup showing how to build a React+Redux-like architecture from scratch using Inferno, Most.js, reactive programmning, and various functional programming tools & techniques
Stars: ✭ 45 (-11.76%)
Mutual labels:  functional
Kapo
Wrap any command in a status socket
Stars: ✭ 45 (-11.76%)
Mutual labels:  devops
Origin
Conformance test suite for OpenShift
Stars: ✭ 8,046 (+15676.47%)
Mutual labels:  devops
Piplin
📤 An open source self-hosted continuous integration and deployment system - QQ群: 656868
Stars: ✭ 1,044 (+1947.06%)
Mutual labels:  devops
Zaml
The Final Form of configuration files
Stars: ✭ 45 (-11.76%)
Mutual labels:  yaml

Build Status PyPI version

* Try Yglu Online *

Yglu ᕄ !?

Yglu is YAML augmented with an advanced expression language. Unlike usual text templating, Yglu relies on the YAML structure and leverages its tag system combined with the YAQL query language.

This association enables templating and functional processing a bit like if YAML nodes were spreadsheet cells.

Yglu input documents are pure and valid YAML using tags for computed nodes.

input
a: 1
b: !? .a + 1
!if .b = 2:
  c: 3  
output
a: 1
b: 2 
c: 3
 
input
names: !-
  - 'nginx:1.16'
  - 'node:13.6'
  - 'couchbase:9.3'
image: !()
  !? $.split(':')[0]: 
    version: !? $.split(':')[1]
images: !? 
  $_.names
    .select(($_.image)($))
    .aggregate($1.mergeWith($2), {})
output
images:
  nginx: 
    version: '1.16'
  node: 
    version: '13.6'
  couchbase: 
    version: '9.3'
     
     
     
       

In the example above, the names sequence is hidden, image is a function (like a template block) and images is an expression which iterates through all names, applies the image function to each one and aggregates the individual results by merging them together as a mapping.

As such an operation is often needed, Yglu provides a !for tag for merging a sequence iterated over a function:

input
names: !-
  - 'nginx:1.16'
  - 'node:13.6'
  - 'couchbase:9.3'
images: 
  !for .names: !()
    !? $.split(':')[0]:
      version: !? $.split(':')[1]
output
images:
  nginx: 
    version: '1.16'
  node: 
    version: '13.6'
  couchbase: 
    version: '9.3'
     

See the test samples for more examples.

* Try Yglu Online *

Install

pip3 install yglu

Run

Usage: yglu [options] [<filename>]

Options:
  -v - -version          Print version and exit.
  -h - -help             Print help and exit.

Tags

Tags specify an alteration of the document structure.

Tag    Description
!? Evaluate an expression. The result can be a scalar, mapping or sequence. Can also be used in mapping keys.
!- Hide the node in the output but keep it accessible from expressions. Can be an expression.
!() Make the node reusable in expressions as a function.
!if Conditional merge. See if.yml.
!for Merge the results of a function applied to all items of a sequence . See for.yml.
!apply Apply a function or function block to a block. See function.yml.

Expressions

Expressions are written in YAQL.

They are evaluated in a context with the following variables defined:

Variable Description
$_ Refers to the current document root. Can be omitted at the beginning of the expression if it starts with a dot.
$ Implicit argument of functions.
$env Gives access to environment variables. Disabled by default. Set the $YGLU_ENABLE_ENV environment variable to enable this feature.
$this Refers to the current function block node in order to access its children nodes. See function.yml

Built-in Functions

In addition to the standard YAQL library, Yglu defines the following functions:

Function Description
$import(filename) Imports another document in the current node. By default, it is only permitted to import files from within the directory hierarchy of the input file. Set $YGLU_IMPORT_ALLOW to a list of permitted directories.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].