0% found this document useful (0 votes)
58 views14 pages

Python Weather App Micro-Project

Uploaded by

figma426
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views14 pages

Python Weather App Micro-Project

Uploaded by

figma426
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

DEVELOP A WEATHER APP

Under Course: PYTHON PROGRAMMING (314015)

SEMESTER: IV

Matoshri Aasarabai Polytechnic, Eklahare, Nashik

Academic Year: 2024-25


CERTIFICATE
This is to certify that following students of FOURTH SEMESTER Diploma
Engineering Program in Computer Department have successfully
completed the Micro-Project “DEVELOP A WEATHER APP.” Under My
Supervision, in the partial fulfillment of Course PYTHON PROGRAMMING
(314015) for Academic Year 2024-2025 as
per prescribed in the MSBTE “K-Scheme” curriculum.

Sr. Roll Enrollment No. Name of Candidates


No. No.
1. 22 23611810223 PRIYANKA DHUMSE
2. 28 23611810232 CHANCHAL LOHAR

Date: Place: Nashik

Subject Teacher Head of Department Principal

([Link]) (Mr.V. A. SONAWANE) ([Link])


Programme: Computer Engineering Semester:-Fourth

Course:- Python Programming Course Code :314015

Tittle of Micro Project: DEVELOP A WEATHER APP

SR_NO. CONTENT PAGE NO.


Part A

1.0 Brief Introduction

2.0 Aim of Micro Project

3.0 Action Plan

4.0 Resources Required


ACKNOWLEDGEMENT

With deep sense of gratitude we would like to thanks all


the people who have lit our path with their kind guidance.
We are very grateful to these intellectuals who did their
best to help during our project work. It is our proud
privilege to express deep sense of gratitude to,
[Link] Principal of Matoshri Aasarabai
Polytechnic, Eklahare, Nashik, for his comments and kind
permission to complete this Micro Project. We remain
indebted to Prof. [Link], Head of Computer
engineering department for his suggestion and valuable
guidance. The special gratitude goes to our internal guide
[Link], technical staff members, and non-
technical staff members, of Computer Tech. Department
for their expensive, excellent and precious guidance in
completion of this work.
Programme: Computer Engineering Semester:-Fourth

Name of faculty: [Link] Course Code : 314015

Tittle of Micro Project: DEVELOP A WEATHER APP

Sr. Roll Enrollment No. Name of Candidates Sign


No. No.
1. 22 23611810223 PRIYANKA DHUMSE

2. 28 23611810232 CHANCHAL LOHAR


Title of Micro-Project

DEVELOP A WEATHER APP

Description :

This microproject is a simple Weather App built using Python that


allows users to check real-time weather information for any city using
an API. It fetches data such as temperature, weather condition,
humidity, wind speed, and displays it in a user-friendly format through
a command-line interface or a graphical user interface (GUI) using
libraries like Tkinter.

Aim of Micro Project :

To develop a Python-based Weather App that retrieves and displays


real-time weather information for any city using a public API, helping
users stay informed about current weather conditions through a simple
interface.

Key Features :

 User inputs the city name

 Real-time weather data is fetched using OpenWeatherMap API (or similar)

 Displays:

 Current Temperature (in Celsius or Fahrenheit)


 Weather Description (e.g., Clear, Rain, Clouds)
 Humidity
 Wind Speed

 GUI version includes a search box and results panel


CODE :

import requests
import [Link] as plt

def get_weather(city_name, api_key):


base_url =
"[Link]
complete_url =
f"{base_url}q={city_name.strip()}&appid={api_key}&units=metri
c"

try:
response = [Link](complete_url)
data = [Link]()

if data["cod"] == 200:
main = data["main"]
weather = data["weather"][0]

temp = main['temp']
feels_like = main['feels_like']
humidity = main['humidity']
print(f"\nWeather in {city_name.title()}:")
print(f"Temperature: {temp}°C")
print(f"Feels Like: {feels_like}°C")
print(f"Humidity: {humidity}%")
print(f"Condition: {weather['description'].title()}")

# Pie chart data


labels = ['Temperature', 'Feels Like', 'Humidity']
values = [temp, feels_like, humidity]
colors = ['#FF9999', '#66B3FF', '#99FF99']

[Link](figsize=(6, 6))
[Link](values, labels=labels, autopct='%1.1f%%',
colors=colors, startangle=140)
[Link](f"Weather Info for {city_name.title()}")
[Link]('equal') # Equal aspect ratio ensures that pie is
drawn as a circle.
[Link]()

else:
print("Error from API:", data)
except Exception as e:
print("Error:", e)

api_key = "1705e48ef3f9798fb39b394e71a0a09f"

while True:
city = input("\nEnter city name (or type 'exit' to quit): ")
if [Link]() == 'exit':
print("Thanks for using the Weather App!")
break
get_weather(city, api_key)
OUTPUT :
Output-1
Output-2
CONCLUSION:

In conclusion, the Weather App microproject successfully demonstrates


how Python can be used to build real-time, data-driven applications by
integrating external APIs. Through this project, we were able to retrieve
and display current weather information such as temperature, humidity,
wind speed, and weather conditions for any user-specified city.

The project not only helped in understanding the basics of API


interaction and JSON data parsing, but also provided hands-on
experience in using Python libraries like requests and Tkinter. It served
as a practical implementation of key programming concepts and
improved skills in handling real-world data, error management, and user
interface design.

Overall, this microproject laid a strong foundation for building more


complex and interactive Python applications in the future, and
highlighted the importance of integrating third-party services to enrich
user experience.
ANNEXURE – II

Programme: Computer Engineering Semester:-Fourth

Name of faculty: [Link] Course Code : 314015

Outcomes of the Weather App:


1. Understanding of API Integration
2. Improved Python Programming Skills
3. Project Documentation & Presentation
4. Practical Use of JSON Handling
5. Increased Problem-Solving and Debugging Skills

Sr. Roll Enrollment No. Name of Candidates Sign


No. No.
1. 22 23611810223 PRIYANKA DHUMSE

2. 28 23611810232 CHANCHAL LOHAR


THANK YOU!

Common questions

Powered by AI

JSON data is utilized in the Weather App to parse API responses containing weather information. It is crucial for processing API responses because JSON is a lightweight format for data exchange, making it ideal for transmitting data between a server and a client. The app extracts pertinent weather details such as temperature, humidity, and conditions from JSON to display to the user .

The Weather App uses APIs to fetch real-time data by sending requests to the OpenWeatherMap API with specified city names and API keys, which returns JSON data containing weather information. Challenges that might arise include handling errors from API responses, managing network connectivity issues, and parsing JSON data correctly to display information such as temperature and humidity .

In the implementation of the Weather App, the Python library 'requests' is used to send HTTP requests to the weather API and retrieve data. 'Tkinter' is used to create a user-friendly graphical user interface for the app, allowing users to input city names and view results .

Micro-projects like the Weather App enrich a computer engineering student's practical skills by providing hands-on experience in applying theoretical knowledge to real-world problems. They foster critical thinking, problem-solving, and debugging skills, while also improving understanding of programming languages, API integration, and interface design. Such projects bridge the gap between classroom learning and industry expectations .

Error handling is crucial in API-based applications to ensure robust performance and a seamless user experience even when unexpected conditions occur, such as network issues or invalid input. Effective methods include checking API response codes, implementing try-except blocks to catch exceptions, and providing user-friendly error messages to explain issues and potential next steps .

The educational objectives achieved through the development of the Weather App include understanding API integration, improving Python programming skills, learning project documentation and presentation, practical use of JSON handling, and increasing problem-solving and debugging skills .

The Weather App project illustrates the importance of third-party services by showing how external APIs can enrich applications with dynamic and real-time data, which the app alone could not generate. This integration enhances functionality and user experience, allowing developers to leverage existing resources to build robust applications without having to create every feature in-house .

Command-line interfaces (CLI) offer simplicity and lightweight performance, which might be preferred by advanced users or developers who prioritize speed over aesthetics. Graphical user interfaces (GUI), however, provide an intuitive and visually engaging way to interact with the app, making it accessible to a broader audience, including non-technical users. This can enhance user experience but may require more computational resources .

The conclusions drawn from the Weather App project highlighted Python's capabilities for developing real-time, data-driven applications by integrating APIs. It also demonstrated the importance of practical skills in API interaction and JSON data parsing, improving the understanding of key programming concepts and the integration of third-party services for enhanced user experience .

The primary aim of the Weather App micro-project was to develop a Python-based application that retrieves and displays real-time weather information for any city using a public API, helping users stay informed about current weather conditions. It contributes to the curriculum by providing practical experience in programming, API integration, and real-time data processing .

You might also like