from jinja2 import Environment, BaseLoader rtemplate = Environment(loader=BaseLoader()).from_string(myString) data = rtemplate.render(**data)