Very simple text templating view for Python
Project description
TextTemplate
========
Very simple text templating views for Python
Uses colour variables from AnsiColours package to style text.
Installation
------------
Install by running:
pip install text_template
Usage
-----
from text_template import TextTemplate as view
print(view.render(
template='./a_view.txt',
variable="two",
another_variable='three'
))
The view uses `$` and `${}` to parse the variables passed to the template for example:
# a_view.txt
One, $variable and ${another_variable}
New line here
License
-------
The project is licensed under the MIT license.
========
Very simple text templating views for Python
Uses colour variables from AnsiColours package to style text.
Installation
------------
Install by running:
pip install text_template
Usage
-----
from text_template import TextTemplate as view
print(view.render(
template='./a_view.txt',
variable="two",
another_variable='three'
))
The view uses `$` and `${}` to parse the variables passed to the template for example:
# a_view.txt
One, $variable and ${another_variable}
New line here
License
-------
The project is licensed under the MIT license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
text_template-0.1.3.tar.gz
(2.4 kB
view details)
Built Distribution
File details
Details for the file text_template-0.1.3.tar.gz
.
File metadata
- Download URL: text_template-0.1.3.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | edd75620fd49564f5c48a0a0fadbaf788d1065bb17eeffe43573d7031677f1e5 |
|
MD5 | b39fa59e47faf8baa50eba9215ba4468 |
|
BLAKE2b-256 | 826c0a0f675bf8d9999637eae96ad0064ef93acfa15fa68ffbe3ee4484066c2d |
File details
Details for the file text_template-0.1.3-py2.py3-none-any.whl
.
File metadata
- Download URL: text_template-0.1.3-py2.py3-none-any.whl
- Upload date:
- Size: 2.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c63811a8360f1423036e6a1b60effc2bab295aabbcc6140bf84bf11636201d09 |
|
MD5 | 1ca1d576fb1e4eda2dbaeba3291a9ade |
|
BLAKE2b-256 | c4686b1c6d5cfa209ef6eb61d6c203b16b0114c7287fb69ea37bfc8f40b59017 |