Devansh Lodha
23110091
IIT Gandhinagar
Implement a robust search functionality that allows users to quickly search for specific records based on Bond Number or filter data based on any column in the table except Sr. No. and Status (e.g., date, political party, company name). The output should be displayed in the form of a table which is fetched from the database for a given query.
- Go to Search Tab
- Enter Bond Number and Select Details to Display
- Click on Submit, to get the results
The option to select a Company/Individual from a drop-down/search, and show how many bonds and the total value of bonds purchased per year. You can present a bar plot depicting your results.
The option to select a political party from a drop-down/search, and show how many bonds and total value per year are in the timeline. You can present a bar plot depicting your results.
The option to select a political party from a drop-down/search, shows which companies have donated to it and what amount individually and combined.
- Go to the Party Donation Stats Page
- Enter name of a Political Party
- Click on Submit to get the results
output is truncated
Similarly, provide an option to select a company from a drop-down/search, showcasing which parties they have donated and what amount individually and combined.
- Go to the Company/Individual Donation Stats Page
- Enter Company/Individual Name
- Click on Submit to get the results
Pie Charts are displayed
- Generate a chart on any relevant page
- Click on the Download Chart button and the download window on your system will pop up
- Save to any directory and open the png
- Download the zip file of this repository
- Unzip it to a folder
- Open Visual Studio Code
- Open the previously unzipped folder in VSCode
- Open the terminal (powershell for windows) and enter the following to set up a virtual environment:
python -m venv flask_env
./flask_env/Scripts/activate.ps1
- Install the dependencies in the virtual environment
pip install flask flask-mysqldb wtforms pyyaml
- Open MySQL work bench
- Create a new database
eb_database
- Right click on the database under the schemas in the left column and select Table Data Import Wizard
- Select the file path to
purchase_details.csv
in thepdf_to_csv
folder of this repo - Follow the steps to import the csv file. Set the datetime format accordingly.
- Repeat the same steps for
redemption_details.csv
- Run the following queries:
use eb_database;
ALTER TABLE purchase_details
RENAME COLUMN Prefix to `Purchase Prefix`;
ALTER TABLE redemption_details
RENAME COLUMN Prefix to `Redemption Prefix`;
ALTER TABLE purchase_details
RENAME COLUMN Denominations to `Purchase Denominations`;
ALTER TABLE redemption_details
RENAME COLUMN Denominations to `Redemption Denominations`;
- The database is now set up.
- Inside of
db.yaml
back in VSCode, make sure details are correct according to the password set by you. - Go to the terminal again and enter the following (this may defer for terminals that are not powershell):
$env:FLASK_APP = "app"
- Run the app
python -m flask run
- Open the localhost link shown in your terminal in a browser to access the app
chart has not rendered completely due to processing limitations