Skip to main content

Islamia University Bahawalpur SGPA, CGPA Calculation And Analysis

  1. How to Run the project.

pip install isgc

  1. import calculation_gpa

from isgc.gpa_calculator.calculator import calculate_gpa

  1. Enter Semesters detail like that.
        
{
    "Semester 1": {
        "Subject 1": {"credit_hours": 2, "marks": 44, "total_marks": 50},
        "Subject 2": {"credit_hours": 3, "marks": 76, "total_marks": 100},
        "Subject 3": {"credit_hours": 2, "marks": 36, "total_marks": 50},
        "Subject 4": {"credit_hours": 1, "marks": 46, "total_marks": 50},
        "Subject 5": {"credit_hours": 3, "marks": 31, "total_marks": 50},
        "Subject 6": {"credit_hours": 1, "marks": 43, "total_marks": 50},
        "Subject 7": {"credit_hours": 3, "marks": 88, "total_marks": 100},
        "Subject 8": {"credit_hours": 1, "marks": 44, "total_marks": 50}
    },
    "Semester 2": {
        "Subject 1": {"credit_hours": 2, "marks": 44, "total_marks": 50},
        "Subject 2": {"credit_hours": 3, "marks": 76, "total_marks": 100},
        "Subject 3": {"credit_hours": 2, "marks": 36, "total_marks": 50},
        "Subject 4": {"credit_hours": 1, "marks": 46, "total_marks": 50},
        "Subject 5": {"credit_hours": 3, "marks": 31, "total_marks": 50},
        "Subject 6": {"credit_hours": 1, "marks": 43, "total_marks": 50},
        "Subject 7": {"credit_hours": 3, "marks": 160, "total_marks": 200},
        "Subject 8": {"credit_hours": 1, "marks": 44, "total_marks": 50}
    }
}
        
    
  1. Make an Object.

cgpa=calculation_gpa(semesters)

  1. print output.

print(cgpa)

from isgc.gpa_calculator.calculator import calculate_gpa

semesters = {
    'Semester 1': {
        'Subject 1': {'credit_hours': 2, 'marks': 44, 'total_marks':50},
        'Subject 2': {'credit_hours': 3, 'marks': 76, 'total_marks':100},
        'Subject 3': {'credit_hours': 2, 'marks': 36, 'total_marks':50},
        'Subject 4': {'credit_hours': 1, 'marks': 46, 'total_marks':50},
        'Subject 5': {'credit_hours': 3, 'marks': 31, 'total_marks':50},
        'Subject 6': {'credit_hours': 1, 'marks': 43, 'total_marks':50},
        'Subject 7': {'credit_hours': 3, 'marks': 88, 'total_marks':100},
        'Subject 8': {'credit_hours': 1, 'marks': 44, 'total_marks':50},
    },
     'Semester 2': {
        'Subject 1': {'credit_hours': 2, 'marks': 44, 'total_marks':50},
        'Subject 2': {'credit_hours': 3, 'marks': 76, 'total_marks':100},
        'Subject 3': {'credit_hours': 2, 'marks': 36, 'total_marks':50},
        'Subject 4': {'credit_hours': 1, 'marks': 46, 'total_marks':50},
        'Subject 5': {'credit_hours': 3, 'marks': 31, 'total_marks':50},
        'Subject 6': {'credit_hours': 1, 'marks': 43, 'total_marks':50},
        'Subject 7': {'credit_hours': 3, 'marks': 160, 'total_marks':200},
        'Subject 8': {'credit_hours': 1, 'marks': 44, 'total_marks':50},
    }
    }


cgpa = calculate_gpa(semesters)


print(f"CGPA: {cgpa}")

Grading Scale we Use For Calculation official IUB :

        
        grading_scale = {
        100: {'grade_point': 4.0, 'remark': 'A+ Excellent'},
        99: {'grade_point': 4.0, 'remark': 'A+ Excellent'},
        98: {'grade_point': 4.0, 'remark': 'A+ Excellent'},
        97: {'grade_point': 4.0, 'remark': 'A+ Excellent'},
        96: {'grade_point': 4.0, 'remark': 'A+ Excellent'},
        95: {'grade_point': 4.0, 'remark': 'A+ Excellent'},
        94: {'grade_point': 4.0, 'remark': 'A Very Good'},
        93: {'grade_point': 4.0, 'remark': 'A Very Good'},
        92: {'grade_point': 4.0, 'remark': 'A Very Good'},
        91: {'grade_point': 4.0, 'remark': 'A Very Good'},
        90: {'grade_point': 4.0, 'remark': 'A Very Good'},
        89: {'grade_point': 4.0, 'remark': 'A Very Good'},
        88: {'grade_point': 4.0, 'remark': 'A Very Good'},
        87: {'grade_point': 4.0, 'remark': 'A Very Good'},
        86: {'grade_point': 4.0, 'remark': 'A Very Good'},
        85: {'grade_point': 4.0, 'remark': 'A Very Good'},
        84: {'grade_point': 3.9, 'remark': 'B+ Good'},
        83: {'grade_point': 3.9, 'remark': 'B+ Good'},
        82: {'grade_point': 3.8, 'remark': 'B+ Good'},
        81: {'grade_point': 3.7, 'remark': 'B+ Good'},
        80: {'grade_point': 3.7, 'remark': 'B+ Good'},
        79: {'grade_point': 3.6, 'remark': 'B Good'},
        78: {'grade_point': 3.5, 'remark': 'B Good'},
        77: {'grade_point': 3.5, 'remark': 'B Good'},
        76: {'grade_point': 3.4, 'remark': 'B Good'},
        75: {'grade_point': 3.3, 'remark': 'B Good'},
        74: {'grade_point': 3.3, 'remark': 'B Good'},
        73: {'grade_point': 3.2, 'remark': 'B Good'},
        72: {'grade_point': 3.1, 'remark': 'B Good'},
        71: {'grade_point': 3.1, 'remark': 'B Good'},
        70: {'grade_point': 3.0, 'remark': 'B Good'},
        69: {'grade_point': 2.9, 'remark': 'C Satisfactory'},
        68: {'grade_point': 2.8, 'remark': 'C Satisfactory'},
        67: {'grade_point': 2.7, 'remark': 'C Satisfactory'},
        66: {'grade_point': 2.6, 'remark': 'C Satisfactory'},
        65: {'grade_point': 2.5, 'remark': 'C Satisfactory'},
        64: {'grade_point': 2.4, 'remark': 'C Satisfactory'},
        63: {'grade_point': 2.3, 'remark': 'C Satisfactory'},
        62: {'grade_point': 2.2, 'remark': 'C Satisfactory'},
        61: {'grade_point': 2.1, 'remark': 'C Satisfactory'},
        60: {'grade_point': 2.0, 'remark': 'C Satisfactory'},
        59: {'grade_point': 1.9, 'remark': 'D Poor'},
        58: {'grade_point': 1.8, 'remark': 'D Poor'},
        57: {'grade_point': 1.7, 'remark': 'D Poor'},
        56: {'grade_point': 1.6, 'remark': 'D Poor'},
        55: {'grade_point': 1.5, 'remark': 'D Poor'},
        54: {'grade_point': 1.4, 'remark': 'D Poor'},
        53: {'grade_point': 1.3, 'remark': 'D Poor'},
        52: {'grade_point': 1.2, 'remark': 'D Poor'},
        51: {'grade_point': 1.1, 'remark': 'D Poor'},
        50: {'grade_point': 1.0, 'remark': 'D Poor'},
        49: {'grade_point': 0.0, 'remark': 'F Fail'}
        }

Pseude Code

FUNCTION custom_round(number, decimal_places)
    factor = 10 raised to the power of decimal_places
    rounded_number = integer part of (number * factor + 0.5) divided by factor
    RETURN rounded_number

FUNCTION calculate_gpa(semesters)
    DEFINE grading_scale as a dictionary with grade points and remarks

    INITIALIZE total_grade_points, total_credit_hours, total_rounded_percentage, total_total_marks,
               total_obtained_marks, total_quality_points, semester_gp_list, and subject_grade_remarks

    INITIALIZE result_table as an empty list

    FOR EACH semester, subjects IN semesters
        INITIALIZE semester-specific variables

        FOR EACH subject, details IN subjects
            CALCULATE percentage, rounded_percentage, grade_point, remark, and quality_point

            ACCUMULATE semester-specific data

            ADD grade remarks for each subject across semesters to subject_grade_remarks

        CALCULATE semester_gpa
        ADD semester_gpa to semester_gp_list

        ACCUMULATE total data across semesters

        APPEND semester-wise data to result_table

    CALCULATE cgpa based on total_grade_points and total_credit_hours

    DISPLAY results in a table format using tabulate

    PLOT visualizations using Matplotlib and Seaborn for SGPA and subject grade remarks

    RETURN cgpa rounded to 2 decimal places

Certainly! Here's the algorithm described in a more mathematical form using Markdown:


You can calculate upto your choice of semesters and subjects format i told you.


Feel Free to contact if you have any kind of Query.

Metadata

Release files for isgc 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for isgc 1.0.2
File Size Uploaded Provenance Actions
isgc-1.0.2.tar.gz 5.7 kB Without provenance Details for isgc-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for isgc 1.0.2
File Interpreter ABI Platform Actions
isgc-1.0.2-py3-none-any.whl Python 3 none any Details for isgc-1.0.2-py3-none-any.whl

Total release size: 13.3 kB

Release files / isgc-1.0.2.tar.gz

Download URL isgc-1.0.2.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d48bebfed50796165d0b580e9b96c90790c3a1910b70c29342bce4f644922c72
BLAKE2b-256 checksum
How to use checksums
224a89d16f50b0cc83eaf6882209d3e46178c9dd612645588141b515cca33b85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / isgc-1.0.2-py3-none-any.whl

Download URL isgc-1.0.2-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85cf6415fce342fac73c3e932671f5c0975810690191d4e4ec9d1d44daef9ccc
BLAKE2b-256 checksum
How to use checksums
1beeb4a8d4e6869de0a704f2543e645f03059d95887ce3667ccbced786a1537c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Security for isgc 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page