Skip to main content

Tiny Render

Unit Testing Deployment PyPI version

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 for git hash, the value will be None if git is not installed or the current directory is not a git repo.
  • {{ 'HOME' | getenv }} - the environment variable HOME will be renderred. It will raise exception if HOME is not set
  • {{ _date_str }} - the current date in yyyymmdd format
  • {{ _time_str }} - the current date/time in yyyymmddHHMMSS format

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"

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)

Source distribution for tiny-render 0.2.0
File Size Uploaded
tiny_render-0.2.0.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tiny-render 0.2.0
File Interpreter ABI Platform
tiny_render-0.2.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.5

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page