Author: crissmath
This project is a Streamlit web application that connects to NASAโs Astronomy Picture of the Day (APOD) API to display breathtaking daily imagery of our universe, accompanied by scientific explanations written by astronomers.
Users can:
- ๐ Select any date to retrieve the image or video of that day.
- ๐ฅ Download the full-resolution image if available.
- ๐ฅ Watch the video if the content is not an image.
- ๐ง Read the corresponding explanation with metadata.
- Python 3.10+
- Streamlit for UI and layout
- Requests for handling HTTP requests
- NASA APOD API for fetching astronomy data
- Pillow (optional) for advanced image handling
- The user selects a date from a calendar input.
- The app fetches data using the NASA APOD API (API key required).
- If the media is an image:
- It is displayed in a centered layout.
- A download button is offered.
- If the media is a video:
- It is embedded via Streamlitโs
st.video().
- It is embedded via Streamlitโs
- Additional metadata such as title, copyright, and explanation are shown.
- Python installed locally
- A valid NASA API Key (Free โ get it here)
# Clone this repository
git clone https://github.com/yourusername/apod-streamlit.git
cd apod-streamlit
# (Optional) Create virtual environment
python -m venv myenv
source myenv/bin/activate # On Windows: myenv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the app
streamlit run main.py