Python command-line tool to generates text files based on Jinja2 template and YAML data file.
Project description
JINJACRAFT
JinjaCraft is a simple Python command-line tool which can generate text file based on a Jinja2 template and a YAML data file.
Requirements
Python 3.9 or higher
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
title: Hello World
tasks:
- name: First task
completed: True
- name: Second task
completed: False
Template file
Document: {{ title }}
Tasks:
{% for task in tasks %}- {{ task.name }} ({% if task.completed %}completed{% else %}not completed{% endif %})
{% endfor %}
Command line
jinjacraft data.yaml template.jinja2 -o outputfile.txt
Output file content
Document: Hello World
Tasks:
- First task (completed)
- Second task (not completed)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jinjacraft-1.3.0.tar.gz.
File metadata
- Download URL: jinjacraft-1.3.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52aab84e47e7fa49fb1d25eee76654058df7d07ec66197e8260fb3c39910e4ba
|
|
| MD5 |
e9edbf921310b3ffefd9ae2658fef0f6
|
|
| BLAKE2b-256 |
835424ee7dbf9e792289d5b8557d00783b2bd634379dee254d61a4dd3dabac59
|
Provenance
The following attestation bundles were made for jinjacraft-1.3.0.tar.gz:
Publisher:
release.yml on sdejongh/jinjacraft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jinjacraft-1.3.0.tar.gz -
Subject digest:
52aab84e47e7fa49fb1d25eee76654058df7d07ec66197e8260fb3c39910e4ba - Sigstore transparency entry: 813647664
- Sigstore integration time:
-
Permalink:
sdejongh/jinjacraft@23712f8d5d9c926566cd7d67a7cf09917d5006e7 -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/sdejongh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@23712f8d5d9c926566cd7d67a7cf09917d5006e7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file jinjacraft-1.3.0-py3-none-any.whl.
File metadata
- Download URL: jinjacraft-1.3.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4593cc8fdd6a4fa744ec4cf04a17094e2939db53d85cb6edede151b918a5910
|
|
| MD5 |
30ae159ea58a73e2dbf823bbf5a2bf98
|
|
| BLAKE2b-256 |
cca96cc8e1fb5d83caf4c8489cc6166311528af0d571b676d22df7d3b90ad366
|
Provenance
The following attestation bundles were made for jinjacraft-1.3.0-py3-none-any.whl:
Publisher:
release.yml on sdejongh/jinjacraft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jinjacraft-1.3.0-py3-none-any.whl -
Subject digest:
d4593cc8fdd6a4fa744ec4cf04a17094e2939db53d85cb6edede151b918a5910 - Sigstore transparency entry: 813647665
- Sigstore integration time:
-
Permalink:
sdejongh/jinjacraft@23712f8d5d9c926566cd7d67a7cf09917d5006e7 -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/sdejongh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@23712f8d5d9c926566cd7d67a7cf09917d5006e7 -
Trigger Event:
push
-
Statement type: