jjtemplate
Jinja2 Templating with JSON files
Example
example.txt.jinja:
Hello, {{ name }}.
example.json:
{
"name": "world"
}
You run:
$ jjtemplate -o result.txt example.txt.jinja example.json
Then you get result.txt:
Hello, world.
Install
$ pip install jjtemplate
Usage
usage: jjtemplate [-h] [-i IMPORT_NAME] [-o OUTPUT] template_file [json_files ...]
positional arguments:
template_file Jinja2 template file
json_files JSON files loaded to the context (top-level object must
be a dictionary)
optional arguments:
-h, --help show this help message and exit
-i IMPORT_NAME, --import IMPORT_NAME
import Python module to the context (can be put
multiple times)
-o OUTPUT, --output OUTPUT
output file name
Installed jjtemplate command runs main function of jjtemplate.py, which
is the sole entire content of the module.
You can copy jjtemplate.py and add it to your project freely. See the
License section bellow.
References
License
jjtemplate is marked with CC0 1.0. To view a copy of this license, visit <https://creativecommons.org/publicdomain/zero/1.0/>.
(In other words, public domain.)
Metadata
Release files for jjtemplate 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jjtemplate-0.9.0.tar.gz | 6.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jjtemplate-0.9.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.5 kB
Release files / jjtemplate-0.9.0.tar.gz
| Download URL | jjtemplate-0.9.0.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a92c2ed8bd645b725c5f19871bd16d1d3c3a62513dd271a7b3ffc569d7e22300
|
|
BLAKE2b-256 checksum How to use checksums |
4802614fd08fc35318696434b14f2cadc063bf45cbbac29e02af1c5775656879
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Release files / jjtemplate-0.9.0-py3-none-any.whl
| Download URL | jjtemplate-0.9.0-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b28072163edd3b5d5f0119bf77e27c0dadd43e22c4980416445fd917ed34c9e1
|
|
BLAKE2b-256 checksum How to use checksums |
36f310084b790c2958408d686de95a5cf4c45b7883d3b389495c9f8ee9f059f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|