Most Recent Project:
The Weather Dashboard demonstrates:
API Integration: Real-time weather data retrieval using the OpenWeather API.
Cloud Storage: Secure storage of weather data in AWS S3 buckets.
Environment Management: Configurable with environment variables for sensitive information like API keys and bucket names.
DevOps Principles: Simplified deployment and cloud integration.
Real-Time Weather Data: Fetches up-to-date weather information for multiple cities.
Detailed Insights: Displays temperature (°F), humidity levels, and current weather conditions.
Cloud Storage Integration: Automatically saves weather data to AWS S3 buckets for secure storage.
Bucket Name Randomization: Attaches a unique tag to the base bucket name.
Multi-City Monitoring: Tracks weather conditions for various cities simultaneously.
Language: Python 3.x
Cloud Provider: AWS (S3)
External API: OpenWeather API
boto3: AWS SDK for Python.
python-dotenv: For managing environment variables.
requests: Simplified HTTP requests for API integration.
weather-dashboard/
├── src/
│ ├── __init__.py
│ └── weather_dashboard.py
├── tests/
├── data/
├── .env
├── .gitignore
├── requirements.txt
bash
code
git clone <repository-url>
cd weather-dashboard
Alternatively, manually recreate the structure listed above for learning purposes.
bash
code
python3 -m venv env
source env/bin/activate # Activate the environment
Note: This step may not be needed if using GitHub tools/terminal.
bash
code
pip install -r requirements.txt
Create a .env file in the root directory with the following content:
plaintext
code
OPENWEATHER_API_KEY=your_openweather_api_key
AWS_BUCKET_NAME_BASE=your_s3_bucket_name
AWS_ACCESS_KEY_ID=your_aws_access_key_id
AWS_SECRET_ACCESS_KEY=your_aws_secret_access_key
Tip: Use the AWS Toolkit extension for easier connectivity. Keep sensitive data secure after completing the project.
Set up AWS CLI credentials:
bash
code
aws configure
Provide:
Access Key ID
Secret Access Key
Default Region (e.g., us-east-1)
Execute the script to fetch and save weather data:
bash
code
python src/weather_dashboard.py
Bucket Name Issues: Ensure the bucket name in .env is valid and unique.
AWS Credentials Error: Verify that AWS CLI is properly configured with sufficient permissions.
OpenWeather API Key Error: Ensure the API key is active and correctly entered in .env.
Missing Dependencies: Install required libraries using pip install -r requirements.txt.
Permission Errors: Make the script executable:
bash
code
chmod +x src/weather_dashboard.py
S3 Access Issues: Ensure the AWS user/role has S3 permissions.
CloudFormation Access Error: Use the following inline policy to resolve:
json
code
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "cloudformation:ListStacks",
"Resource": "*"
}
]
}
This project is part of a 30-day DevOps challenge aimed at mastering:
Python Scripting: Efficiently handle and process data.
Cloud Integration: Work with AWS services like S3.
API Consumption: Fetch and manage data from external APIs.
Error Handling and Debugging: Identify and resolve issues efficiently.
Contact button below.