esprit-py 0.1.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of esprit-py might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: esprit-py
3
- Version: 0.1.0
3
+ Version: 0.2.1
4
4
  Summary: A Python library for interacting with data from esprit-tn.com
5
5
  Author: Lime1 (Aymen Hmani)
6
6
  Author-email: <everpadd4@gmail.com>
@@ -14,7 +14,19 @@ Classifier: Operating System :: Microsoft :: Windows
14
14
  Description-Content-Type: text/markdown
15
15
 
16
16
 
17
- # esprit-api
18
-
17
+ # <img src="https://esprit.tn/favicon.ico" width="28px" /> esprit-py
18
+
19
+ > [!NOTE]
20
+ > Please note that this library is not an official API provided by Esprit and is intended for educational and personal use only.
21
+
22
+ ## Features
23
+
24
+ - Get your exact timetable pdf not 300 pages pdf
25
+ - Get your grades
26
+ - Get your absences
27
+ - Get your credits
28
+
19
29
  missing stuff:
20
30
  - [ ] download any time table from the esprit website , not only the last one
31
+ - [ ] post stuff (reclamation,document stage,teacher evaluation) *dangereous area tbh*
32
+
@@ -0,0 +1,16 @@
1
+ # <img src="https://esprit.tn/favicon.ico" width="28px" /> esprit-py
2
+
3
+ > [!NOTE]
4
+ > Please note that this library is not an official API provided by Esprit and is intended for educational and personal use only.
5
+
6
+ ## Features
7
+
8
+ - Get your exact timetable pdf not 300 pages pdf
9
+ - Get your grades
10
+ - Get your absences
11
+ - Get your credits
12
+
13
+ missing stuff:
14
+ - [ ] download any time table from the esprit website , not only the last one
15
+ - [ ] post stuff (reclamation,document stage,teacher evaluation) *dangereous area tbh*
16
+
@@ -0,0 +1 @@
1
+ from .esprit import Esprit
@@ -3,11 +3,39 @@ from bs4 import BeautifulSoup
3
3
 
4
4
 
5
5
  class Absence:
6
+ """
7
+ A class used to represent an Absence.
8
+
9
+ ...
10
+
11
+ Attributes
12
+ ----------
13
+ url : str
14
+ a formatted string that represents the URL of the absence page
15
+ session : requests.Session
16
+ a Session object from the requests library
17
+
18
+ Methods
19
+ -------
20
+ get_absences():
21
+ Returns a list of absences for the student.
22
+ """
23
+
6
24
  def __init__(self, session):
7
25
  self.url = "https://esprit-tn.com/ESPOnline/Etudiants/absenceetud.aspx"
8
26
  self.session = session
9
27
 
10
28
  def get_absences(self):
29
+ """
30
+ Returns a list of absences for the student.
31
+
32
+ Returns
33
+ -------
34
+ list
35
+ a list of absences, each represented as a list of strings. The first list is the headers.
36
+ Returns None if the page does not contain the expected text.
37
+ """
38
+
11
39
  response = self.session.get(self.url)
12
40
  soup = BeautifulSoup(response.text, 'html.parser')
13
41
 
@@ -2,11 +2,45 @@ import requests
2
2
 
3
3
 
4
4
  class Auth:
5
+ """
6
+ A class used to represent an Authentication.
7
+
8
+ ...
9
+
10
+ Attributes
11
+ ----------
12
+ login_url : str
13
+ a formatted string that represents the login URL
14
+ session : requests.Session
15
+ a Session object from the requests library
16
+
17
+ Methods
18
+ -------
19
+ login(id: str, password: str):
20
+ Logs in to the website using the provided id and password.
21
+ """
22
+
5
23
  def __init__(self, session=None):
6
24
  self.login_url = "https://esprit-tn.com/esponline/online/default.aspx"
7
25
  self.session = session if session else requests.session()
8
26
 
9
27
  def login(self, id, password):
28
+ """
29
+ Logs in to the website using the provided id and password.
30
+
31
+ Parameters
32
+ ----------
33
+ id : str
34
+ the id to use for login
35
+ password : str
36
+ the password to use for login
37
+
38
+ Returns
39
+ -------
40
+ requests.Session
41
+ the Session object used for the login. This can be used for subsequent requests.
42
+ Returns None if the login failed.
43
+ """
10
44
  id_payload = {
11
45
  '__EVENTTARGET': '',
12
46
  '__EVENTARGUMENT': '',
@@ -3,11 +3,38 @@ from bs4 import BeautifulSoup
3
3
 
4
4
 
5
5
  class Credit:
6
+ """
7
+ A class used to represent a Credit.
8
+
9
+ ...
10
+
11
+ Attributes
12
+ ----------
13
+ url : str
14
+ a formatted string that represents the URL of the credit page
15
+ session : requests.Session
16
+ a Session object from the requests library
17
+
18
+ Methods
19
+ -------
20
+ get_credits():
21
+ Returns a list of credits for the student.
22
+ """
23
+
6
24
  def __init__(self, session):
7
25
  self.url = "https://esprit-tn.com/ESPOnline/Etudiants/Historique_Cr%C3%A9dit.aspx"
8
26
  self.session = session
9
27
 
10
28
  def get_credits(self):
29
+ """
30
+ Returns a list of credits for the student.
31
+
32
+ Returns
33
+ -------
34
+ list
35
+ a list of credits, each represented as a list of strings. The first list is the headers.
36
+ Returns None if the page does not contain the expected text.
37
+ """
11
38
  response = self.session.get(self.url)
12
39
  soup = BeautifulSoup(response.text, 'html.parser')
13
40
 
@@ -1,8 +1,8 @@
1
1
  import requests
2
2
  from auth import Auth
3
- from grade_scrape import Grade
4
- from absence_scrape import Absence
5
- from time_schedule_scrape import TimeSchedule
3
+ from grade import Grade
4
+ from absence import Absence
5
+ from time_schedule import TimeSchedule
6
6
  from credit import Credit
7
7
 
8
8
 
@@ -3,11 +3,38 @@ from bs4 import BeautifulSoup
3
3
 
4
4
 
5
5
  class Grade:
6
+ """
7
+ A class used to represent a Grade.
8
+
9
+ ...
10
+
11
+ Attributes
12
+ ----------
13
+ url : str
14
+ a formatted string that represents the URL of the grade page
15
+ session : requests.Session
16
+ a Session object from the requests library
17
+
18
+ Methods
19
+ -------
20
+ get_grades():
21
+ Returns a list of grades for the student.
22
+ """
23
+
6
24
  def __init__(self, session):
7
25
  self.url = "https://esprit-tn.com/ESPOnline/Etudiants/Resultat2021.aspx"
8
26
  self.session = session
9
27
 
10
28
  def get_grades(self):
29
+ """
30
+ Returns a list of grades for the student.
31
+
32
+ Returns
33
+ -------
34
+ list
35
+ a list of grades, each represented as a list of strings. The first list is the headers.
36
+ Returns None if the page does not contain the expected text.
37
+ """
11
38
  response = self.session.get(self.url)
12
39
  soup = BeautifulSoup(response.text, 'html.parser')
13
40
 
@@ -7,11 +7,44 @@ from PyPDF2 import PdfReader, PdfWriter
7
7
 
8
8
 
9
9
  class TimeSchedule:
10
+ """
11
+ A class used to represent a Time Schedule.
12
+
13
+ ...
14
+
15
+ Attributes
16
+ ----------
17
+ url : str
18
+ a formatted string that represents the URL of the time schedule page
19
+ session : requests.Session
20
+ a Session object from the requests library
21
+
22
+ Methods
23
+ -------
24
+ get_table_schedules():
25
+ Returns a list of time schedules for the student.
26
+ get_last_week_schedule():
27
+ Returns the most recent weekly schedule.
28
+ download_files(schedule: list):
29
+ Downloads the files associated with a given schedule.
30
+ get_class_week_schedule(file_path: str, class_name: str):
31
+ Extracts the weekly schedule for a specific class from a given file.
32
+ """
33
+
10
34
  def __init__(self, session):
11
35
  self.url = "https://esprit-tn.com/ESPOnline/Etudiants/Emplois.aspx"
12
36
  self.session = session
13
37
 
14
38
  def get_table_schedules(self):
39
+ """
40
+ Returns a list of time schedules for the student.
41
+
42
+ Returns
43
+ -------
44
+ list
45
+ a list of time schedules, each represented as a list of strings.
46
+ Returns None if the page does not contain the expected text.
47
+ """
15
48
  response = self.session.get(self.url)
16
49
  soup = BeautifulSoup(response.text, 'html.parser')
17
50
 
@@ -36,6 +69,15 @@ class TimeSchedule:
36
69
  return time_schedules
37
70
 
38
71
  def get_last_week_schedule(self):
72
+ """
73
+ Returns the most recent weekly schedule.
74
+
75
+ Returns
76
+ -------
77
+ list
78
+ the most recent weekly schedule, represented as a list of strings.
79
+ Returns None if no schedules are found.
80
+ """
39
81
  time_schedules = self.get_table_schedules()
40
82
  if time_schedules is None:
41
83
  return None
@@ -59,6 +101,19 @@ class TimeSchedule:
59
101
  return dates_and_schedules[-1][1] if dates_and_schedules else None
60
102
 
61
103
  def download_files(self, schedule):
104
+ """
105
+ Downloads the files associated with a given schedule.
106
+
107
+ Parameters
108
+ ----------
109
+ schedule : list
110
+ the schedule to download files for, represented as a list of strings
111
+
112
+ Returns
113
+ -------
114
+ str
115
+ the path to the downloaded file
116
+ """
62
117
  response = self.session.get(self.url)
63
118
  soup = BeautifulSoup(response.text, 'html.parser')
64
119
 
@@ -87,6 +142,21 @@ class TimeSchedule:
87
142
  return file_path
88
143
 
89
144
  def get_class_week_schedule(self, file_path, class_name):
145
+ """
146
+ Extracts the weekly schedule for a specific class from a given file.
147
+
148
+ Parameters
149
+ ----------
150
+ file_path : str
151
+ the path to the file to extract the schedule from
152
+ class_name : str
153
+ the name of the class to extract the schedule for
154
+
155
+ Returns
156
+ -------
157
+ str
158
+ the path to the extracted schedule, or None if the class is not found in the file
159
+ """
90
160
  # Open the existing PDF
91
161
  with open(file_path, "rb") as file:
92
162
  reader = PdfReader(file)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: esprit-py
3
- Version: 0.1.0
3
+ Version: 0.2.1
4
4
  Summary: A Python library for interacting with data from esprit-tn.com
5
5
  Author: Lime1 (Aymen Hmani)
6
6
  Author-email: <everpadd4@gmail.com>
@@ -14,7 +14,19 @@ Classifier: Operating System :: Microsoft :: Windows
14
14
  Description-Content-Type: text/markdown
15
15
 
16
16
 
17
- # esprit-api
18
-
17
+ # <img src="https://esprit.tn/favicon.ico" width="28px" /> esprit-py
18
+
19
+ > [!NOTE]
20
+ > Please note that this library is not an official API provided by Esprit and is intended for educational and personal use only.
21
+
22
+ ## Features
23
+
24
+ - Get your exact timetable pdf not 300 pages pdf
25
+ - Get your grades
26
+ - Get your absences
27
+ - Get your credits
28
+
19
29
  missing stuff:
20
30
  - [ ] download any time table from the esprit website , not only the last one
31
+ - [ ] post stuff (reclamation,document stage,teacher evaluation) *dangereous area tbh*
32
+
@@ -1,12 +1,12 @@
1
1
  README.md
2
2
  setup.py
3
3
  esprit/__init__.py
4
- esprit/absence_scrape.py
4
+ esprit/absence.py
5
5
  esprit/auth.py
6
6
  esprit/credit.py
7
7
  esprit/esprit.py
8
- esprit/grade_scrape.py
9
- esprit/time_schedule_scrape.py
8
+ esprit/grade.py
9
+ esprit/time_schedule.py
10
10
  esprit_py.egg-info/PKG-INFO
11
11
  esprit_py.egg-info/SOURCES.txt
12
12
  esprit_py.egg-info/dependency_links.txt
@@ -8,10 +8,10 @@ with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as fh:
8
8
  long_description = "\n" + fh.read()
9
9
 
10
10
  # Read requirements.txt
11
- with open('requirements.txt') as f:
11
+ with open(os.path.join(here, 'requirements.txt')) as f:
12
12
  requirements = f.read().splitlines()
13
13
 
14
- VERSION = '0.1.0'
14
+ VERSION = '0.2.1'
15
15
  DESCRIPTION = ' A Python library for interacting with data from esprit-tn.com'
16
16
  LONG_DESCRIPTION = 'esprit-py, provides a set of tools for interacting with data from the Esprit website. It includes functionalities for scraping grades, absences, time schedules, and credits. It also provides the ability to download files and get class week schedules.'
17
17
 
@@ -25,7 +25,7 @@ setup(
25
25
  long_description_content_type="text/markdown",
26
26
  long_description=long_description,
27
27
  packages=find_packages(),
28
- install_requires=requirements, # Use requirements from requirements.txt
28
+ install_requires=requirements,
29
29
  keywords=['python', 'api'],
30
30
  classifiers=[
31
31
  "Development Status :: 1 - Planning",
@@ -34,5 +34,15 @@ setup(
34
34
  "Operating System :: Unix",
35
35
  "Operating System :: MacOS :: MacOS X",
36
36
  "Operating System :: Microsoft :: Windows",
37
- ]
37
+ ],
38
+ package_data={"": ["requirements.txt"]},
38
39
  )
40
+
41
+ '''
42
+ python setup.py sdist bdist_wheel
43
+ twine check dist/*
44
+ twine upload dist/*
45
+ -
46
+ username: __token__
47
+ password: pypi-...
48
+ '''
esprit-py-0.1.0/README.md DELETED
@@ -1,4 +0,0 @@
1
- # esprit-api
2
-
3
- missing stuff:
4
- - [ ] download any time table from the esprit website , not only the last one
File without changes
File without changes