import json
from jinja2 import Environment, FileSystemLoader 

with open("playlist.json","r") as d:
	playlist_obj = json.load(d)

fileLoader = FileSystemLoader("templates")
env = Environment(loader=fileLoader)

rendered = env.get_template("playlist.html").render(playlist=playlist_obj,title="text archaeology")

fileName = "index.html"

with open(f"{fileName}","w") as f:
	f.write(rendered)