Spaces:
Runtime error
Runtime error
import requests | |
import pandas as pd | |
import streamlit as st | |
import base64 | |
import functions as f | |
st.title("App Store Search") | |
# User input | |
search_terms = st.text_input("Enter keyword(s) or phrase(s) to search for apps (comma-separated):") | |
cc, sl = st.columns((5,2)) | |
with cc: | |
country_codes = st.text_input("Enter one or more two-letter country code (e.g., 'GB' for the UK):", "GB") | |
with sl: | |
search_limit = st.number_input("Number of results per keyword:\n\n", min_value=1, max_value=1000, value=100, step=50) | |
if st.button("Search"): | |
if search_terms and country_codes: | |
app_data = f.init_search(search_terms, country_codes, limit=search_limit) | |
st.write(app_data) | |
# Add download button | |
st.download_button( | |
label="Download CSV File", | |
data=f.to_csv(app_data), | |
file_name="app_data.csv", | |
mime="text/csv", | |
) | |
else: | |
st.warning("Please enter both search term(s) and country code.") | |