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, roundPrecision=3)) # Output: Grade: A
print("Grade Point:", GradePoint(85, roundPrecision=3)) # 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.4.tar.gz (6.5 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.4-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ggsipu_academics-0.1.4.tar.gz
  • Upload date:
  • Size: 6.5 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.4.tar.gz
Algorithm Hash digest
SHA256 51bbd9c215b2dceedfb2e9192ee0cec25f32bfeb26993e920676c7025ba0c7e0
MD5 1edf210cbde1eca71ad13aef238b8687
BLAKE2b-256 ecf20452e2bb572c85b2cbd50514cffa70ba9a7559575e4280a71997ea84c491

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ggsipu_academics-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6512961e23810a2f00b0f00cd52b812e4efcca1554c0d28ac575d766d6369446
MD5 a952bb2a77609b66bdce483f2e3fb7c1
BLAKE2b-256 6bd6f16f67e0a8b1d8dde2f632583971580390fdc87a3e671b768b0af6a82365

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