This script analyzes student data from a Google Spreadsheet and updates their situation based on attendance and grades. Link to Google Spreadsheet for this project.
-
git
-
python 3.12.0
python --version
- gspread 6.0.0: Python API for Google Sheets
pip install -r requirements.txt
- Credentials JSON file with proper Google Sheets API access. How To Get Credentials
mkdir <dir_name>
cd <dir_name>
git init
git remote add origin
python script.py <client_key> <spreadsheet_id> <sheet_name>
- <client_key>: Path to a JSON file containing Google Sheets API credentials. Help
- <spreadsheet_id>: The Google Spreadsheet ID, localized in URL. Help
- <sheet_name>: The name of sheet. Help
mkdir tunts-rocks
cd tunts-rocks
git init
git remote add origin
python script.py path/to/your/credentials.json yourspreadsheetid sheet_name
- Visit the Google Cloud Console.
- Create a new project.
- Enable the Google Sheets API for the project.
- Create credentials for the project, choosing "Service account key" as the credential type.
- Download the JSON file containing your credentials and specify its path when running the script.
- Share the Spreadsheet with account service e-mail.
For more information, consult the docs: Criar e excluir chaves de contas de serviço
The Spreadsheets Id is localized in the URL:
And the sheet name in the tabs:
The script performs the following actions:
- Reads data from a specified Google Spreadsheet.
- Analyzes student data, calculates their situation based on attendance and grades.
- Updates the student data with the calculated situation.
- Prints a message indicating the completion of the process.
This script assumes the existence of the google_client.py and student.py files containing the necessary classes and functions. Ensure these files are present and properly structured in the project directory.
This project is licensed under the MIT License.