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.6.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.6-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ggsipu_academics-0.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 ad542b100f263133ea0ee17df7c140f445973dcb9d055cff5e6798daf0917a25
MD5 e2d2365a3f0ef04759af8e840c7cd17d
BLAKE2b-256 e993b29c13ce7ba9995d117b3d821981a23c3f0b86b7a8928eccd27d0cf41547

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ggsipu_academics-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b2d4e2d1c47ca40285e4671f79ac169efa23fcbd15582f55925d9b8f45fce2f4
MD5 b92b7b8411816d7e474903daaf99cda5
BLAKE2b-256 d1d92716b33554236422ee4719001e4a25fb40d9c758299afe62d7b09daefb06

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