UIC Overview The goal of this project is to write a console-based database application in Python, this time using an N-tier design. The database used for this project consists of
information pertaining to registered lobbyists in Chicago, their employers, their clients, and their compensation. The project will be developed in three parts. You must complete each part by its respective deadline to earn full credit. ● ● ● Part 1 of the project is to build and test the data access tier. This is worth 10 points out of the 100 points for the whole project. Part 2 of the project is to build and test the object mapping tier. This is worth 60 points out of the 100 points for the whole project. ● Part 3 of the project is to build and test the presentation tier. This is worth 30 points out of the 100 points for the whole project. You will submit each part of the project to Gradescope. There is no plotting in this project. The Chicago Lobbyist Database A lobbyist is a person who tries to influence a politician or official group to write or vote on legislation in a particular way. In Chicago, the Board of Ethics regulates these individuals. They are required to register with the Board each year, and to file reports about their lobbying activities each quarter. For more information and explanation of the terminology, see the following links: https://www.chicago.gov/city/en/depts/ethics/provdrs/lobby.html https://www.chicago.gov/content/dam/city/depts/ethics/general/LobbyistStuff/PDF FORMS/Infosheet.pdf The Chicago Lobbyist database consists of 8 tables: LobbyistInfo, LobbyistYears, EmployerInfo, EmployerYears, ClientInfo, ClientYears, LobbyistAndEmployer, and Compensation. For more information on the design of the database, the primary and foreign keys, and the column types, run the .schema command. UIC If it is helpful, the original data may be found at the following links: • https://data.cityofchicago.org/Ethics/Lobbyist-Data-Lobbyists/tq3e- https://data.cityofchicago.org/Ethics/Lobbyist-Data-Clients/g8p5- t5yq/about data y4m5/about data https://data.cityofchicago.org/Ethics/Lobbyist-Data-Employers/dmeb- https://data.cityofchicago.org/Ethics/Lobbyist-Data-Compensation/dw2f- 2zra/about data ##### w78u/about data Part 1 - Data Access Tier In the Python file "datatier.py", complete the three functions as defined by the header comments. Feel free to reuse code from previous assignments and lectures. You must implement the functions as defined. Do not change function names, do not change the parameters or return values, do not add functions, do not use global variables, and do not use any other imports. # # datatier.py # Executes SQL queries against the given database. # # Original author: Prof. Joe Hummel, Ellen Kidane # import sqlite3 # # select_one_row: # #Given a database connection and a SQL Select query, # executes this query against the database and returns # the first row retrieved by the query (or the empty # tuple () if no data was retrieved). The query can # be parameterized, in which case pass the values as # a list via parameters; this parameter is optional. # # Returns: first row retrieved by the given query, or ### UIC def select_one_row(dbConn, sql, parameters = None): pass () if no data was retrieved. If an error occurs, a msg is output and None is returned. #################### # # select_n_rows: # pass #Given a database connection and a SQL Select query, # executes this query against the database and returns # a list of rows retrieved by the query. If the query # retrieves no data, the empty list [] is returned. # The query can be parameterized, in which case pass # the values as a list via parameters; this parameter # is optional. # ####: # # Returns: a list of 0 or more rows retrieved by the given query; if an error occurs a msg is output and None is returned. # # def select_n_rows (dbConn, sql, parameters = None): #################### # # perform_action: # ############## ####### ############### #Given a database connection and a SQL action query, # executes this query and returns the # of rows # modified; a return value of 0 means no rows were # updated. Action queries are typically "insert", # "update", "delete". The query can be parameterized, # in which case pass the values as a list via # parameters; this parameter is optional. # # Returns: the # of rows modified by the query; if an # # error occurs a msg is output and -1 is returned. Note that a return value of 0 is ### # UIC not considered an error it means the query did not change the database (e.g. because the where condition was false?). # def perform_action(dbConn, sql, parameters = None): pass Part 2 - Object Mapping Tier In the Python file "objecttier.py", implement the following classes and functions as defined by the header comments. You must implement the classes and functions as defined below. You cannot use tools to generate the code for you. Do not change the class names, property names, or function names. Do not change the parameters or the return values. Do not add functions. Do not use global variables or other imports. All computations must be done using SQL - you cannot simply read in the data and do the searching/sorting/computing yourself. All SQL must be executed by the functions provided in the data access tier. # # objecttier # # Builds Lobbyist-related objects from data retrieved through # the data tier. # # Original author: Ellen Kidane # import datatier ### # # Lobbyist: # # Constructor (...) # Properties: # Lobbyist_ID: int First Name: string Last Name: string # Phone: string class Lobbyist: pass ###### # # # # # LobbyistDetails: # # Constructor (...) # Properties: # Lobbyist_ID: int # Salutation: string # First Name: string # Middle_Initial: string # Last Name: string # UIC # State_Initial: string Zip Code: string Country: string Email: string Phone: string Fax: string # Years_Registered: list of years Employers: st of employer names Suffix: string Address 1: string Address 2: string City: string # Total_Compensation: float # class LobbyistDetails: # #################### pass # LobbyistClients: # # Constructor(...) # Properties: # Lobbyist_ID: int # # # First Name: string # Last Name: string Phone: string # Total_Compensation: float ##### ################ ############### # Clients: list of clients ####