Skip to content

Instantly share code, notes, and snippets.

@finsterthecat
finsterthecat / moustache.py
Last active December 23, 2020 18:37
Replace all template variables in input file with configured values from the JSON config
import json
import re
import sys
#
# Replace all template variables in input file with configured values
# from the JSON config. Template variables are distiguished by enclosing
# double braces. eg {{ template.variable }}. This would match templatevalue
# in JSON config {"template": {"variable": "templatevalue"}}
#