Skip to main content

CLI and Python toolkit for GGSIPU academic calculations (SGPA, CGPA, Grades)

Project description

ggsipu_academics

PyPI version Python Versions License

Table of Contents

Overview

ggsipu-academics 🎓

A Python Library and CLI tool for academic calculations for
Guru Gobind Singh Indraprastha University (GGSIPU) students.

Installation

pip install ggsipu-academics

CLI-Usage

ggsipu grade 85
ggsipu gradepoint 72
ggsipu sgpa --mode marks
ggsipu cgpa --mode sgpa

Python-Usage

The following functions can be used to calculate the Semester Grade Point Average (SGPA) and Cumulative Grade Point Average (CGPA).

Calculate SGPA

Calculate the Semester Grade Point Average (SGPA) of a student/individual studying in IPU.

SGPAFromMarks

Calculate the SGPA from marks.

Parameters:
  • subjects (List[Tuple[int, int]]): A list of tuples where each tuple contains the credits and marks obtained in a subject.
  • roundPrecision (int, optional): The number of decimal places to round the SGPA to. Default is 2.
Returns:

float: The calculated SGPA.

Raises:

ValueError: If the total credits are zero.

Example:

>>> from ggsipu_academics import SGPAFromMarks
>>> subjects = [(4, 80), (4, 70), (3, 90)]
>>> SGPAFromMarks(subjects)
7.8

SGPAFromGradePoint

Calculate the SGPA from grade points.

Parameters:
  • subjects (List[Tuple[int, float]]): A list of tuples where each tuple contains the credits and grade point of a subject.
  • roundPrecision (int, optional): The number of decimal places to round the SGPA to. Default is 2.
Returns:

float: The calculated SGPA.

Raises:

ValueError: If the total credits are zero.

Example:

    >>> from ggsipu_academics import SGPAFromGradePoint
    >>> subjects = [(4, 8.5), (4, 7.5), (3, 9.0)]
    >>> SGPAFromGradePoint(subjects)
    8.33

Calculate CGPA

Calculate the Cumulative Grade Point Average (CGPA) of a student/individual studying in IPU.

CGPAFromSemesterMarks

Calculate the CGPA from semester marks.

Parameters:
  • semesters (List[List[Tuple[int, int]]]): A list of lists where each list contains the credits and marks obtained in a subject for a semester.
  • roundPrecision (int, optional): The number of decimal places to round the CGPA to. Default is 2.
Returns:

float: The calculated CGPA.

Raises:

ValueError: If the total credits are zero.

Example:

    >>> from ggsipu_academics import CGPAFromSemesterMarks
    >>> semesters = [[(4, 80), (4, 70), (3, 90)], [(4, 85), (4, 75), (3, 95)]]
    >>> CGPAFromSemesterMarks(semesters)
    8.42

CGPAFromSemesterSGPA

Calculate the CGPA from semester GPAs.

Parameters:
  • semesters (List): A list of semester GPAs.
  • roundPrecision (int, optional): The number of decimal places to round the CGPA to. Default is 2.
Returns:

float: The calculated CGPA.

Raises:

ValueError: If the total credits are zero.

Example:

    >>> from ggsipu_academics import CGPAFromSemesterSGPA
    >>> semesters = [7.8, 8.42]
    >>> CGPAFromSemesterSGPA(semesters)
    8.1

Example

from ggsipu_academics import Grade, GradePoint, SGPAFromMarks, SGPAFromGradePoint, CGPAFromSemesterMarks, CGPAFromSemesterSGPA,

print("Grade:", Grade(85)) # Output: Grade: A
print("Grade Point:", GradePoint(85)) # Output: Grade Point: 8.0
print("SGPA From Marks:", SGPAFromMarks([(4, 85), (4, 75)], roundPrecision=3)) # Output: SGPA From Marks: 7.50
print("SGPA From Grade Point:", SGPAFromGradePoint([(4, 7), (4, 8)], roundPrecision=3)) # Output: SGPA From Grade Point: 7.75
print("CGPA From Semester Marks:", CGPAFromSemesterMarks([[(4, 7), (4, 8)], [(4, 8), (4, 9)]], roundPrecision=3)) # Output: CGPA From Semester Marks: 8.33
print("CGPA From Semester SGPA:", CGPAFromSemesterSGPA([7.75, 8.5, 9.0], roundPrecision=3)) # Output: CGPA From Semester SGPA: 8.58

License

ggsipu-academics is distributed under the terms of the MIT license.

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

ggsipu_academics-0.1.5.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

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

ggsipu_academics-0.1.5-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file ggsipu_academics-0.1.5.tar.gz.

File metadata

  • Download URL: ggsipu_academics-0.1.5.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.7

File hashes

Hashes for ggsipu_academics-0.1.5.tar.gz
Algorithm Hash digest
SHA256 d55303d3f326e0b982918815d714b03bfdf07a66f80b97991cc3ca78b25ff897
MD5 bb216e5ea4dfeeaa24b52884d25b21bf
BLAKE2b-256 3c94d8fa098cd1c9cfa0db53c9c65b5d9906b8c0dbb36501d3215b648e8225f8

See more details on using hashes here.

File details

Details for the file ggsipu_academics-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for ggsipu_academics-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7925c84ec72a2f7f8ac5589f67a676641c725c0cdfebb7045bba070e61ad1166
MD5 b8fec8a115f9d0ba947fe01466ab36d6
BLAKE2b-256 d0ffe016112e575ffbe351186e732f6ceb2765645ad918871efaf6b500a0a25d

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