Skip to main content

A fast, lightweight Python library for interacting with data from esprit-tn.com

Project description

esprit-py

PyPI - Version

PyPI Downloads

PyPI Downloads

[!NOTE]

Please note that this library is not an official API provided by Esprit and is intended for educational and personal use only.

Features

  • Fast & Lightweight: 5-10x faster than previous versions (no Selenium/browser required)

  • Get your exact timetable pdf not 300 pages pdf

  • Grades:

    • Regular session grades (released one by one during semester)

    • Principal session final results (end of year verdict)

    • Rattrapage (retake) session grades

    • Rattrapage session final results

    • Calculate your total semester average

  • Get your absences

  • Get your credits

  • Get your language proficiency levels (French & English)

  • Get your ranking across past academic years

  • New: Logout functionality for proper session management

Installation

pip install --upgrade esprit-py

Examples

Get regular grades and calculate average:

from esprit import Esprit



# Replace with your actual ID and password

id = 'ID'

password = 'PASSWORD'



grades = None



# Keep trying to get grades until it is successful cuz esprit use garabage servers

while grades is None:

    try:

        # Create an Esprit object

        esprit = Esprit()



        # Attempt to log in

        esprit.login(id, password)



        # Get regular grades (released one by one during semester)

        grades = esprit.get_regular_grades()



    except Exception as e:

        print(f"An error occurred: {e}. Retrying...")



if grades is not None:

    for grade in grades:

        print(grade)

    

    # Calculate average

    esprit.calculate_average(grades)

else:

    print("Failed to get grades.")



# Logout when done

esprit.logout()

Get all grade-related data:

from esprit import Esprit



esprit = Esprit()

id = 'ID'

password = 'PASSWORD'



if esprit.login(id, password):

    # Regular session grades (released during semester)

    regular_grades = esprit.get_regular_grades()

    if regular_grades:

        print("Regular Grades:", regular_grades)

    

    # Principal session final result (end of year)

    principal_result = esprit.get_principal_result()

    if principal_result:

        print("Principal Result:", principal_result)

    

    # Rattrapage session grades (retakes)

    rattrapage_grades = esprit.get_rattrapage_grades()

    if rattrapage_grades:

        print("Rattrapage Grades:", rattrapage_grades)

    

    # Rattrapage session final result

    rattrapage_result = esprit.get_rattrapage_result()

    if rattrapage_result:

        print("Rattrapage Result:", rattrapage_result)

    

    # Language proficiency levels

    language_levels = esprit.get_language_levels()

    if language_levels:

        print("Language Levels:", language_levels)

    

    # Academic ranking across years

    ranking = esprit.get_ranking()

    if ranking:

        print("Ranking:", ranking)

    

    esprit.logout()

Get absences:

from esprit import Esprit



# Create an Esprit object

esprit = Esprit()



# Replace with your actual ID and password

id = 'ID'

password = 'PASSWORD'



# Attempt to log in

if esprit.login(id, password):

    print("Login successful.")

else:

    print("Login failed.")



# Get absences

absences = esprit.get_absences()

if absences is not None:

    for absence in absences:

        print(absence)

else:

    print("Failed to get absences.")



# Logout when done

esprit.logout()

More examples can be found in the examples folder

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

esprit_py-0.7.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

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

esprit_py-0.7.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file esprit_py-0.7.0.tar.gz.

File metadata

  • Download URL: esprit_py-0.7.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for esprit_py-0.7.0.tar.gz
Algorithm Hash digest
SHA256 e60dff6bbd2ef9cc0ace9a054503c316d3656de49baf489f2b2fb73c1450ac0d
MD5 1781ecb4a39fc0b13726fbe5062ced9a
BLAKE2b-256 5e0c06a380f7eeaf003d27be983cf2c386958cbda43b50a68e9df9ddbd29187b

See more details on using hashes here.

File details

Details for the file esprit_py-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: esprit_py-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for esprit_py-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 297071016d500ab86b7dd2c85a3419a356d160b57cb36348c1cabe13080de193
MD5 939ed7a02a9e63d97324f47b0a2250c3
BLAKE2b-256 92d5f760cf0069945263bf1195a196ac4570141d8028e09ae0ea60465b6e2041

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