Template and Macros Expansion for Path names.
Project description
tmep
Template and Macros Expansion for Path names.
Installation
From Github
git clone git@github.com:Josef-Friedrich/tmep.git
cd tmep
python setup.py install
From PyPI
pip install tmep
easy_install tmep
Usage
>>> import tmep
>>> template = '$prename $lastname'
>>> values = {'prename': 'Franz', 'lastname': 'Schubert'}
>>> out = tmep.parse(template, values)
>>> print(out)
Franz Schubert
This module implements a string formatter based on the standard PEP 292 string.Template class extended with function calls. Variables, as with string.Template, are indicated with $ and functions are delimited with %.
This module assumes that everything is Unicode: the template and the substitution values. Bytestrings are not supported. Also, the templates always behave like the safe_substitute method in the standard library: unknown symbols are left intact.
This is sort of like a tiny, horrible degeneration of a real templating engine like Jinja2 or Mustache.
Development
Test
tox
Publish a new version
git tag 1.1.1 git push --tags python setup.py sdist upload
Package documentation
The package documentation is hosted on readthedocs.
Generate the package documentation:
python setup.py build_sphinx
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file tmep-1.0.3.tar.gz
.
File metadata
- Download URL: tmep-1.0.3.tar.gz
- Upload date:
- Size: 27.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3477c8eb05972182410c11f9c8d07439b5598cbe95df5f40b039b42b037c69e |
|
MD5 | 7d7df184d3698bdcb6e5175d90e39dac |
|
BLAKE2b-256 | 0dfda611771df7a7f15c2f10859fdabce51fa8cc9c4cfa17e697434c88d9d316 |