Program Instructions 1. All the functions should accept the weather dictionary data structure as follows: weather dictionary: key datetime as string (formatted as YYYYMMDDhhmmss) value readings dictionary readings dictionary for key : 't' value temperature as integer for key : 'h' value: humidity as integer for key : 'r' value rainfall as float 2. Create a weather module. i. Create a function named_read_data which receives a keyword parameter filename. a. The function should open the filename in read mode and return a dictionary of the JSON decoded contents of the file. b. If the file does not exist, the function should accept the FileNotFoundError and return an empty dictionary. ii. Create a function named write_data which receives a keyword parameter data and filename a. The function should open the filename in write mode and write the dictionary data into the file encoded as JSON. iii. Create a function named max_temperature which receives a keyword parameter data and date a. The function should return the maximum temperature for all dictionary data where the key contains the date as YYYYMMDD. iv. Create a function named min_temperature which receives a keyword parameter data and date a. The function should return the minimum temperature for all dictionary data where the key contains the date as YYYYMMDD. v. Create a function named max_humidity which receives a keyword parameter data and date a. The function should return the maximum humidity for all dictionary data where the key contains the date as YYYYMMDD. vi. Create a function named min_humidity which receives a keyword parameter data and date a. The function should return the minimum humidity for all dictionary data where the key contains the date as YYYYMMDD. vii. Create a function named tot_rain which receives a keyword parameter data and date a. The function should return the sum of rainfall for all dictionary data where the key contains the date as YYYYMMDD. viii. Create a function named report_daily which receives a keyword parameter data and date a. The function should return a single string which when passed to any print function will display on the screen formatted exactly as indicated in the example output below. You will most likely be appending strings together using a literal "\n" where a newline is desired. To get the month name, you can import the builtin calendar module and call the month_name function passing it the month as an integer. ix. Create a function named report_historical which receives a keyword parameter data a. The function should return a single string which when passed to any print function will display on the screen formatted exactly as indicated in the example output below. You will most likely be appending strings together using a literal "\n" where a newline is desired. To get the month name, you can import the builtin calendar module and call the month_name function passing it the month as an integer
Program Instructions 1. All the functions should accept the weather dictionary data structure as follows: weather dictionary: key datetime as string (formatted as YYYYMMDDhhmmss) value readings dictionary readings dictionary for key : 't' value temperature as integer for key : 'h' value: humidity as integer for key : 'r' value rainfall as float 2. Create a weather module. i. Create a function named_read_data which receives a keyword parameter filename. a. The function should open the filename in read mode and return a dictionary of the JSON decoded contents of the file. b. If the file does not exist, the function should accept the FileNotFoundError and return an empty dictionary. ii. Create a function named write_data which receives a keyword parameter data and filename a. The function should open the filename in write mode and write the dictionary data into the file encoded as JSON. iii. Create a function named max_temperature which receives a keyword parameter data and date a. The function should return the maximum temperature for all dictionary data where the key contains the date as YYYYMMDD. iv. Create a function named min_temperature which receives a keyword parameter data and date a. The function should return the minimum temperature for all dictionary data where the key contains the date as YYYYMMDD. v. Create a function named max_humidity which receives a keyword parameter data and date a. The function should return the maximum humidity for all dictionary data where the key contains the date as YYYYMMDD. vi. Create a function named min_humidity which receives a keyword parameter data and date a. The function should return the minimum humidity for all dictionary data where the key contains the date as YYYYMMDD. vii. Create a function named tot_rain which receives a keyword parameter data and date a. The function should return the sum of rainfall for all dictionary data where the key contains the date as YYYYMMDD. viii. Create a function named report_daily which receives a keyword parameter data and date a. The function should return a single string which when passed to any print function will display on the screen formatted exactly as indicated in the example output below. You will most likely be appending strings together using a literal "\n" where a newline is desired. To get the month name, you can import the builtin calendar module and call the month_name function passing it the month as an integer. ix. Create a function named report_historical which receives a keyword parameter data a. The function should return a single string which when passed to any print function will display on the screen formatted exactly as indicated in the example output below. You will most likely be appending strings together using a literal "\n" where a newline is desired. To get the month name, you can import the builtin calendar module and call the month_name function passing it the month as an integer
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
Expert Solution
Step 1
According to the information given:-
We have to follow the instruction in order to get the desired outcome.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 7 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education