jinjacraft


Namejinjacraft JSON
Version 1.1.3 PyPI version JSON
download
home_pagehttps://github.com/sdejongh/jinjacraft
SummaryPython command-line tool to generates text files based on Jinja2 template and YAML data file.
upload_time2023-12-09 14:10:17
maintainer
docs_urlNone
authorSteve De Jongh
requires_python>=3.9
licenseMIT
keywords jinja2 yaml template command-line
VCS
bugtrack_url
requirements colorama exceptiongroup importlib-metadata iniconfig jinja2 markupsafe packaging pluggy pytest pyyaml tomli typing-extensions zipp
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Python](https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)
# JINJACRAFT

JinjaCraft is a simple Python command-line tool which can generate text file based on a Jinja2 template
and a YAML data file.

## Installation
```
pip install jinjacraft
```

## Usage
```
usage: jinjacraft [-h] [-o OUTPUT_FILE] data_file template_file

positional arguments:
  data_file             Yaml data file path
  template_file         Jinja2 template file path

options:
  -h, --help            show this help message and exit
  -o OUTPUT_FILE, --output_file OUTPUT_FILE
                        Output file path
```

## Example
### YAML file
```yaml
title: Hello World
tasks:
  - name: First task
    completed: True
  - name: Second task
    completed: False

```

### Template file
```jinja2
Document: {{ title }}
Tasks:
{% for task in tasks %}- {{ task.name }} ({% if task.completed %}completed{% else %}not completed{% endif %})
{%  endfor %}
```

### Command line
```bash
jinjacraft data.yaml template.jinja2 -o outputfile.txt
```

### Output file content
```
Document: Hello World
Tasks:
- First task (completed)
- Second task (not completed)
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sdejongh/jinjacraft",
    "name": "jinjacraft",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "jinja2,yaml,template,command-line",
    "author": "Steve De Jongh",
    "author_email": "dejongh.st@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/5c/69/0257187360d35c145c48d22fd2e20cc0e51763926537f2764e28da4dc4da/jinjacraft-1.1.3.tar.gz",
    "platform": null,
    "description": "![Python](https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)\n# JINJACRAFT\n\nJinjaCraft is a simple Python command-line tool which can generate text file based on a Jinja2 template\nand a YAML data file.\n\n## Installation\n```\npip install jinjacraft\n```\n\n## Usage\n```\nusage: jinjacraft [-h] [-o OUTPUT_FILE] data_file template_file\n\npositional arguments:\n  data_file             Yaml data file path\n  template_file         Jinja2 template file path\n\noptions:\n  -h, --help            show this help message and exit\n  -o OUTPUT_FILE, --output_file OUTPUT_FILE\n                        Output file path\n```\n\n## Example\n### YAML file\n```yaml\ntitle: Hello World\ntasks:\n  - name: First task\n    completed: True\n  - name: Second task\n    completed: False\n\n```\n\n### Template file\n```jinja2\nDocument: {{ title }}\nTasks:\n{% for task in tasks %}- {{ task.name }} ({% if task.completed %}completed{% else %}not completed{% endif %})\n{%  endfor %}\n```\n\n### Command line\n```bash\njinjacraft data.yaml template.jinja2 -o outputfile.txt\n```\n\n### Output file content\n```\nDocument: Hello World\nTasks:\n- First task (completed)\n- Second task (not completed)\n```\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python command-line tool to generates text files based on Jinja2 template and YAML data file.",
    "version": "1.1.3",
    "project_urls": {
        "Bug Tracker": "https://github.com/sdejongh/jinjacraft/issues",
        "Homepage": "https://github.com/sdejongh/jinjacraft",
        "Repository": "https://github.com/sdejongh/jinjacraft"
    },
    "split_keywords": [
        "jinja2",
        "yaml",
        "template",
        "command-line"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c93940f6442d49c98065deeb508768b495618c045915bae1183ea6d75772b83d",
                "md5": "326a700518cc68091c4263ec7cac1b8e",
                "sha256": "81fcfc615e4bc1bf9a8a18b723a9d443d1501063793fbb04160704aec72142e0"
            },
            "downloads": -1,
            "filename": "jinjacraft-1.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "326a700518cc68091c4263ec7cac1b8e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 3435,
            "upload_time": "2023-12-09T14:10:15",
            "upload_time_iso_8601": "2023-12-09T14:10:15.697974Z",
            "url": "https://files.pythonhosted.org/packages/c9/39/40f6442d49c98065deeb508768b495618c045915bae1183ea6d75772b83d/jinjacraft-1.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5c690257187360d35c145c48d22fd2e20cc0e51763926537f2764e28da4dc4da",
                "md5": "10f944638beee52aac8e248f908381c3",
                "sha256": "90baefe115cdb3ec73d68430950f2bf2451911a077b48e964b8304c0ab3f7472"
            },
            "downloads": -1,
            "filename": "jinjacraft-1.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "10f944638beee52aac8e248f908381c3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 2583,
            "upload_time": "2023-12-09T14:10:17",
            "upload_time_iso_8601": "2023-12-09T14:10:17.294143Z",
            "url": "https://files.pythonhosted.org/packages/5c/69/0257187360d35c145c48d22fd2e20cc0e51763926537f2764e28da4dc4da/jinjacraft-1.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-09 14:10:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sdejongh",
    "github_project": "jinjacraft",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "colorama",
            "specs": [
                [
                    "==",
                    "0.4.6"
                ]
            ]
        },
        {
            "name": "exceptiongroup",
            "specs": [
                [
                    "==",
                    "1.2.0"
                ]
            ]
        },
        {
            "name": "importlib-metadata",
            "specs": [
                [
                    "==",
                    "6.7.0"
                ]
            ]
        },
        {
            "name": "iniconfig",
            "specs": [
                [
                    "==",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "jinja2",
            "specs": [
                [
                    "==",
                    "3.1.2"
                ]
            ]
        },
        {
            "name": "markupsafe",
            "specs": [
                [
                    "==",
                    "2.1.3"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    "==",
                    "23.2"
                ]
            ]
        },
        {
            "name": "pluggy",
            "specs": [
                [
                    "==",
                    "1.2.0"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    "==",
                    "7.4.3"
                ]
            ]
        },
        {
            "name": "pyyaml",
            "specs": [
                [
                    "==",
                    "6.0.1"
                ]
            ]
        },
        {
            "name": "tomli",
            "specs": [
                [
                    "==",
                    "2.0.1"
                ]
            ]
        },
        {
            "name": "typing-extensions",
            "specs": [
                [
                    "==",
                    "4.7.1"
                ]
            ]
        },
        {
            "name": "zipp",
            "specs": [
                [
                    "==",
                    "3.15.0"
                ]
            ]
        }
    ],
    "lcname": "jinjacraft"
}
        
Elapsed time: 0.16235s