0% found this document useful (0 votes)
11 views4 pages

Title Slide

Uploaded by

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

Title Slide

Uploaded by

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

1.

Title Slide
 Title: Weather Report Project in Python
 Subtitle: (Your name, class, date, etc.)
 Python programming language

 Requests library (for API interaction)


 JSON (for data parsing)
 Optional: Tkinter (if you are using a GUI)
 OpenWeatherMap API or any other weather API
2. Project
Overview
 Objective: A weather report application that retrieves current weather data from an API
and displays it in a readable format.
 Tools :
Used

 Display current weather data (e.g., temperature, humidity, wind speed, weather
condition)
 User input for location (city name or coordinates)
 Ability to fetch live data from an online API (e.g., OpenWeatherMap API)
 Option to show detailed data (e.g., forecast, pressure, etc.)

3. Features of the Weather Report


Project
4. Project
Architecture
 Input: User provides a city name or coordinates.
 Processin :
g 
Send an HTTP request to the weather API.
 Parse the JSON response to extract relevant data.
 Output: Display weather details to the user.
 Optional: Store data or provide a visual representation (graph, temperature over time).

5. Code Walkthrough (Slides with


Code)
 Slide 1: Setting Up API

 Import necessary libraries (e.g., request )


s
 Set up your API key
 Slide 2: Making API
Request
 Example code to fetch data:

python Copy code


import "London" "your_api_key" f"http:/
/api.openweathermap.org/data/2.5/weather?q={city}&appid={api_key}"

 Slide 3: Parsing JSON Response


 Example to extract temperature, humidity, etc.
python

Copy code
"main" "main" "humidity"
"weather" 0 "temp"
 Slide 4: Displaying Results
"description"
 Example of displaying the data:
python Copy code

print f"Temperature: {temperature}°C" print f"Humidity: {humidity}%" print f"Weather:


{weather_description}"
6. Error
Handling
 Handling API : e.g., invalid city name, no internet connection.
errors
 Example:
python
Copy
code
if 200 print "Error fetching data"
 Include screenshots of your Python program running or a short demo video.
 Show how the program fetches and displays weather data.

7. Optional
Enhancements
 Graphical User Interface : Use Tkinter to build a simple interface.
 (GUI)
 Forecas : Fetch forecast data for multiple days.
 t
Recap the project goals and what was achieved.
Unit : Convert temperature units between Celsius and Fahrenheit.
 Mention future enhancements or improvements you plan to implement.
Conversion

8. Screenshots or Demo (if


applicable)

9. Conclusion
 Encourage questions and discussion.

10. Reference

s
OpenWeatherMap API documentation (or the API you used).
 Python documentation for libraries used (e.g., request , jso ).
s n

Example of Code in the Project:


python
Copy
code
import def get_weathe "your_api_key_here"
r
"http://api.openweathermap.org/data/2.5/weather?
"f"{base_url}q={city}&appid={api_key}&units=metric
"
if "cod" 200 "main" "weather" 0
"temp" "humidity"
"description" print f"Temperature: {temperature}°C" print f"Humidity: {humidity}
%"
print f"Weather: else print "City not found!" inpu "Enter
{description}" t
city name:
"

You might also like