This project aims to create a tool for fetching images from NASA's API and embedding them onto a template image along with relevant text. It consists of one script, apod-maker.py
, which generate a .jpg file with a date as argument.
- Fetches data from NASA API including image URL, title and a QR code of the page of the new.
- Downloads the image from the provided URL.
- Embeds the fetched image onto a template image.
- Adds text overlay containing title, date, and a generated qrcode of the news.
- Saves the processed image as a JPEG file.
This script fetches data from NASA's API, downloads the image, pastes it onto a template image, adds relevant text, the date passed as argument and a generated QR code, and saves the final image.
- Python 3
- Pillow library (for image processing)
- Requests library (for making HTTP requests)
- Python-dotenv library (for loading environment variables)
- Python-qrcode library (for qrcode generation) (check requirement.txt)
- Clone the repository.
- Install dependencies using
pip install -r requirements.txt
. - Configure environment variables:
API_KEY
: NASA API keyDATE
: Date for fetching NASA image of the dayAPI_URL
: NASA API endpoint URL
- Execute
paste-image-to-template.py
to process and embed NASA images onto a template. - Execute
api.py
to fetch data from NASA's API and store it locally.
This project is licensed under the MIT License.