Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thelime1/esprit.py
A Python library for interacting with data from esprit-tn.com
https://github.com/thelime1/esprit.py
api esprit python-client
Last synced: about 1 month ago
JSON representation
A Python library for interacting with data from esprit-tn.com
- Host: GitHub
- URL: https://github.com/thelime1/esprit.py
- Owner: TheLime1
- License: mit
- Created: 2024-02-02T19:41:09.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-02-18T12:32:37.000Z (10 months ago)
- Last Synced: 2024-11-07T14:17:33.539Z (about 2 months ago)
- Topics: api, esprit, python-client
- Language: Python
- Homepage: https://pypi.org/project/esprit-py/
- Size: 59.6 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# esprit-py
[![PyPI version](https://badge.fury.io/py/esprit-py.svg)](https://pypi.org/project/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
- Get your exact timetable pdf *not 300 pages pdf*
- Get your grades
- Get your absences
- Get your credits
- Calculate your total semester average## Installation
```bash
pip install --upgrade esprit-py
```## Examples
get your total avreage:
```python
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)
```
get a list of all your absences;
```python
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.")```
More examples can be found in the [examples folder](examples)