File size: 628 Bytes
5266631
ca13361
80d7df8
4c20be7
f3f69dd
80d7df8
f3f69dd
 
 
80d7df8
 
 
 
56dbafa
 
 
80d7df8
adf8edf
80d7df8
56dbafa
 
 
 
f3f69dd
80d7df8
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import streamlit as st
import json
import os

st.title("Saved Recipes")

# get all saved files
directory_path = '/data/'
saved_files = []
for root, dirs, files in os.walk(directory_path):
    for file in files:
        if file.endswith('.json'):
            full_path = os.path.join(root, file)
            f = open(full_path)
            recipe_json = json.load(f)
            saved_files.append(recipe_json)

st.json(saved_files)

for recipe in saved_files: 
    with st.expander(recipe['name']):
        st.markdown(recipe['md'])
        

# f = open('/data/test_output.json')
# json_test = json.load(f)

# st.json(json_test)