Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Single file templater

Project description

sftmpl takes a single file as input and uses the built-in string format method to replace the occurences of brace-enclosed variables by values given on the command-line.

The aim of sftmpl is to simplify the generation of configuration file in computing protocols by providing a command-line enabled customization of these configuration files.


Obtain the distribution file and use

python install

The source repository is and the code may be obtained via the command

git clone


sftmpl uses the curly brace named fields defined in PEP 3101.

For the following input file myconfig.txt, you must provide the command-line options -N, –parameter and –N_steps:

# Config for "myprog"
N = {N}
parameter = {parameter}

run {N_steps} steps

The invocation is as follows when sftmpl is installed

sftmpl myconfig.txt -N 10 –parameter 0.1 –N_steps 500

and the following result is output to the standard output:

# Config for "myprog"
N = 10
parameter = 0.1

run 500 steps


Author: Pierre de Buyl

License: Modified BSD (see LICENSE).

Project details

Release history Release notifications | RSS feed

This version


Download files

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

Files for sftmpl, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size sftmpl-0.1.tar.gz (3.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page