packages = ["bokeh"]

getting python code and py fetching remote AWS S3 json data...

below is working using old pyscript get json from s3 - bokeh

getting python code and py fetching remote AWS S3 json data...

from bokeh.plotting import column, figure, show from bokeh.embed import json_item from bokeh.resources import CDN from bokeh.layouts import column from js import Bokeh, console, JSON import pyodide, json from pyodide.http import pyfetch import asyncio async def get_data(): response = await pyfetch('https://rickd.s3.us-east-2.amazonaws.com/04.json') data = await response.json() xAxis=[i['time'] for i in data] #grab s3 data using loop yAxis=[i['Quantity'] for i in data] #grab s3 data using loop p = figure(x_range=(0, 10), y_range=(0, 10), width = 700, height = 600) p.line(xAxis, yAxis, legend_label="data from S3", line_width=2) #pull in s3 data into plot #display in pyscript p_json = json.dumps(json_item(p, "chart")) Bokeh.embed.embed_item(JSON.parse(p_json)) get_data() #await get_data() #run above function #asyncio.run(get_data()) #await get_data()