Skip to main content

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.

Install

Obtain the distribution file and use

python setup.py install

The source repository is https://github.com/pdebuyl/sftmpl.git and the code may be obtained via the command

git clone https://github.com/pdebuyl/sftmpl.git

Use

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

Misc

Author: Pierre de Buyl

License: Modified BSD (see LICENSE).

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

sftmpl-0.1.tar.gz (3.6 kB view details)

Uploaded Source

File details

Details for the file sftmpl-0.1.tar.gz.

File metadata

  • Download URL: sftmpl-0.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sftmpl-0.1.tar.gz
Algorithm Hash digest
SHA256 1f63e1da3d9f3e9918ce8c66eddb28047b97f3ed25c5b33ca4db1055b63624d6
MD5 3ec940710ded14691ff741d1697e7034
BLAKE2b-256 b3935de514d83a3920e2d82058895c6bf091b98062e1fd500926f05a94bc15e3

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