Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

python

The document is a micro-project report prepared by Abhishek Ramesh Kolape for the course 'Programming with Python' at Shreeyash College of Engineering and Technology, focusing on weather forecasting. It outlines the project's aims, technology stack, functional and non-functional requirements, coding steps, and includes a detailed action plan and resource requirements. The project aims to utilize Python and APIs to accurately predict weather conditions and enhance understanding of programming concepts.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

python

The document is a micro-project report prepared by Abhishek Ramesh Kolape for the course 'Programming with Python' at Shreeyash College of Engineering and Technology, focusing on weather forecasting. It outlines the project's aims, technology stack, functional and non-functional requirements, coding steps, and includes a detailed action plan and resource requirements. The project aims to utilize Python and APIs to accurately predict weather conditions and enhance understanding of programming concepts.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

SHREEYASH PRATISHTHAN’S

SHREEYASH COLLEGE OF ENGINEERING AND TECHNOLOGY


(POLYTECHNIC), CHH. SAMBHAJINAGAR

MICRO-PROJECT REPORT

NAME OF DEPARTMENT:-COMPUTER ENGINEERING


ACADEMIC YEAR: - 2024-25
SEMESTER:-SIXTH
COURSE NAME: PROGRAMING WITH PYTONS
COURSE CODE:-22616
MICRO-PROJECT TITLE: - WEATHER FORECASTING
PREPARED BY:-
1) Abhishek Ramesh Kolape EN.NO:2210920128

UNDER THE GUIDANCE OF: - Prof. P.P.ANGADI


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION,
MUMBAI
CERTIFICATE
This is to certify that Mr. Abhishek Ramesh Kolape of SIXTH Semester of Diploma in COMPUTER
ENGINEERING of Institute SHREEYASH COLLEGE OF ENGINEERING AND TECHNOLOGY has
successfully completed Micro-Project Work in Course of - PROGRAMMING WITH PYTHONfor the
academic year 2024-25 as prescribed in the I-Scheme Curriculum.

Date:- /04/2025 Enrollment No:-2210920128n


Place:-CHH.SAMBHAJINAGAR Exam Seat No.:-

Signature Signature Signature


Guide HOD Principal

Prof. P.P.ANGADI Prof. A.C.NAIK Prof.S.S.KHANDAGALE


ACKNOWLEDGEMENT

We wish to express our professor gratitude to our guide Prof.P.P ANGADI who guided us
endlessly in framing and completion of Micro-Project. He guided us on all the main points in
that Micro-Project. We are indebted to his constant encouragement, cooperation and help. It
was his enthusiastic support that helped us in overcoming of various obstacles in the Micro-
Project.
We are also thankful to our Principal, HOD, Faculty Members and classmates for extending
their support and motivation in the completion of this Micro-Project.

1) Abhishek Ramesh Kolape EN.NO:2210920128


Micro-Project Proposal

Title of Micro-Project: - WHEATHER FORECAST

Aims/Benefits of the Micro-Project:-

• Understanding of Basic Concepts:

1) Domain knowledge about programming


2) Easy to manage
3) Wheather forecasting
Course Outcomes Addressed

❖INTRODUCTION

Weather forecasting is the scientific process of predicting atmospheric conditions at a


given location over a specific period. Accurate weather forecasts are critical for
various sectors, such as agriculture, transportation, disaster management, and energy
production. Traditionally, weather forecasting relied on complex mathematical models
and real-time data from weather stations. However, with advancements in technology,
the rise of data science, and the accessibility of weather data through APIs and
datasets, Python has become an essential tool for developing weather forecasting
systems.

In this Weather Forecasting in Python project, the goal is to utilize Python’s robust
libraries and machine learning techniques to predict weather conditions such as
temperature, humidity, precipitation, and wind speed. By integrating real-time weather
data from APIs (such as OpenWeatherMap or WeatherStack) and utilizing statistical
and machine learning models, this project will demonstrate how Python can be used
for building reliable weather forecasting applications.
❖ TECHNOLOGY STACK
1. Programming Language:

• Python: Python is chosen because it's beginner-friendly, has a rich set of


libraries, and is well-suited for handling HTTP requests, JSON data, and
simple user interfaces.

2. Libraries/Modules:

• requests:
o Used for sending HTTP requests to the weather API to fetch data (e.g.,
current weather, temperature, humidity, etc.).
o Makes it easy to interact with APIs and retrieve information in JSON
format.
o Example usage:

import requests
response = requests.get('API_URL')
data = response.json()

json:

• Python's built-in library to parse and manipulate JSON data returned from the
API.
• JSON is a common data format used by most weather APIs to send the data.

tkinter (optional for GUI):

• A built-in Python library to create graphical user interfaces (GUI).


• If you want to make the weather tool more interactive, Tkinter allows you to
create input fields, buttons, and display panels.
• Example usage:

import tkinter as tk
root = tk.Tk()
label = tk.Label(root, text="Enter city:")
label.pack()
root.mainloop()
3. Weather API:

• OpenWeatherMap API (or any weather API):


o Provides real-time weather data for any city around the world.
o APIs offer free access with limitations and allow fetching details like
temperature, humidity, wind speed, and forecasts.
o Requires an API key which you get after registering on the provider's
website.
o Example of API URL:

http://api.openweathermap.org/data/2.5/weather?q={city}&appid={API_KEY}&unit
s=metric

4. JSON Data Parsing:

• JSON:
o Weather data is returned as a JSON object. Using Python's built-in json
library, you can parse this data and extract specific fields such as
temperature, weather condition, humidity, etc.
o Example:

weather = data['weather'][0]['description']
temperature = data['main']['temp']
❖ FUNCTIONAL REQUREMENT

1. User Input:
o The application should allow the user to input the name of the city for
which they want to fetch the weather forecast.
o Input should be case-insensitive (e.g., "London" or "london" should both
work).
2. Weather Data Fetching:
o The program should fetch real-time weather data from a public weather
API (e.g., OpenWeatherMap).
o The data should include details like:
▪ Current temperature (in Celsius or Fahrenheit).
▪ Weather condition (e.g., clear, cloudy, rainy).
▪ Humidity (percentage).
▪ Wind speed (m/s).
▪ Pressure (optional).
3. Display Weather Information:
o The application should display the fetched weather details clearly to the
user.
o This can be done via the console or a graphical interface (GUI) using
tkinter.
4. Error Handling:
o The application should handle errors gracefully:
▪ City not found: If the user inputs an invalid or non-existent city,
display an error message.
▪ API failure: If the API fails or there is no internet connection,
inform the user.
▪ Invalid Input: Handle invalid input (e.g., empty or incorrect city
name).
5. Output Formatting:
o The output should be formatted for readability (e.g., "Temperature:
25°C", "Weather: Clear").
o Display relevant information based on what the API returns.
6. Multi-day Forecast:
o You can add functionality to show the weather forecast for the next few
days (e.g., a 5-day forecast).
o This would involve parsing the forecast data from the API and displaying
it in a structured way.
❖ NON FUNCTIONAL REQUIREMENT

1. Performance:
o The application should fetch and display the weather data quickly
(typically within a few seconds).
o Efficient use of the API to minimize delays when making requests and
processing responses.
2. Usability:
o The tool should be easy to use, with a simple input prompt (for console
version) or a user-friendly GUI (for GUI version).
o The output should be clear, well-organized, and easily understandable by
non-technical users.
3. Reliability:
o The application should handle potential failures (e.g., API downtime, no
internet connection) gracefully, without crashing.
o It should provide clear error messages and instructions to the user if
something goes wrong.
4. Scalability:
o While this is a small project, it should be designed in a way that allows
for easy updates (e.g., adding multi-day forecasts or more detailed
weather data) in the future.
5. Maintainability:
o The code should be well-structured and modular, with clear comments
and documentation, making it easy to maintain and extend.
o Use of functions to separate different tasks (e.g., fetching data, processing
data, displaying results) will make it easier to modify or expand.
6. Compatibility:
o The application should be compatible with different operating systems
(e.g., Windows, macOS, Linux) for the console version.
o If a GUI is implemented using tkinter, it should work across common
platforms without issues.
7. Security:
o The application should securely handle API keys (if used), either by
storing them in a configuration file or environment variables, and avoid
hardcoding sensitive information in the code.
8. Availability:
o The application should be available for use at any time, as long as the
API service is functioning and the user has an internet connection.
❖CODING

Steps to Follow:

1. Get an API Key from OpenWeatherMap.


2. Install the required libraries: requests.

pip install requests

Code for the Weather Forecasting Project:

import requests

# Function to get weather details from OpenWeatherMap API


def get_weather(city, api_key):
# Base URL of the OpenWeatherMap API
base_url = "http://api.openweathermap.org/data/2.5/weather?"

# Complete URL with city name and API key


complete_url = f"{base_url}q={city}&appid={api_key}&units=metric"

# Sending a GET request to the API


response = requests.get(complete_url)

# Converting the response to JSON format


data = response.json()

# Check if the city is found or not


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

# Extracting weather details


temperature = main["temp"]
humidity = main["humidity"]
pressure = main["pressure"]
description = weather["description"]
wind_speed = wind["speed"]

# Display the weather details


print(f"Weather in {city.capitalize()}:")
print(f"Temperature: {temperature}°C")
print(f"Weather condition: {description.capitalize()}")
print(f"Humidity: {humidity}%")
print(f"Pressure: {pressure} hPa")
print(f"Wind Speed: {wind_speed} m/s")
else:
print("City not found, please try again.")

# Main function to take user input and call the weather function
def main():
# Get the API key (you need to sign up and get a free API key from OpenWeatherMap)
api_key = "YOUR_API_KEY" # Replace with your actual API key from OpenWeatherMap

# Taking city input from the user


city_name = input("Enter the city name: ")

# Call the function to fetch and display weather information


get_weather(city_name, api_key)

# Entry point of the program


if __name__ == "__main__":
main()

Steps to Run the Code:

1. Obtain API Key:


o Sign up on OpenWeatherMap and get your free API key.
2. Replace YOUR_API_KEY:
o Replace YOUR_API_KEY in the code with your actual API key from
OpenWeatherMap.
3. Run the Program:
o Save the code in a .py file (e.g., weather_forecast.py).
o Open a terminal and run the script:

python weather_forecast.py

Enter the name of the city when prompted, and it will show the weather information.
❖OUTPUT

Enter the city name: London


Weather in London:
Temperature: 15.5°C
Weather condition: Clear sky
Humidity: 60%
Pressure: 1012 hPa
Wind Speed: 4.1 m/s
❖CONCLUSION

In conclusion, weather forecasting has become an essential tool in modern society,


allowing us to predict and prepare for various atmospheric conditions. Through
advancements in technology, such as satellites, radar, and sophisticated computer
models, meteorologists can provide more accurate and timely forecasts than ever
before. These forecasts play a crucial role in many sectors, including agriculture,
transportation, disaster management, and public safety. However, despite significant
progress, challenges remain due to the inherent complexity and variability of the
Earth's atmosphere. Ongoing research and innovation in weather prediction methods
will continue to enhance the precision and reliability of forecasts, benefiting
communities worldwide.
❖REFERENCE
www.google.com
www.w3school.com
www.greektogreek.com
www.github.com
www.python.com
1.2 Action Plan
Name of
Sr. Planned Planned Respons
Details of activity
No. Week Start Finish date ible
date Team
Membe
rs
1 1 &2 Discussion & Finalization of 3/1/25 3/1/25 Abhishek
Topic
2 3 Preparation of the Abstract 5/1/25 5/1/25 Abhishek
3 4 Literature Review 13/1/25 13/1/25 Abhishek
4 5 Submission of Microproject 29/1/25 29/1/25 Abhishek
Proposal ( Annexure-I)
5 6 Collection of information about 3/2/25 3/2/25 Abhishek
Topic
6 7 Collection of relevant content / 7/2/25 7/2/25 Abhishek
materials for the execution of
Microproject.
7 8 Discussion and submission of 18/2/25 18/2/25 Abhishek
outline of the Microproject.
8 9 Analysis / execution of 25/2/25 25/2/25 Abhishek
Collected data / information and
preparation of Prototypes /
drawings / photos / charts /
graphs / tables / circuits / Models
/ programs etc.
9 10 Completion of Contents of 25/2/25 25/2/25 Abhishek
Project Report
10 11 Completion of Weekly progress 16/3/25 16/3/25 Abhishek
Report
11 12 Completion of Project Report ( 29/3/25 29/3/25 Abhishek
Annexure-II)
12 13 Viva voce / Delivery of 10/4/25 10/4/25 Abhishek
Presentation

1.0 Resources Required

Sr. Name of Resources / Materials Specification Qty Remarks


No.
1 COMPUTER SYSTEM I5 INTEL 1
CORE
2 COMPILER VS CODE. 1

3 WINDOWS OPERATING SYSTEM WIN 11 1

Names of Team Members with En.


1. Abhishek Ramesh Kolape EN.NO:2210920128
MICRO-PROJECT EVOLUTION SHEET

NAME OF STUDENT :- Abhishek Ramesh Kolape EN.NO.:- 2210920128


Name of Program: PROGRAMMING IN PYTHON

Course Name:-COMPUTER ENGINEERING Course Code:-22616


Title of The Micro-Project:- WEATHER FORECASTING

COURSE OUTCOMES ACHIEVED:


1) DOMAIN KNOWLEDGE
2) TECHNICAL SKILL

Sr. Characteristic to be Poor Average Good Excellent Sub


(Marks1-3) (Marks4-5) (Marks 6-8) (Marks9-10) Total
No. assessed
(A) Process and Product Assessment (Convert Below total marks out of 6Marks)
1 Relevance to the course
2 Literature
Review/information
collection
3 Completion of the Target
as Per project proposal
4 Analysis of Data and
representation
5
Quality of Prototype/Model
6 Report Preparation
(B) Individual Presentation/Viva(Convert Below total marks out of 4Marks)
7 Presentation
8
Viva

(A) (B)
Process and Product Individual Presentation/ Total Marks
Assessment (6 marks) Viva (4 marks) 10

Name of Course Tearchar :-Prof .P.P.ANGADI

Signature:-

You might also like