This Python application fetches and displays real-time weather data using the OpenWeather API and stores it in AWS S3. Let's explore its features, setup, and potential improvements.
Key Features:
Prerequisites:
requirements.txt
).Project Structure:
The project is organized clearly:
<code>Open-Weather-API-Project/ ├── src/ │ ├── __init__.py │ └── weather_dashboard.py ├── .gitignore ├── README.md └── requirements.txt</code>
Setup and Execution:
Clone the Repository: Use Git to clone the project: git clone https://github.com/ameh0429/Open-Weather-API-Project.git
and navigate to the project directory: cd Open-Weather-API-Project
.
Install Dependencies: Install required Python packages using pip: pip install -r requirements.txt
. Note that you might need to resolve dependency conflicts; the instructions mention upgrading requests
to requests>=2.31
if needed.
Configure Environment Variables: Create a .env
file (if one doesn't exist) and add your OpenWeather API key and AWS bucket name:
<code>OPENWEATHER_API_KEY=your_api_key AWS_BUCKET_NAME=your_bucket_name</code>
Configure AWS Credentials: Configure your AWS credentials using the AWS CLI: aws configure
.
Run the Application: Execute the main script: python src/weather_dashboard.py
.
Verify S3 Data: Check your designated S3 bucket to confirm that the weather data has been successfully uploaded.
Architecture Diagram:
Screenshots:
The provided screenshots illustrate various stages of the setup process, including dependency installation, environment variable configuration, AWS credential setup, the Python script, and the successful upload of data to S3.
Future Enhancements:
This detailed explanation provides a comprehensive overview of the project, making it easier for users to understand and implement it.
The above is the detailed content of Building a Weather Dashboard using SPython and OpenWeather API. For more information, please follow other related articles on the PHP Chinese website!