fadzwan's picture
Update app.py
63fd708 verified
raw
history blame contribute delete
720 Bytes
import streamlit as st
import json
# Load the data from the JSON file
with open('data.json', 'r') as f:
data = json.load(f)
def display_brand_info(parent_company):
brand_info = ''
for brand_id, brand in data['brands'].items():
if parent_company.lower() in brand['description'].lower():
brand_info += f"# {brand['name']}\n{brand['description']}\n---\n"
return brand_info
def main():
st.set_page_config(page_title="Brand Information")
st.title("Brand Information")
parent_company = st.text_input("Enter Parent Company")
if parent_company:
brand_info = display_brand_info(parent_company)
st.markdown(brand_info)
if __name__ == "__main__":
main()