ladok3 5.1__py3-none-any.whl → 5.2__py3-none-any.whl

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 ladok3 might be problematic. Click here for more details.

doc/ltxobj/ladok3.pdf CHANGED
Binary file
ladok3/data.nw CHANGED
@@ -76,8 +76,8 @@ This way the user can deal with how to store the data.
76
76
  <<produce data about course specified in args>>=
77
77
  data_writer = csv.writer(sys.stdout, delimiter=args.delimiter)
78
78
  course_rounds = filter_rounds(
79
- ladok.search_course_rounds(code=args.course_code),
80
- args.rounds)
79
+ ladok.search_course_rounds(code=args.course_code),
80
+ args.rounds)
81
81
 
82
82
  if args.header:
83
83
  data_writer.writerow([
@@ -137,21 +137,24 @@ def extract_data_for_round(ladok, course_round, args):
137
137
  <<compute start and length of the course>>
138
138
  <<get the results for the course round>>
139
139
 
140
- students = filter_students(course_round.participants(), args.students)
140
+ students = filter_students(course_round.participants(),
141
+ args.students)
141
142
 
142
143
  for student in students:
143
- student_results = filter_student_results(student, results)
144
+ student_results = filter_student_results(student,
145
+ results)
144
146
 
145
147
  <<determine if student should be included>>
146
148
 
147
- components = filter_components(course_round.components(), args.components)
149
+ components = filter_components(course_round.components(),
150
+ args.components)
148
151
 
149
152
  for component in components:
150
153
  if len(student_results) < 1:
151
154
  result_data = None
152
155
  else:
153
- result_data = filter_component_result(
154
- component, student_results[0]["ResultatPaUtbildningar"])
156
+ result_data = filter_component_result(component,
157
+ student_results[0]["ResultatPaUtbildningar"])
155
158
 
156
159
  if not result_data:
157
160
  grade = "-"
@@ -164,12 +167,21 @@ def extract_data_for_round(ladok, course_round, args):
164
167
 
165
168
  We want to yield the data in CSV form, so we simply yield a tuple.
166
169
  The date is either the normalized date or the date from the result data.
170
+ The student's identifier will be either the LADOK ID or the student name and
171
+ personnummer, depending on the command line arguments.
167
172
  <<yield [[student, component, grade]] and date>>=
168
- if args.normalize_date:
169
- yield student, component, grade, normalized_date
170
- elif result_data:
171
- yield student, component, grade, result_data["Examinationsdatum"]
173
+ yield student.ladok_id if args.ladok_id \
174
+ else student, \
175
+ component, \
176
+ grade, \
177
+ normalized_date if args.normalize_date \
178
+ else result_data["Examinationsdatum"] if result_data \
179
+ else None
172
180
  <<add data command arguments to data parser>>=
181
+ data_parser.add_argument("-l", "--ladok-id", action="store_true",
182
+ help="Use the LADOK ID for the student, "
183
+ "otherwise the student name and personnummer "
184
+ "will be used.")
173
185
  data_parser.add_argument("-n", "--normalize-date", action="store_true",
174
186
  help="Normalize the date to the start of the course, "
175
187
  "otherwise the date is printed as is.")
ladok3/data.py CHANGED
@@ -60,10 +60,11 @@ def extract_data_for_round(ladok, course_round, args):
60
60
  grade = "-"
61
61
  normalized_date = None
62
62
 
63
- if args.normalize_date:
64
- yield student, component, grade, normalized_date
65
- elif result_data:
66
- yield student, component, grade, result_data["Examinationsdatum"]
63
+ yield student.ladok_id if args.ladok_id else student, component, grade, (
64
+ normalized_date
65
+ if args.normalize_date
66
+ else result_data["Examinationsdatum"] if result_data else None
67
+ )
67
68
 
68
69
 
69
70
  def filter_student_results(student, results):
@@ -168,6 +169,14 @@ def add_command_options(parser):
168
169
  help="The round codes for the rounds to include, "
169
170
  "otherwise all rounds will be included.",
170
171
  )
172
+ data_parser.add_argument(
173
+ "-l",
174
+ "--ladok-id",
175
+ action="store_true",
176
+ help="Use the LADOK ID for the student, "
177
+ "otherwise the student name and personnummer "
178
+ "will be used.",
179
+ )
171
180
  data_parser.add_argument(
172
181
  "-n",
173
182
  "--normalize-date",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ladok3
3
- Version: 5.1
3
+ Version: 5.2
4
4
  Summary: Python wrapper and CLI for the LADOK3 REST API.
5
5
  Home-page: https://github.com/dbosk/ladok3
6
6
  License: MIT
@@ -1,12 +1,12 @@
1
- doc/ltxobj/ladok3.pdf,sha256=ffhkazbKXtrPNApa39g96qOlnuwK5QniFQkqAnj4eLc,2308912
1
+ doc/ltxobj/ladok3.pdf,sha256=pw1hOWXramu6nDhQy0iwMaUHKdwHr2gE8dLVeV8GypE,2319370
2
2
  ladok3/.gitignore,sha256=R1rBunOQmdfni2mCHqmtU3vDQggAZdeu5qIdK89jRtE,90
3
3
  ladok3/Makefile,sha256=V1eijeRoVPOcl0QCoIVzc2d1p6goJfu3PNynINM-ZnU,715
4
4
  ladok3/__init__.py,sha256=2ySW9vSJ0joOV5TH9dtK_CAOdk1PByZ7jYfAwQxfAhc,87708
5
5
  ladok3/api.nw,sha256=o7ZWO6eplSG3ReS0Y-rzcrLP2yiFVwvQUtg6dPDXG5E,66716
6
6
  ladok3/cli.nw,sha256=sA5kevvAWBkzZHZ3UBkPEHoWvPw5yYtGYiPEnWMmjus,22864
7
7
  ladok3/cli.py,sha256=6R7B0XVvYFlHcMbv6E73KOeI3ZGQFeQN2-ojz12H1vU,12555
8
- ladok3/data.nw,sha256=NddmEnzfgaXZkYyaOLle67MNySy4YKWx4OXMWAOAMkA,12676
9
- ladok3/data.py,sha256=nLta8ZlSmgRqXZoCbJqtw6KlHH-EyZfImbDcPs74G2U,7324
8
+ ladok3/data.nw,sha256=f-63BpPTO87WfnAlz7o2oN6xJ5ZGCf2GTRBT1Laakgc,13388
9
+ ladok3/data.py,sha256=Y-JTg7qYElKtvMG_sv4BJgPSa6qBi8s8eXLZwbGxZvA,7592
10
10
  ladok3/ladok.bash,sha256=zGfTFdtos2zLjV13pzfK-1uCy2b_lF2qUKMoL2ExW7c,1441
11
11
  ladok3/ladok3.nw,sha256=mftysbBD9CLaKD8JgRcSO9KOnjV6koOd2dfmbSSJJi0,55594
12
12
  ladok3/report.nw,sha256=nmyP6TnSYBsMIeG2bdiVQ7LqQN_gEqyEfbDrrOR1afc,10068
@@ -15,8 +15,8 @@ ladok3/scripts.nw,sha256=BgKUOEUc1JeShPvGLV4OJLQwrmCOyxUoe7pAeW00d34,8906
15
15
  ladok3/student.nw,sha256=qgJN1IA6oIoI4RsfWsoTaO2yxdtB_y3mBNSmlccoE4Y,4395
16
16
  ladok3/student.py,sha256=a3z5dY18UXqxZh4WtEhgsUdHePhRNBiU5GaNNP6LKxI,2178
17
17
  ladok3/undoc.nw,sha256=rRAZ8fC44PD2hBDF8TeEg1hyge_-vd-ScRcojRXQycI,19841
18
- ladok3-5.1.dist-info/LICENSE,sha256=Oe-mWTBQ-MzuA4jGuRDPDxQtMe8SuP_YjSQl7SOtZ7Q,1155
19
- ladok3-5.1.dist-info/METADATA,sha256=wMSkWRA_WBSYjLyfODj60Q8t-u7u5HDArOtFpkalBWc,9370
20
- ladok3-5.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
21
- ladok3-5.1.dist-info/entry_points.txt,sha256=pi-KKP5Obo0AyuDjXQUpadS9kIvAY2_5ORhPgEYlJv8,41
22
- ladok3-5.1.dist-info/RECORD,,
18
+ ladok3-5.2.dist-info/LICENSE,sha256=Oe-mWTBQ-MzuA4jGuRDPDxQtMe8SuP_YjSQl7SOtZ7Q,1155
19
+ ladok3-5.2.dist-info/METADATA,sha256=-xtEG253nX5pnyh4k3XKNjrb3sP5__GMM84wVa1uhXc,9370
20
+ ladok3-5.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
21
+ ladok3-5.2.dist-info/entry_points.txt,sha256=pi-KKP5Obo0AyuDjXQUpadS9kIvAY2_5ORhPgEYlJv8,41
22
+ ladok3-5.2.dist-info/RECORD,,
File without changes
File without changes