odysseeapi 0.1.0__tar.gz → 0.2.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: odysseeapi
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: Unofficial Python API for Odyssee
5
5
  Author-email: Géry Casiez <gery.casiez@univ-lille.fr>
6
6
  Project-URL: Repository, https://github.com/casiez/OdysseeAPI
@@ -17,12 +17,13 @@ Provides an unofficial API for the [Odyssee platform](https://odyssee.enseigneme
17
17
 
18
18
  ## Features
19
19
 
20
+ - download applications of candidates
20
21
  - get information about candidates
21
22
  - get information about committee members
22
23
  - get information about institutions
23
24
  - get keywords
24
25
  - assign applications to committee members
25
- - get reports from committee members
26
+ - download reports from committee members
26
27
  - provide decision on each candidate after the first round of evaluation
27
28
 
28
29
  ## Installation
@@ -60,6 +61,9 @@ token = """eyJhbGciOiJSUzI1N... (token value) ..."""
60
61
  # setting use_cache to False forces the API client to fetch fresh data from the server for each request, while setting it to True allows the client to use cached data if available
61
62
  odyssee = Odyssee(numposte, token, True)
62
63
 
64
+ # Download the applications of the candidates in the specified directory
65
+ odyssee.download_applications('dossiers_candidats')
66
+
63
67
  candidates = odyssee.get_candidates()
64
68
  print(candidates)
65
69
 
@@ -78,7 +82,7 @@ print(candidates_with_details)
78
82
  # odyssee.assign_jury_members_to_candidate("f1e2d3c4-b5a6-4789-9876-543210fedcba", "98765432-10fe-dcba-9876-543210fedcba", "abcd1234-5678-90ef-ghij-klmnopqrstuv")
79
83
 
80
84
  # Download the reports of the committee members for the candidates in the specified directory
81
- odyssee.downloadReports("rapportsOdyssee")
85
+ odyssee.downloadReports("rapports_odyssee")
82
86
 
83
87
  # A l'issue de la première réunion du jury, enregistrer l'avis pour chaque candidat et les résultats du vote
84
88
  # odyssee.opinion_for_interview("f1e2d3c4-b5a6-4789-9876-543210fedcba", "A", "Motif audition", 16, 16, 0, 0, 16, 0)
@@ -7,12 +7,13 @@ Provides an unofficial API for the [Odyssee platform](https://odyssee.enseigneme
7
7
 
8
8
  ## Features
9
9
 
10
+ - download applications of candidates
10
11
  - get information about candidates
11
12
  - get information about committee members
12
13
  - get information about institutions
13
14
  - get keywords
14
15
  - assign applications to committee members
15
- - get reports from committee members
16
+ - download reports from committee members
16
17
  - provide decision on each candidate after the first round of evaluation
17
18
 
18
19
  ## Installation
@@ -50,6 +51,9 @@ token = """eyJhbGciOiJSUzI1N... (token value) ..."""
50
51
  # setting use_cache to False forces the API client to fetch fresh data from the server for each request, while setting it to True allows the client to use cached data if available
51
52
  odyssee = Odyssee(numposte, token, True)
52
53
 
54
+ # Download the applications of the candidates in the specified directory
55
+ odyssee.download_applications('dossiers_candidats')
56
+
53
57
  candidates = odyssee.get_candidates()
54
58
  print(candidates)
55
59
 
@@ -68,7 +72,7 @@ print(candidates_with_details)
68
72
  # odyssee.assign_jury_members_to_candidate("f1e2d3c4-b5a6-4789-9876-543210fedcba", "98765432-10fe-dcba-9876-543210fedcba", "abcd1234-5678-90ef-ghij-klmnopqrstuv")
69
73
 
70
74
  # Download the reports of the committee members for the candidates in the specified directory
71
- odyssee.downloadReports("rapportsOdyssee")
75
+ odyssee.downloadReports("rapports_odyssee")
72
76
 
73
77
  # A l'issue de la première réunion du jury, enregistrer l'avis pour chaque candidat et les résultats du vote
74
78
  # odyssee.opinion_for_interview("f1e2d3c4-b5a6-4789-9876-543210fedcba", "A", "Motif audition", 16, 16, 0, 0, 16, 0)
@@ -229,6 +229,34 @@ class Odyssee(object):
229
229
  self.__saveToCache("keywords", self.keywords)
230
230
  return self.keywords
231
231
 
232
+ def download_applications(self, path):
233
+ """Download applications for a given numposte and save them in the specified path."""
234
+ self.__createDir(path)
235
+
236
+ if self.candidatures is None:
237
+ self.get_candidates()
238
+
239
+ for c in tqdm.tqdm(self.candidatures, desc="Téléchargement des dossiers des candidatures"):
240
+ id_candidat = c["candidat"]["idKeycloakActuel"]
241
+
242
+ response = self.s.get(f"{self.base_url}recrutements/offre-poste/candidature/telecharger-dossier-candidature/{self.numposte}/{id_candidat}", headers=self.headers, cookies=self.cookies)
243
+
244
+ if response.status_code == 200:
245
+ chemin = response.content
246
+ fileName = f"{path}/{c['candidat']['nomUsage'].upper()}_{c['candidat']['prenom'].capitalize()}_{id_candidat}.zip"
247
+
248
+ response2 = self.s.get(f"{self.base_url}s3/fichier", params={"chemin": chemin}, headers=self.headers, cookies=self.cookies)
249
+
250
+ if response2.status_code == 200:
251
+ with open(fileName, "wb") as f:
252
+ f.write(response2.content)
253
+ else:
254
+ msg = f"Failed to download application for candidate {id_candidat}: {response2.status_code} - {response2.text}"
255
+ raise Exception(msg)
256
+ else:
257
+ msg = f"Failed to download application information for candidate {id_candidat}: {response.status_code} - {response.text}"
258
+ raise Exception(msg)
259
+
232
260
  def __detailCandidature(self, id_candidat):
233
261
  candidature = self.s.get(f"{self.base_url}recrutements/offre-poste/candidature/detail-candidature/{self.numposte}/{id_candidat}", headers=self.headers, cookies=self.cookies)
234
262
  if candidature.status_code != 200:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: odysseeapi
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: Unofficial Python API for Odyssee
5
5
  Author-email: Géry Casiez <gery.casiez@univ-lille.fr>
6
6
  Project-URL: Repository, https://github.com/casiez/OdysseeAPI
@@ -17,12 +17,13 @@ Provides an unofficial API for the [Odyssee platform](https://odyssee.enseigneme
17
17
 
18
18
  ## Features
19
19
 
20
+ - download applications of candidates
20
21
  - get information about candidates
21
22
  - get information about committee members
22
23
  - get information about institutions
23
24
  - get keywords
24
25
  - assign applications to committee members
25
- - get reports from committee members
26
+ - download reports from committee members
26
27
  - provide decision on each candidate after the first round of evaluation
27
28
 
28
29
  ## Installation
@@ -60,6 +61,9 @@ token = """eyJhbGciOiJSUzI1N... (token value) ..."""
60
61
  # setting use_cache to False forces the API client to fetch fresh data from the server for each request, while setting it to True allows the client to use cached data if available
61
62
  odyssee = Odyssee(numposte, token, True)
62
63
 
64
+ # Download the applications of the candidates in the specified directory
65
+ odyssee.download_applications('dossiers_candidats')
66
+
63
67
  candidates = odyssee.get_candidates()
64
68
  print(candidates)
65
69
 
@@ -78,7 +82,7 @@ print(candidates_with_details)
78
82
  # odyssee.assign_jury_members_to_candidate("f1e2d3c4-b5a6-4789-9876-543210fedcba", "98765432-10fe-dcba-9876-543210fedcba", "abcd1234-5678-90ef-ghij-klmnopqrstuv")
79
83
 
80
84
  # Download the reports of the committee members for the candidates in the specified directory
81
- odyssee.downloadReports("rapportsOdyssee")
85
+ odyssee.downloadReports("rapports_odyssee")
82
86
 
83
87
  # A l'issue de la première réunion du jury, enregistrer l'avis pour chaque candidat et les résultats du vote
84
88
  # odyssee.opinion_for_interview("f1e2d3c4-b5a6-4789-9876-543210fedcba", "A", "Motif audition", 16, 16, 0, 0, 16, 0)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "odysseeapi"
7
- version = "0.1.0"
7
+ version = "0.2.0"
8
8
  authors = [
9
9
  {name = "Géry Casiez", email = "gery.casiez@univ-lille.fr"},
10
10
  ]
File without changes