RadarSheets is a Python-based project designed to automate radar plot generation for Google Sheets. This is a one-off project specifically for the GPG FY25 initiative but is adaptable for future GPG years, provided the data format remains consistent.
The radar plots are created as PNG images, uploaded to Google Drive, and inserted into corresponding Google Sheets for visualization. Additionally, interactive HTML versions of the radar plots are saved locally on the machine running these scripts.
All working files will be found in RadarSheets>src>api.
-
Automated Radar Plot Generation:
- Generates radar plots categorized by company, layering three lab reviews for each plot.
- Saves plots as PNG and HTML files.
-
Google Drive Integration:
- Uploads radar plots to Google Drive with public access.
- Generates URLs for the uploaded images.
-
Google Sheets Integration:
- Embeds radar plot images in Google Sheets using the
IMAGEfunction. - Automatically resizes rows and columns to fit the images.
- Embeds radar plot images in Google Sheets using the
-
Error Handling:
- Validates sheet data structure and logs invalid entries.
- Logs failed uploads and inserts for debugging.
-
Data Cleaning:
- Employs
dataclean.gs, a Google Apps Script, to convert formulas or data pulls into a sheet with standardized data types (e.g., strings, floats).
- Employs
- Python 3.12 or higher
- Google Sheets and Google Drive APIs enabled
google-authgoogle-auth-oauthlibgoogle-auth-httplib2google-api-python-clientplotly
- A JSON key file for Google API authentication.
- A Google Spreadsheet containing structured evaluation data.
RadarSheets/
│
└── src/
├── api/
│ ├── google_sheets.py # Early iteration, not in use
│ ├── google_sheets_radar_plot.1.py # Script used by main_script.py
│ ├── google_sheets_radar_plot.py # Early iteration, not in use
│ ├── main_script.py # Main execution script
│ ├── service_account.json # Google API credentials file
│ └── __init__.py # Not in use
│
├── plots/ # Not in use
│ ├── radar_plot.py
│ └── __init__.py
│
├── utils/ # Not in use
│ ├── data_cleaner.py
│ └── __init__.py
│
├── main.py # Not in use
└── __init__.py # Not in use
pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client plotly- Create a service account in Google Cloud Console.
- Enable the Google Drive and Google Sheets APIs.
- Download the JSON credentials file and place it in
src/apiasservice_account.json.
- Ensure the spreadsheet matches the format of
2025 RFI Reviewer Scoring. - Use the
dataclean.gsfile:- Go to Extensions > Apps Script and create a new Apps Script file named
dataclean. - Copy and paste the
dataclean.gsscript from this repository. - Run the script to validate that a sheet named "Cleaned Values Only Data" is created with standard data types (e.g., numbers without formulas).
- Go to Extensions > Apps Script and create a new Apps Script file named
- Modify
main_script.py:- Set
SPREADSHEET_IDto your Google Spreadsheet ID. - Set
SERVICE_ACCOUNT_FILEto the path of your credentials file.
- Set
python main_script.py- Authenticates with Google APIs.
- Generates radar plots.
- Uploads radar plots to Google Drive.
- Embeds radar plots into Google Sheets and resizes cells.
- Logs invalid sheets for review.
- Logs companies with failed operations for debugging.
- Check the terminal output for error details.
- Adjust
row_heightandcolumn_widthin theresize_sheet_cellsfunction.
- Edit
google_sheets_radar_plot.1.pyfor custom styles and metrics.
- Add support for additional chart types.
- Provide a web-based interface for non-technical users.
- Implement database integration for processed data storage.
This project is licensed under the MIT License. See the license file for details.
For issues or questions, please contact the developer.