Metadata-Version: 2.1
Name: yglu
Version: 0.4.0
Summary: YAML glue for structural templating and processing
Home-page: https://github.com/lbovet/yglu
Author: Laurent Bovet
Author-email: laurent.bovet@windmaster.ch
License: UNKNOWN
Description: [![Build Status](https://travis-ci.org/lbovet/yglu.svg?branch=master)](https://travis-ci.org/lbovet/yglu)
        [![PyPI version](https://badge.fury.io/py/yglu.svg)](https://badge.fury.io/py/yglu)
        # Yglu ᕄ
        
        Yglu is [YAML](https://yaml.org/) enriched with an advanced expression language. Unlike usual text templating, Yglu relies on the YAML structure and leverage its typing features combined with the [YAQL](https://yaql.readthedocs.io/en/latest/) query language. 
        
        This association enables templating and functional processing a bit like if YAML nodes where spreadsheet cells.
        
        Yglu input documents are pure YAML using tags for computed nodes.
        
        <table><tr>
        <td width="440">
        input
        <pre lang="yaml">
        a: 1
        b: ?! $.a + 1  </pre>
        </td>
        <td width="440">
        output
        <pre lang="yaml">
        a: 1
        b: 2  </pre>
        </td>
        </tr></table>
        
        See the [test samples](https://github.com/lbovet/yglu/tree/master/tests/samples) for more examples.
        
        ## Install
        
        ```
        pip 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 structure of the document.
        
        | **Tag**&nbsp;&nbsp;&nbsp;| **Description** |
        |-----------|-----------------|
        | `!?`     | Replace the node value with the result of an expression |
        | `!-`      | Hide the node in the output but keep it accessible from expressions. If the node value is a string, it is replaced with the result of the expression. |
        | `!()`  | Make the node reusable in expressions as a function. It is also hidden. |
        
        ## Expressions
        
        Expressions are written in [YAQL](https://yaql.readthedocs.io/en/latest/).
        
        They are evaluated in a context with the following predefined variables:
        
        | **Variable**| **Description** |
        |-----------|-----------------|
        | `$`     | Refers to the document root, or implicit argument in function blocks. |
        | `$_`      | Always refers to the document root. So that the root is accessible from functions. |
        | `$env`    | Gives access to environment variables if $YGLU_ENABLE_ENV environment variable is set. |
        
        
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
