I am not exactly sure what you mean, so I will guess. Jinja may be what you're looking for. It's an important component of flask & ansible, for example. pyweave may also serve your purposes. HTH