Skip to main content

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.

Release files for jamurai 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jamurai 0.1.4
File Size Uploaded
jamurai-0.1.4.tar.gz 8.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jamurai 0.1.4
File Interpreter ABI Platform
jamurai-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 14.5 kB

Release files / jamurai-0.1.4.tar.gz

Download URL jamurai-0.1.4.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ada09b5c6a03b550cdc1ca3d1fc4ddbdfd0a2e828986ae4e6597598ccafb4d57
BLAKE2b-256 checksum
How to use checksums
79e07729c2eccdb8b1c13cb5929878e981d4cb870df35b068900a4aa80998c94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.5

Release files / jamurai-0.1.4-py3-none-any.whl

Download URL jamurai-0.1.4-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9336998952dfc281bb1177d60132eb150ad801d4f537adb6e5217869a317a278
BLAKE2b-256 checksum
How to use checksums
cb60eeecf5c2eef2d9dc608fdab5a0e578bc0cdada6645889ddf3e96a1d203bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page