Metadata-Version: 2.1
Name: jamurai
Version: 0.1.1
Summary: Jinja wrapper for file and directory transformation and injection
Home-page: https://jamurai.readthedocs.io/en/0.1.1/
Download-URL: https://github.com/gaf3/jamurai
Author: Gaffer Fitch
Author-email: jamurai@gaf3.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
License-File: LICENSE.txt
Requires-Dist: Jinja2==3.1.2
Requires-Dist: overscore==0.1.1
Requires-Dist: yaes>=0.2.2
Requires-Dist: PyYAML==6.0.1
Requires-Dist: MarkupSafe==2.1.5

jamurai
=======

Jinja wrapper for file and directory transformation and injection

As a single content::

    import os
    import yaml
    import jamurai

    with open("/tmp/from.txt", "w") as from_file:
        from_file.write("{{ foo }}")

    content = {
        "source": "from.txt",
        "destination": "to.txt"
    }

    values = {
        "foo": "bar"
    }

    jamurai.build(content, values, "/tmp")

    with open("/tmp/to.txt", "r") as to_file:
        data = to_file.read()

    data
    # "bar"

For multiple content::

    machine = jamurai.Machine("/tmp")

    with open("/tmp/this.txt", "w") as from_file:
        from_file.write("{{ this }}")

    with open("/tmp/that.txt", "w") as from_file:
        from_file.write("{{ that }}")

    contents = [
        {
            "source": "this.txt",
            "destination": "these.txt"
        },
        {
            "source": "that.txt",
            "destination": "those.txt"
        }
    ]

    values = {
        "this": "yin",
        "that": "yang"
    }

    for content in contents:
        machine.build(content, values)

    with open("/tmp/these.txt", "r") as to_file:
        data = to_file.read()

    data
    # "yin"

    with open("/tmp/those.txt", "r") as to_file:
        data = to_file.read()

    data
    # "yang"

Look at the content docs at the 'CnC Forge https://github.com/gaf3/cnc-forge/blob/main/Output.md#content'_

The only difference is the base is the same direcctory unlike transforming from one repo to enother.
