DEV Community

ranms25
ranms25

Posted on

OSDC-2023-weather-app

Quick review of the lecture at the course OSDC

This week
During the session, we discussed project selection for contributions and focused on Docker Compose. We learned Docker commands and how to use them. Docker Compose simplifies managing multi-container applications, and @szabgab also demonstrated how hands-on using it. We briefly touched on cloud providers like Linode and Digital Ocean.

Assignment

Our task this time was to create an open-source project

Python-Weather-App project

I really like weather, so I thought it would be nice to develop a nice little app that would bring me real-time weather data for various places in the world

Here's a summary of the steps I have taken:

Certainly! Here's an improved summary of the steps you've taken for your Python Weather App project:

  1. I created a GitHub repository named Python-Weather-App to host my weather application project.

  2. I installed the necessary packages that you can see in the requirements.txt file I created.

  3. I obtained an API key from OpenWeatherMap by visiting their website and creating an account. This API key is necessary to make API requests and retrieve weather data.

  4. I designed a command-line user interface for the weather app, allowing users to input a location for which they want to fetch weather information.

  5. I implemented the core functionality of the app in the weather_app.py file. This involved making API requests to OpenWeatherMap using the requests library, parsing the JSON response to extract relevant weather information (such as temperature, humidity, weather conditions, wind speed, rainfall, and snowfall), and displaying the information to the user.

  6. I utilized the dotenv library and created a .env file where the API key can be stored. This file is included in the repository and users are instructed to add their own API key to the file.

  7. I added error handling to the app to gracefully handle situations such as invalid locations or issues with the API request. When errors occur, appropriate error messages are displayed to the user.

  8. The project's README file provides clear instructions for users on how to install the necessary dependencies, add their API key to the .env file, and run the weather app. Additionally, the README file includes instructions on running tests for the weather application using pytest.

  9. The repository is published on GitHub, allowing others to view and contribute to the project.

It was quite challenging and took a long time. In spite of that, it was good to see the course material come together in a practical way.

Stay tuned!

Top comments (0)