For my final project in CS50P, I have chosen to create a Gradebook Generator. This project embodies the essence of what I believe to be an invaluable tool for students who wish to easily visualize their grades and track their academic progress over time. The Gradebook Generator provides a highly efficient and user-friendly solution for creating and maintaining a spreadsheet that keeps tabs on one's grades throughout high school or university.
The core functionality of my program is designed with simplicity and accessibility in mind. The user interface walks students through a series of prompts, guiding them to input their academic data as requested by the program. This design ensures that even users with minimal technical knowledge can navigate and use the Gradebook Generator with ease.
Once the user has inputted their data, my program leverages the power of the 'prettytable' functionality to generate a visually appealing and organized Gradebook. This Gradebook not only displays the students' grades for each course but also calculates their average grades per semester and per year. This feature allows students to get a comprehensive overview of their academic performance at a glance, making it easier for them to identify areas where they excel and areas where they might need improvement.
In addition to generating a visual Gradebook, my program also creates a CSV (comma-separated values) file named 'gradebook.csv'. This file can be easily downloaded and imported into popular spreadsheet applications such as Microsoft Excel or Google Sheets. The CSV file format ensures compatibility across different platforms, allowing users to further manipulate and analyze their data if they wish. By providing this feature, my program extends its utility beyond just grade visualization, offering users the flexibility to create a comprehensive and customizable academic record.
Furthermore, the Gradebook Generator includes a feature that generates a bar graph saved as 'avg_comparison.png' using the matplotlib library. This graph provides a visual comparison of the user's academic performance over the years. By presenting the data in a graphical format, students can more easily discern trends in their academic performance, such as improvements or declines in their grades over time. This visual representation adds an extra layer of insight, helping students to better understand their academic journey.
The experience is designed to be student-friendly:
- The program guides you with clear prompts.
- It validates input (so wrong types donβt crash the program).
- It outputs results in clean PrettyTable format.
- It exports a structured CSV that can be opened in Excel / Google Sheets.
- It generates a visual comparison chart saved as
avg_comparison.png.
You enter:
- School Year (example:
2023-2024) - Any number of Semesters for that year
- Any number of Courses per semester
For each course you input:
- Number of Assignments / Quizzes / Tests / Exams
- Weightage (%) for each category
- The individual grades for each item (supports decimals)
You can type exit at multiple steps to quit cleanly.
For every semester, the program prints a PrettyTable showing:
- Course name
- Final weighted grade (formatted to 2 decimals)
This makes results readable instantly without needing Excel first.
The generator calculates:
- β Average per semester
- β Average per year
- β Overall average across all years
This turns raw entries into a real βacademic performance trackerβ that helps students spot trends early.
After the run completes, the program exports a full spreadsheet file named:
gradebook.csv
This CSV includes:
- Year
- Semester
- Course breakdown
- Assessment counts
- Weightings
- Final grade per course
- Semester averages
- Year averages
- Overall average across all years
You can open this directly in:
- Microsoft Excel
- Google Sheets
The program also generates and saves a chart:
avg_comparison.png
This graph helps students quickly see how theyβre doing over time β not just as numbers, but as a visual trajectory of performance (upward, flat, or declining).
What makes this project different isnβt just βit calculates gradesβ.
Itβs that itβs built like a real student tool:
- Input validation so mistakes donβt break the run
- Multi-year structure (not just one course / one semester)
- PrettyTable output that feels like a polished CLI app
- CSV export that becomes your long-term academic archive
- Matplotlib visualization for fast performance comparison
- Unit tests to prove core logic works
Workflow:
User input β clean CLI tables β averages β CSV export β graph saved
This project includes automated unit tests using pytest.
The tests validate:
get_integer_input()handling valid integer inputget_float_input()handlingexitcalculate_grade()correctness for weighted averages
It uses unittest.mock.patch to simulate user input without manual typing.
pytest -q.
βββ project.py
βββ test_project.py
βββ requirements.txt
βββ gradebook.csv # generated after running project.py
βββ avg_comparison.png # generated after running project.py
βββ gradebook.csv.png # screenshot (proof)
βββ Terminal Gradebook 1.png # screenshot (proof)
βββ Terminal Gradebook 2.png # screenshot (proof)
βββ Terminal Gradebook 3.png # screenshot (proof)
βββ Gradebook_Generator_Preview.gif # you will add this
Windows:
python -m venv .venv
.venv\Scripts\activatemacOS/Linux:
python -m venv .venv
source .venv/bin/activatepip install -r requirements.txtpython project.pyOutputs created after running:
gradebook.csvavg_comparison.png
- Open Google Sheets
- File β Import
- Upload
gradebook.csv - Choose βReplace spreadsheetβ or βInsert new sheetβ
- Done
- Open Excel
- File β Open
- Select
gradebook.csv - Done
Gradebook Generator is a complete CS50P final project that helps students:
- enter grades cleanly (with validation),
- calculate weighted results,
- compute averages across semesters + years,
- export everything into a spreadsheet,
- and visualize progress with a performance graph.
Itβs a real-world grade tracking workflow built in Python β not just a calculator.






