jamurai


Namejamurai JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://jamurai.readthedocs.io/en/0.1.3/
SummaryJinja wrapper for file and directory transformation and injection
upload_time2024-12-07 14:47:46
maintainerNone
docs_urlNone
authorGaffer Fitch
requires_pythonNone
licenseNone
keywords
VCS
bugtrack_url
requirements Jinja2 overscore yaes PyYAML sphinxter ptvsd coverage pylint
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://jamurai.readthedocs.io/en/0.1.3/",
    "name": "jamurai",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Gaffer Fitch",
    "author_email": "jamurai@gaf3.com",
    "download_url": "https://files.pythonhosted.org/packages/31/51/6411c2b5c5ac77ac1ca7aa1a3bf2176d165175e42dfec2fa2bddd55c5a43/jamurai-0.1.3.tar.gz",
    "platform": null,
    "description": "jamurai\n=======\n\nJinja wrapper for file and directory transformation and injection\n\nAs a single content::\n\n    import os\n    import yaml\n    import jamurai\n\n    with open(\"/tmp/from.txt\", \"w\") as from_file:\n        from_file.write(\"{{ foo }}\")\n\n    content = {\n        \"source\": \"from.txt\",\n        \"destination\": \"to.txt\"\n    }\n\n    values = {\n        \"foo\": \"bar\"\n    }\n\n    jamurai.build(content, values, \"/tmp\")\n\n    with open(\"/tmp/to.txt\", \"r\") as to_file:\n        data = to_file.read()\n\n    data\n    # \"bar\"\n\nFor multiple content::\n\n    machine = jamurai.Machine(\"/tmp\")\n\n    with open(\"/tmp/this.txt\", \"w\") as from_file:\n        from_file.write(\"{{ this }}\")\n\n    with open(\"/tmp/that.txt\", \"w\") as from_file:\n        from_file.write(\"{{ that }}\")\n\n    contents = [\n        {\n            \"source\": \"this.txt\",\n            \"destination\": \"these.txt\"\n        },\n        {\n            \"source\": \"that.txt\",\n            \"destination\": \"those.txt\"\n        }\n    ]\n\n    values = {\n        \"this\": \"yin\",\n        \"that\": \"yang\"\n    }\n\n    for content in contents:\n        machine.build(content, values)\n\n    with open(\"/tmp/these.txt\", \"r\") as to_file:\n        data = to_file.read()\n\n    data\n    # \"yin\"\n\n    with open(\"/tmp/those.txt\", \"r\") as to_file:\n        data = to_file.read()\n\n    data\n    # \"yang\"\n\nLook at the content docs at the 'CnC Forge https://github.com/gaf3/cnc-forge/blob/main/Output.md#content'_\n\nThe only difference is the base is the same direcctory unlike transforming from one repo to enother.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Jinja wrapper for file and directory transformation and injection",
    "version": "0.1.3",
    "project_urls": {
        "Download": "https://github.com/gaf3/jamurai",
        "Homepage": "https://jamurai.readthedocs.io/en/0.1.3/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c054db4ef356c886f28eb121d12b443fe485e910e4af042a15e0a1ab14a64efe",
                "md5": "350442738a1d1e91cd0c4733d5d13e5f",
                "sha256": "65cdf4d09616204c72b4ea9637fa099d9b92ac0118277ea03d0b87ee98df6c48"
            },
            "downloads": -1,
            "filename": "jamurai-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "350442738a1d1e91cd0c4733d5d13e5f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6169,
            "upload_time": "2024-12-07T14:47:45",
            "upload_time_iso_8601": "2024-12-07T14:47:45.080053Z",
            "url": "https://files.pythonhosted.org/packages/c0/54/db4ef356c886f28eb121d12b443fe485e910e4af042a15e0a1ab14a64efe/jamurai-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "31516411c2b5c5ac77ac1ca7aa1a3bf2176d165175e42dfec2fa2bddd55c5a43",
                "md5": "3fe36ad01a63cf7dc9ae2431c5e46894",
                "sha256": "ad838a2f7695460eb777d6e657e4b83489a1c1204c8e046c8d33a92a075d5227"
            },
            "downloads": -1,
            "filename": "jamurai-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "3fe36ad01a63cf7dc9ae2431c5e46894",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 8340,
            "upload_time": "2024-12-07T14:47:46",
            "upload_time_iso_8601": "2024-12-07T14:47:46.807487Z",
            "url": "https://files.pythonhosted.org/packages/31/51/6411c2b5c5ac77ac1ca7aa1a3bf2176d165175e42dfec2fa2bddd55c5a43/jamurai-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-07 14:47:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gaf3",
    "github_project": "jamurai",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "Jinja2",
            "specs": [
                [
                    "==",
                    "3.1.2"
                ]
            ]
        },
        {
            "name": "overscore",
            "specs": [
                [
                    "==",
                    "0.1.2"
                ]
            ]
        },
        {
            "name": "yaes",
            "specs": [
                [
                    "==",
                    "0.2.5"
                ]
            ]
        },
        {
            "name": "PyYAML",
            "specs": [
                [
                    "==",
                    "6.0.1"
                ]
            ]
        },
        {
            "name": "sphinxter",
            "specs": [
                [
                    "==",
                    "0.1.7"
                ]
            ]
        },
        {
            "name": "ptvsd",
            "specs": [
                [
                    "==",
                    "4.3.2"
                ]
            ]
        },
        {
            "name": "coverage",
            "specs": [
                [
                    "==",
                    "6.4.2"
                ]
            ]
        },
        {
            "name": "pylint",
            "specs": [
                [
                    "==",
                    "2.14.5"
                ]
            ]
        }
    ],
    "lcname": "jamurai"
}
        
Elapsed time: 0.39644s