pyrender
jinja2を使った簡単なテンプレートレンダー パッケージングの練習に利用
$ renderj2 --help
Usage: renderj2 [OPTIONS] TEMPLATE_FILE
Rendre Jinja2 tempalte
Options:
-v, --varsfile PATH vars file path for jinja2
-o, --output PATH output file
--loglevel LVL Either CRITICAL, ERROR, WARNING, INFO or DEBUG
[default: INFO]
-h, --help Show this message and exit.
-V, --version Show the version and exit.
使い方
# renderj2 --vars vars.yml template.j2
上記のように実行すると、Jinja2の形式で書かれたtempalte.j2を
vars.ymlの変数を用いてレンダリングします。
レンダリング結果はデフォルトで標準出力に出力されます。
--output オプションを指定することで指定のファイルに出力することも可能です。
開発
Require
- python3
- Poetry
テスト
$ poetry poe test
ビルド
$ poetry build
Release files for renderj2 1.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| renderj2-1.2.2.tar.gz | 3.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| renderj2-1.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.4 kB
Release files / renderj2-1.2.2.tar.gz
| Download URL | renderj2-1.2.2.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a83d9d5dc647798c1b41db5245194c4d9157ed385bc55efc77819cf75a2b100b
|
|
BLAKE2b-256 checksum How to use checksums |
627825e6de379799138087405e0a50dba934fe81bf28dff1cc5541e38827c34e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / renderj2-1.2.2-py3-none-any.whl
| Download URL | renderj2-1.2.2-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9939ba41725d8595a54586bef4b67d2835d36376a802dfce1e684e4deb1c1a5a
|
|
BLAKE2b-256 checksum How to use checksums |
6f8276b730af972f15c92adc99f09f157f036b53e818869f514ce003e28607a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|