diff --git a/.gitignore b/.gitignore index 5d8b4bee3..d7e9bb87d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ __pycache__/ # Virtual environment myenv /myenv + +/venv \ No newline at end of file diff --git a/src/apps/pages/programs/ApiPrograms/recipe_finder/.gitignore b/src/apps/pages/programs/ApiPrograms/recipe_finder/.gitignore new file mode 100644 index 000000000..34785bfa5 --- /dev/null +++ b/src/apps/pages/programs/ApiPrograms/recipe_finder/.gitignore @@ -0,0 +1,14 @@ +# Ignore Python cache files +__pycache__/ + +# Ignore .env file for API keys +.env + +# Ignore virtual environment +venv/ + +# Ignore log files +*.log + +# Ignore compiled files +*.pyc \ No newline at end of file diff --git a/src/apps/pages/programs/ApiPrograms/recipe_finder/recipe_finder.py b/src/apps/pages/programs/ApiPrograms/recipe_finder/recipe_finder.py new file mode 100644 index 000000000..1994e179f --- /dev/null +++ b/src/apps/pages/programs/ApiPrograms/recipe_finder/recipe_finder.py @@ -0,0 +1,137 @@ +import streamlit as st +import requests +import os +from dotenv import load_dotenv + +# Load environment variables from .env file +load_dotenv() + +# Function to fetch recipes +def fetch_recipes(query): + api_key = os.getenv('SPOONACULAR_API_KEY') # Retrieve API key from environment variable + api_url = f"https://api.spoonacular.com/recipes/complexSearch?query={query}&apiKey={api_key}" + response = requests.get(api_url) + return response.json() +# Streamlit UI + +# Add custom CSS +st.write( + """ + + """, + unsafe_allow_html=True, +) + +# Display the title with the custom class +st.markdown('