Skip to main content

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

Project description

esprit-py

PyPI version

[!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

  • Get your grades

  • Get your absences

  • Get your credits

  • Calculate your total semester average

  • New: Logout functionality for proper session management

Installation

pip install --upgrade esprit-py

Examples

get your total avreage:

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 grades

        grades = esprit.get_grades()



    except Exception as e:

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



if grades is not None:

    for grade in grades:

        print(grade)

else:

    print("Failed to get grades.")



esprit.calculate_average(grades)



# Logout when done

esprit.logout()

get a list of all your 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.5.1.tar.gz (13.3 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.5.1-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: esprit_py-0.5.1.tar.gz
  • Upload date:
  • Size: 13.3 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.5.1.tar.gz
Algorithm Hash digest
SHA256 9f0a40895544f4a7b8d89fa2f9e573e0c173aee502a6f46b8e6a3d9ff9ea8897
MD5 7a0125ccb1e25460419669020c1f7628
BLAKE2b-256 c0c199af1506479ede57027a9cbdb39f7b145a8c8daf53e91d45b033add1e75b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: esprit_py-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 15.3 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.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 26043d2134c2d7cdcf708200ff7131e603c18b3da13e484eb3e8e3a88b453e34
MD5 df230ee1b08f18a03c3e097f4921618f
BLAKE2b-256 6e7add31042a81f4fbddc19daa9bdc22940ce3e96a6c6af35ad9cdfa7331bc4c

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