0% found this document useful (0 votes)
10 views13 pages

PROJECT

Uploaded by

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

PROJECT

Uploaded by

rohith.jpg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

COURSE END PROJECT

GET LIVE WEATHER DESKTOP NOTIFICATIONS


PYTHON PROGRAMING LABORATORY (A8508)

BACHELOR OF TECHNOLOGY

IN

COMPUTER SCIENCE AND ENGINEERING

SUBMITTED BY

23881A6787 D.ANJALI
23881A6788 G.ROHITH KUMAR

UNDER THE GUIDANCE OF


DR S Venu Gopal
Associate Professor

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


VARDHAMAN COLLEGE OF ENGINEERING
(AUTONOMOUS)
Affiliated to JNTUH, Approved by AICTE, Accredited by NAAC with A++ Grade,
UGC “College with Potential for Excellence” and ISO 9001:2015 Certified
Shamshabad – 501 218, Hyderabad

JUNE-2024
VARDHAMAN COLLEGE OF ENGINEERING
(AUTONOMOUS)
Affiliated to JNTUH, Approved by AICTE, Accredited by NAAC with A++ Grade,
UGC “College with Potential for Excellence” and ISO 9001:2015 Certified

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


Course End Project
Python Programing Laboratory (A8508)
Check List
Status
S. No. Content
( / ×)
1 Abstract

2 Objectives

3 Problem Statement

4 Algorithm

5 Flow Chart

6 Source Code

7 Input

8 Output

9 Conclusion

10 Future Scope

11 References

Signature of the Guide


Dr S Venu Gopal
Associate Professor
Dept. of CSE
Course End Project
Python Programing Laboratory (A8508)
Table of Content
S. No. Content Page. No.
1 Abstract 01

2 Objectives 02-03

3 Problem Statement 02

4 Algorithm 04

5 Flow Chart 05

6 Source Code 06

7 Input 07

8 Output 07

9 Conclusion 07

10 Future Scope 08-09

11 References 10
1. ABSTRACT

Weather forecasting is the application of science and technology to predict


the conditions of the atmosphere for a given location and time. People have
attempted to predict the weather informally for millennia and formally since
the 19th century. Weather forecasts are made by collecting quantitative data
about the current state of the atmosphere, land, and ocean and using
meteorology to project how the atmosphere will change at a given place.
Once calculated manually based mainly upon changes in barometric
pressure, current weather conditions, and sky condition or cloud cover,
weather forecasting now relies on computer-based models that take many
atmospheric factors into account.[1] Human input is still required to pick the
best possible forecast model to base the forecast upon, which involves
pattern recognition skills, teleconnections, knowledge of model
performance, and knowledge of model biases. The inaccuracy of forecasting
is due to the chaotic nature of the atmosphere, the massive computational
power required to solve the equations that describe the atmosphere, the
land, and the ocean, the error involved in measuring the initial conditions,
and an incomplete understanding of atmospheric and related processes.
Hence, forecasts become less accurate as the difference between current
time and the time for which the forecast is being made (the range of the
forecast) increases.

Models are initialized using this observed data. The irregularly spaced
observations are processed by data assimilation and objective analysis
methods, which perform quality control and obtain values at locations usable
by the model's mathematical algorithms (usually an evenly spaced grid). The
data are then used in the model as the starting point for a forecast.[48]
Commonly, the set of equations used to predict the physics and dynamics of
the atmosphere are called primitive equations. These equations are
1
initialized from the analysis data and rates of change are determined. The
rates of change predict the state of the atmosphere a short time into the
future. The equations are then applied to this new atmospheric state to find
new rates of change, and these new rates of change predict the atmosphere
at a yet further time into the future. This time stepping procedure is
continually repeated until the solution reaches the desired forecast time.

2. PROBLEM STATEMENT

Weather conditions can significantly impact daily activities and planning.


Having timely and accurate weather information can help individuals make
informed decisions about their day. A system that provides real-time
weather updates as desktop notifications can be highly beneficial for users
who want to stay informed about current and upcoming weather conditions
without having to constantly check weather websites or apps.

3. OBJECTIVES
Develop a Python application that fetches real-time weather data from a
reliable weather API and delivers desktop notifications to the user. The
application should run in the background and periodically update the user
with the latest weather information for a specified location.

2
Objectice-1:To develop a Python based solution to get weather desktop
notification.

Objective-2:To automate the process.

Objective-3:To save time and reduce errors.

3
4. ALGORITHM
1.Extract data form given URL.

2.Scrape the data with the help of requests and Beautiful Soup.

3.Convert that data into html code.

4.Find the required details and filter them.

5.Save the result in the String.

6.Pass the result in Notification object.

4
5. FLOW CHART

5
6. SOURCE CODE
import requests
from plyer import notification
import time

# Configuration
API_KEY = 'your_openweathermap_api_key' # Replace with your OpenWeatherMap API
key
CITY = 'your_city' # Replace with your city
URL =
f"http://api.openweathermap.org/data/2.5/weather?q={CITY}&appid={API_KEY}&units=me
tric"

def get_weather():
response = requests.get(URL)
if response.status_code == 200:
data = response.json()
weather = data['weather'][0]['description']
temperature = data['main']['temp']
return f"Weather: {weather}\nTemperature: {temperature}°C"
else:
return "Error fetching weather data"

def show_notification(message):
notification.notify(
title='Weather Update',
message=message,
timeout=10
)

def main():
while True:
weather_info = get_weather()
show_notification(weather_info)
time.sleep(3600) # Wait for an hour before the next update

if _name_ == "_main_":
main()
7.
8. # Output: Display the average
print("The average of the three numbers is:", average)

6
7. INPUT
API_KEY = 'your_openweathermap_api_key' # Replace with your OpenWeatherMap API
key
CITY = 'your_city' # Replace with your city

8. OUPUT
Weather Update

Weather: clear sky

Temperature: 25°C

9. CONCLUSION
This project served as an excellent opportunity to apply Python programming
skills in a real-world context. By combining Python's versatility with third-
party libraries, it was possible to create a useful tool for staying updated on
weather conditions directly from the desktop. Further enhancements could
include adding support for multiple cities, customizing notification styles, and
integrating with additional weather APIs for expanded coverage.

10. FUTURE SCOPE


responses for debugging and analytics. Expanding this weather notification
script can lead to numerous enhancements and additional features. Here are
some future scope ideas:

Graphical User Interface (GUI):

7
Create a user-friendly GUI using libraries like tkinter, PyQt, or Kivy to allow
users to enter their city and API key directly into the application.

Multiple Cities:

Allow users to enter and monitor weather for multiple cities, displaying
notifications for each one.

Advanced Notifications:

Customize notifications to show more detailed weather information, such as


humidity, wind speed, or a weather icon.

Add alerts for severe weather conditions like storms, heavy rain, or extreme
temperatures.

User Preferences:

Allow users to set preferences such as notification frequency (e.g., every 30


minutes, 2 hours), temperature units (Celsius or Fahrenheit), and the type of
weather information displayed.

Historical Data and Forecast:

Incorporate weather forecasts for the upcoming days.

Show historical weather data and trends over time.

Integration with Other Services:


8
Integrate with calendar applications to provide weather updates for planned
events.

Sync with smart home devices to adjust settings based on weather conditions
(e.g., thermostat adjustments).

Voice Assistance:

Implement voice notifications using text-to-speech libraries like pyttsx3.

Integrate with voice assistants like Amazon Alexa or Google Assistant.

Mobile App:

Develop a mobile application counterpart using frameworks like Kivy or


BeeWare to provide notifications on mobile devices.

Customization and Themes:

Allow users to customize the appearance of notifications with different


themes or styles.

Error Handling and Logging:

Improve error handling to manage network issues, API errors, and invalid city
inputs.

9
Add logging to keep track of weather data requests and responses for
debugging and analytics.

11.REFERENCES
References: https://www.geeksforgeeks.org/get-live-weather-desktop-notifications-using-python/
https://www.studocu.com/in/document/chandigarh-university/master-of-computer-applications/synopsis-
live-desktop-notification/55132586

10

You might also like