Skip to content

Instantly share code, notes, and snippets.

@ragingbal
Created June 17, 2020 21:04
Show Gist options
  • Save ragingbal/ad448fdf286243da2c5ec6c0ee78d38c to your computer and use it in GitHub Desktop.
Save ragingbal/ad448fdf286243da2c5ec6c0ee78d38c to your computer and use it in GitHub Desktop.
import json
import jinja2
with open('Schema_CRM_ACCOUNTCONTRACT.json') as f:
data = json.load(f)
templateLoader = jinja2.FileSystemLoader(searchpath="./")
templateEnv = jinja2.Environment(loader=templateLoader)
TEMPLATE_FILE = "create_table.jinja"
template = templateEnv.get_template(TEMPLATE_FILE)
outputText = template.render(data=data) # this is where to put args to the template renderer
print(outputText)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment