Skip to main content

Template and Macros Expansion for Path names.

Project description

http://img.shields.io/pypi/v/tmep.svg https://travis-ci.org/Josef-Friedrich/tmep.svg?branch=master

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tmep-1.0.7.tar.gz (32.6 kB view details)

Uploaded Source

File details

Details for the file tmep-1.0.7.tar.gz.

File metadata

  • Download URL: tmep-1.0.7.tar.gz
  • Upload date:
  • Size: 32.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tmep-1.0.7.tar.gz
Algorithm Hash digest
SHA256 8adddc6da0ab4bafe4399693ee79dd351e8622174bb35dc6cfa975453a5d5ade
MD5 9a1f52892a084f580f0c956133217913
BLAKE2b-256 b489cef5df5a17ae8ea68c19efb3be9f2eb14a9ab2cc5adfc5812f4bd8332053

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page