A fast, lightweight Python library for interacting with data from esprit-tn.com
Project description
esprit-py
[!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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file esprit_py-0.7.1.tar.gz.
File metadata
- Download URL: esprit_py-0.7.1.tar.gz
- Upload date:
- Size: 16.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aba9b64a1297c50637428f6ef6ed9ed70a86843d157024d4897dd40435238825
|
|
| MD5 |
6b4491a6b3499a878ab694cbec6e1420
|
|
| BLAKE2b-256 |
2a79ccf428aded8a8f608228f8cc95cbbad3d23a9449f06d318e06076c333934
|
File details
Details for the file esprit_py-0.7.1-py3-none-any.whl.
File metadata
- Download URL: esprit_py-0.7.1-py3-none-any.whl
- Upload date:
- Size: 18.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc5cde464e9e68d66a142241d30193e29b7b68dafb29f0390b0c79719a0e96da
|
|
| MD5 |
4f0d9a21cfc9c42bd7629b3e41a08337
|
|
| BLAKE2b-256 |
5b43072084f740dc1b5379e51925000896d09e4d849df5b5f1d4d202125699aa
|