Weather Report Generator
The Project
The project is a Weather Report Generator which takes as user input a location and one or two dates. Once the user request is verified and the program has executed, a PDF is generated containing the latest weather report of the provided location for the provided date/dates. The Python program is broadly divided into four sub-programs to generate the PDF in the following order: 1. Prompt Parsing The user prompt is parsed and verified to identify the request/requests made. The location is uniform, and as per the date/dates provided, each one is assessed and categorized into one of 3 types of reports: A current weather report is generated for the present date A forecast one is generated for a future date A historical one is generated for a past date. A corresponding API request is made to Weather API's (https://www.weatherapi.com/) servers. Credit and thanks to them for the weather data. On the current API key, a maximum weather forecast of 2 days ahead is allowed, and a historical report of up to 7 days prior. 2. Data Extraction and Representation A class called Day was introduced that is capable of extracting and aptly representing data as per the type of report to be generated, given the date. 3. Graph Generation As per the data stored in the class objects, hourly data is represented with the help of graphs for a particular day. The hourly data graphs generated include Weather Condition, Temperature (°C/°F), Wind Speed and Direction (kph/mph), Gust Speed (kph/mph), Pressure (mb), Chances of Precipitation and Snowfall (%), Amount of Precipitation and Snowfall (cm and mm), Humidity and Cloud Cover (%), Dewpoint (°C/°F), Hourly Visibility (km/miles), UV and AQI Index. 4. PDF Generation Finally, when both the data from the API are present and the graphs are generated, all the information is grouped together into one PDF file per date and saved in the current working directory. This project was inspired as a capstone project for a course I was undertaking to showcase my grasp of the tools and technologies taught, and expand on and use them to make something grand and of my own using Python and its libraries. The most difficult portion was putting images into a graph to generate the hourly weather conditions, as it took extensive trial and error to figure out their proper placement. A tedious part was combing through the API request multiple times to figure out the path to reach the desired data.
About the team
Team members
More cool Advanced programming projects
Spacecraft EDL Simulation
Advanced programming
RGB Light Mixing using Arduino
Advanced programming
Optimus P5 Prime
Advanced programming