dalia_dif 0.0.15__py3-none-any.whl → 0.0.16__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.
@@ -42,6 +42,7 @@ MEDIA_TYPES = {
42
42
  "image": SDO.ImageObject,
43
43
  "multipart": modalia.Multipart,
44
44
  }
45
+
45
46
  PROFICIENCY_LEVELS = {
46
47
  "novice": modalia.Novice,
47
48
  "advanced beginner": modalia.Beginner,
@@ -49,6 +50,14 @@ PROFICIENCY_LEVELS = {
49
50
  "proficient": modalia.Proficient,
50
51
  "expert": modalia.Expert,
51
52
  }
53
+ PROFICIENCY_TO_ORDER: dict[URIRef, int] = {
54
+ modalia.Novice: 0,
55
+ modalia.Beginner: 1,
56
+ modalia.Competent: 2,
57
+ modalia.Proficient: 3,
58
+ modalia.Expert: 4,
59
+ }
60
+
52
61
  RELATED_WORKS_RELATIONS = {
53
62
  "isPartOf": modalia.isPartOf,
54
63
  "hasPart": SDO.hasPart,
@@ -62,7 +71,6 @@ RELATED_WORKS_RELATIONS = {
62
71
  "isTranslationOf": modalia.isTranslationOf,
63
72
  }
64
73
 
65
-
66
74
  # Entries that will be ignored during the mapping because they shall be used as media type.
67
75
  # Format: URI -> media type to be used instead
68
76
  MEDIA_TYPE_EXCEPTIONS = {
dalia_dif/dif13/reader.py CHANGED
@@ -149,8 +149,8 @@ def read_dif13_into_rdflib(
149
149
  return graph
150
150
 
151
151
 
152
- def parse_dif13_row(
153
- file_name: str,
152
+ def parse_dif13_row( # noqa:C901
153
+ file_name: str | Path,
154
154
  idx: int,
155
155
  row: dict[str, str],
156
156
  *,
@@ -159,6 +159,9 @@ def parse_dif13_row(
159
159
  converter: curies.Converter | None = None,
160
160
  ) -> EducationalResourceDIF13 | None:
161
161
  """Convert a row in a DALIA curation file to a resource, or return none if unable."""
162
+ if isinstance(file_name, Path):
163
+ file_name = file_name.name
164
+
162
165
  supporting_communities, recommending_communities = _process_communities(
163
166
  file_name, idx, row, error_accumulator=error_accumulator
164
167
  )
@@ -188,6 +191,11 @@ def parse_dif13_row(
188
191
  else:
189
192
  raise ValueError(f"converter was unable to expand CURIE in keyword: {keyword}")
190
193
 
194
+ description = row.pop("Description").strip()
195
+ if not description:
196
+ _log(file_name, idx, "no description given", error_accumulator=error_accumulator)
197
+ return None
198
+
191
199
  try:
192
200
  rv = EducationalResourceDIF13(
193
201
  uuid=uuid,
@@ -198,7 +206,7 @@ def parse_dif13_row(
198
206
  links=external_uris,
199
207
  supporting_communities=supporting_communities,
200
208
  recommending_communities=recommending_communities,
201
- description=row.pop("Description").strip() or None,
209
+ description=description,
202
210
  disciplines=_process_disciplines(
203
211
  file_name, idx, row, error_accumulator=error_accumulator
204
212
  ),
dalia_dif/version.py CHANGED
@@ -12,7 +12,7 @@ __all__ = [
12
12
  "get_version",
13
13
  ]
14
14
 
15
- VERSION = "0.0.15"
15
+ VERSION = "0.0.16"
16
16
 
17
17
 
18
18
  def get_git_hash() -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dalia_dif
3
- Version: 0.0.15
3
+ Version: 0.0.16
4
4
  Summary: Tools for DALIA's data model for open educational resources
5
5
  Keywords: snekpack,cookiecutter,open educational resources,educational resources,training
6
6
  Author: Charles Tapley Hoyt
@@ -14,10 +14,10 @@ dalia_dif/dif13/legacy/authors.py,sha256=u7dye1lW1FifhwCnSS9GsDQPOyBRMyChkWUQFGT
14
14
  dalia_dif/dif13/legacy/components.py,sha256=xS9VIfawsPl1xNF5jplgj5r6c_4xoPvFlCCZkiyni1c,11908
15
15
  dalia_dif/dif13/legacy/learning_resource.py,sha256=N_eCXE10C7ITgcH7mXacMT2VZez89F-gAXOxzJJ65wc,4448
16
16
  dalia_dif/dif13/model.py,sha256=GIfzAnT0Blh7Qe-wk3w_lxZld-B4VbfH2ahyaDdpuR4,6935
17
- dalia_dif/dif13/picklists.py,sha256=SX0jyWYhiboU1j7Np3CeoFEvd4NMg5YOQI3d6PCR5-M,4762
17
+ dalia_dif/dif13/picklists.py,sha256=FapSFANJZ_u432RtGyOq7v8FpKfR4X9C7n3bAAXbrNI,4933
18
18
  dalia_dif/dif13/predicates.py,sha256=rrWVPMnMPvMelS4i2hOEWGhL11t-KR8yRrDArhGvYPE,1700
19
19
  dalia_dif/dif13/rdf.py,sha256=ZPdGB1hM2zNuxe6gidNwOn0LJB00Zs-mj2fHOYNm_qU,5908
20
- dalia_dif/dif13/reader.py,sha256=w0Kbcm9tt0y0__u3ele75DOvDlg2JUYZy_qcBC0gtPw,16604
20
+ dalia_dif/dif13/reader.py,sha256=vdHUawwDx1ohdldGbXtJDaAysEKdOmBUkP_sNhf1YJo,16853
21
21
  dalia_dif/dif13/utils.py,sha256=-r5ezhD7AkaJUAsUtZl1sHG_P76fz2Q_ULXgXLyDNII,814
22
22
  dalia_dif/namespace/__init__.py,sha256=kJGpIXZzeUdVhM_Pj465XlMkVqMB2Uc9aAZeFKQp5IQ,3105
23
23
  dalia_dif/namespace/bibframe_lite_relation.py,sha256=2trFP98s1wCPUfiAjHg-EK09yjWXC6ePLNJIVqgZvd8,255
@@ -31,9 +31,9 @@ dalia_dif/namespace/modalia.py,sha256=pSL-G9ib0E--Jwrbu9PvMMRjMe2FzzxoSjEv-0ank2
31
31
  dalia_dif/namespace/rec.py,sha256=c2Ce5IEhnM_BcZJUCXiMQEZ2GLFcC_76hfkKE16-zLc,241
32
32
  dalia_dif/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
33
33
  dalia_dif/utils.py,sha256=AA19Bw0vv8-ODZzDy_VR57WwndRccaQIepVS8tvodDo,761
34
- dalia_dif/version.py,sha256=3KPOrovLhb8UZjNbgXvcHQWQF4R3zKM9QcByY5-hEtk,962
35
- dalia_dif-0.0.15.dist-info/licenses/LICENSE,sha256=S-DsND478R_VQyGmtXbVYW67fRiJj3QfY8UXIJ4zvLI,1076
36
- dalia_dif-0.0.15.dist-info/WHEEL,sha256=z-mOpxbJHqy3cq6SvUThBZdaLGFZzdZPtgWLcP2NKjQ,79
37
- dalia_dif-0.0.15.dist-info/entry_points.txt,sha256=GmBz8JVyUD6m4v2QIxa7gm3sHIVNjTl5KTPP7L3FCGI,50
38
- dalia_dif-0.0.15.dist-info/METADATA,sha256=YbucTaME2VJgpvpePnyKUnl_bbYi7ibA2egEJspDbws,17760
39
- dalia_dif-0.0.15.dist-info/RECORD,,
34
+ dalia_dif/version.py,sha256=P0HhClGD_f2DxANB1sjaKV-SnG74QwaGHI6c9mzq30k,962
35
+ dalia_dif-0.0.16.dist-info/licenses/LICENSE,sha256=S-DsND478R_VQyGmtXbVYW67fRiJj3QfY8UXIJ4zvLI,1076
36
+ dalia_dif-0.0.16.dist-info/WHEEL,sha256=z-mOpxbJHqy3cq6SvUThBZdaLGFZzdZPtgWLcP2NKjQ,79
37
+ dalia_dif-0.0.16.dist-info/entry_points.txt,sha256=GmBz8JVyUD6m4v2QIxa7gm3sHIVNjTl5KTPP7L3FCGI,50
38
+ dalia_dif-0.0.16.dist-info/METADATA,sha256=KGz1zzlomjuz7BA_lKnVrsL-Y-vgY62wkbn4RVUP3GA,17760
39
+ dalia_dif-0.0.16.dist-info/RECORD,,