import flask import pbc_client import dataclasses import requests_cache HTML_INDEX = """ Hello from Flask
{% for notamon in notamons %}

{{ notamon.nickname }}

{{ notamon.species_name }}

{% endfor %}
""" @dataclasses.dataclass(frozen=True) class Notamon: image_src: str effect_css: str nickname: str species_name: str app = flask.Flask(__name__) TEST_NOTAMON = Notamon( image_src = 'https://img.pokemondb.net/sprites/ruby-sapphire/normal/mudkip.png', effect_css = '', nickname = 'Dude', species_name = 'Mudkip', ) ADDRESS_NFTS = '' ADDRESS_ASSETS = '' SESSION = requests_cache.CachedSession() def determine_notamons(): client = pbc_client.PbcClient(SESSION, pbc_client.HOSTNAME_TESTNET) asset_contract_state = client.get_contract_state(ADDRESS_ASSETS) return [TEST_NOTAMON for i in range(100)] @app.route("/") def hello_world(): return flask.render_template_string(HTML_INDEX, notamons = determine_notamons())