Skip to main content

A simple Python utility library for grade calculation, GPA/CGPA conversion, and attendance eligibility checks.

Project description

gradelytics

A simple Python utility library for grade calculation, GPA/CGPA conversion, and attendance eligibility checks — built for students who want to track their academic performance programmatically.

Installation

pip install gradelytics

Usage

from gradelytics import calculate_grade, marks_to_gpa, calculate_cgpa, check_attendance_eligibility

# Convert marks to letter grade
grade = calculate_grade(78)
print(grade)  # "B+"

# Convert marks to GPA (4.0 scale)
gpa = marks_to_gpa(78)
print(gpa)  # 3.3

# Calculate CGPA across semesters
semester_gpas = [3.7, 4.0, 3.0]
credit_hours = [3, 4, 3]
cgpa = calculate_cgpa(semester_gpas, credit_hours)
print(cgpa)  # 3.57

# Check attendance eligibility (75% threshold)
eligible, percentage = check_attendance_eligibility(40, 32)
print(eligible, percentage)  # True 80.0

Functions

  • calculate_grade(marks) — Returns letter grade (A, A-, B+, B, C+, C, D, F) based on marks.
  • marks_to_gpa(marks) — Converts marks into an individual 4.0-scale GPA.
  • calculate_cgpa(gpa_list, credit_hours_list) — Calculates weighted CGPA across multiple semesters.
  • check_attendance_eligibility(total_classes, attended_classes) — Checks if attendance meets the 75% exam eligibility threshold.

License

MIT License

Author

Amna Khurram

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gradelytics-0.1.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gradelytics-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file gradelytics-0.1.0.tar.gz.

File metadata

  • Download URL: gradelytics-0.1.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for gradelytics-0.1.0.tar.gz
Algorithm Hash digest
SHA256 01a6a53ec829cda5bd45935e3fc08bfc48352b519b16cc58e4908297fefb9690
MD5 fac2c54e900b09a1dfd83990dbc57b75
BLAKE2b-256 9931cbcb17d9acb8964833a4386d1aaaef91a453778c79061531770abcf94f0c

See more details on using hashes here.

File details

Details for the file gradelytics-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gradelytics-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for gradelytics-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b5d1e2737d4ab0b154b386730d8d1953eadef65de906320823654fccb2bcebc0
MD5 2895d65d74e6f41f25299470e9f3288a
BLAKE2b-256 5010526a572cc5dd420033317c9ca4b36b2e7715db4b1fd7a362a4d52882e0ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page