Tiny Render
Version: 0.2.0
This is a very simple wrapper for Jinja2 by providing few built-in variables.
Additional variables for the Template,
{{ _gitsha }}- will be the shortsha forgithash, the value will beNoneifgitis not installed or the current directory is not a git repo.{{ 'HOME' | getenv }}- the environment variableHOMEwill be renderred. It will raise exception ifHOMEis not set{{ _date_str }}- the current date inyyyymmddformat{{ _time_str }}- the current date/time inyyyymmddHHMMSSformat
Installation
pip install tiny-render
Sample Code
from tiny_render import Render
with open(os.path.join("/tmp","test.txt"), 'w') as f:
f.write("gitsha: {{_gitsha}}, hello {{key}}")
params = {"key": "world"}
r = Render("/tmp")
r.go("test.txt", **params)
# the output is "gitsha: xxxxxxx, hello world"
Metadata
Release files for tiny-render 0.2.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 | Provenance | Actions |
|---|---|---|---|---|
| tiny_render-0.2.0.tar.gz | 3.9 kB | Without provenance | Details for tiny_render-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tiny_render-0.2.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for tiny_render-0.2.0-py2.py3-none-any.whl |
Total release size: 7.8 kB
Release files / tiny_render-0.2.0.tar.gz
| Download URL | tiny_render-0.2.0.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a4b90c35f8e0198727b3c9b94edff05b4a478b354f2f9795368ee7cb915683d
|
|
BLAKE2b-256 checksum How to use checksums |
d3949d492365696de7c8677bb92cd318ea86ab3405d440112c9c11888068ed09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
|
Release files / tiny_render-0.2.0-py2.py3-none-any.whl
| Download URL | tiny_render-0.2.0-py2.py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
98bcaf97add740e1f164561fb94b66e7420752cfdd3535187ce0e0411fe69df8
|
|
BLAKE2b-256 checksum How to use checksums |
34e4792bd122ed3d061418fd245b541105fb59f3014611ebb189c12e1ee08311
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
|
Security for tiny-render 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.