import json import cv2 import pprint import os.path as osp from cdf_parser import CdfParser print(""" """) path = "https://internblob.blob.core.windows.net/v-lixinyang/canva-render-11.30/{}?sp=racwdli&st=2023-09-17T15:37:58Z&se=2023-12-31T23:37:58Z&spr=https&sv=2022-11-02&sr=c&sig=u%2FPbZ4fNttAPeLj0NEEpX0eIgFcjhot%2Bmy3iGd%2BCmxk%3D" with open("cdfs.json", "r") as f: for line in f: cdf = json.loads(line) id = cdf['rendered_folder'] cdf_parser = CdfParser(cdf['content'], id) elements = cdf_parser.get_elements() print('
') elements = [e for e in elements[::-1]] for index, element in enumerate(elements): name = 'full' if index == 0 else f"({index - 1})" element_text = json.dumps(element, indent=2).replace("\n", "
").replace(" ", " "*2) print(f"""
image
image

{element_text}

""") print(f"""
image

Background

""") print('
') print(""" """)