ladok3 5.1__tar.gz → 5.2__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 ladok3 might be problematic. Click here for more details.

Files changed (34) hide show
  1. {ladok3-5.1 → ladok3-5.2}/PKG-INFO +1 -1
  2. {ladok3-5.1 → ladok3-5.2}/pyproject.toml +1 -1
  3. {ladok3-5.1 → ladok3-5.2}/src/ladok3/data.nw +23 -11
  4. {ladok3-5.1 → ladok3-5.2}/LICENSE +0 -0
  5. {ladok3-5.1 → ladok3-5.2}/README.md +0 -0
  6. {ladok3-5.1 → ladok3-5.2}/doc/Makefile +0 -0
  7. {ladok3-5.1 → ladok3-5.2}/doc/abstract.tex +0 -0
  8. {ladok3-5.1 → ladok3-5.2}/doc/ladok3.tex +0 -0
  9. {ladok3-5.1 → ladok3-5.2}/doc/preamble.tex +0 -0
  10. {ladok3-5.1 → ladok3-5.2}/makefiles/doc.mk +0 -0
  11. {ladok3-5.1 → ladok3-5.2}/makefiles/exam.mk +0 -0
  12. {ladok3-5.1 → ladok3-5.2}/makefiles/haskell.mk +0 -0
  13. {ladok3-5.1 → ladok3-5.2}/makefiles/miun.course.mk +0 -0
  14. {ladok3-5.1 → ladok3-5.2}/makefiles/miun.depend.mk +0 -0
  15. {ladok3-5.1 → ladok3-5.2}/makefiles/miun.docs.mk +0 -0
  16. {ladok3-5.1 → ladok3-5.2}/makefiles/miun.port.mk +0 -0
  17. {ladok3-5.1 → ladok3-5.2}/makefiles/miun.pub.mk +0 -0
  18. {ladok3-5.1 → ladok3-5.2}/makefiles/noweb.mk +0 -0
  19. {ladok3-5.1 → ladok3-5.2}/makefiles/pkg.mk +0 -0
  20. {ladok3-5.1 → ladok3-5.2}/makefiles/portability.mk +0 -0
  21. {ladok3-5.1 → ladok3-5.2}/makefiles/pub.mk +0 -0
  22. {ladok3-5.1 → ladok3-5.2}/makefiles/results.mk +0 -0
  23. {ladok3-5.1 → ladok3-5.2}/makefiles/subdir.mk +0 -0
  24. {ladok3-5.1 → ladok3-5.2}/makefiles/tex.mk +0 -0
  25. {ladok3-5.1 → ladok3-5.2}/makefiles/transform.mk +0 -0
  26. {ladok3-5.1 → ladok3-5.2}/src/ladok3/.gitignore +0 -0
  27. {ladok3-5.1 → ladok3-5.2}/src/ladok3/Makefile +0 -0
  28. {ladok3-5.1 → ladok3-5.2}/src/ladok3/api.nw +0 -0
  29. {ladok3-5.1 → ladok3-5.2}/src/ladok3/cli.nw +0 -0
  30. {ladok3-5.1 → ladok3-5.2}/src/ladok3/ladok3.nw +0 -0
  31. {ladok3-5.1 → ladok3-5.2}/src/ladok3/report.nw +0 -0
  32. {ladok3-5.1 → ladok3-5.2}/src/ladok3/scripts.nw +0 -0
  33. {ladok3-5.1 → ladok3-5.2}/src/ladok3/student.nw +0 -0
  34. {ladok3-5.1 → ladok3-5.2}/src/ladok3/undoc.nw +0 -0
@@ -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,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "ladok3"
3
- version = "5.1"
3
+ version = "5.2"
4
4
  description = "Python wrapper and CLI for the LADOK3 REST API."
5
5
  authors = [
6
6
  "Daniel Bosk <dbosk@kth.se>",
@@ -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.")
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes