dalia_dif 0.0.16__py3-none-any.whl → 0.0.17__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.
- dalia_dif/cli.py +7 -2
- dalia_dif/dif13/reader.py +14 -2
- dalia_dif/version.py +1 -1
- {dalia_dif-0.0.16.dist-info → dalia_dif-0.0.17.dist-info}/METADATA +1 -1
- {dalia_dif-0.0.16.dist-info → dalia_dif-0.0.17.dist-info}/RECORD +8 -8
- {dalia_dif-0.0.16.dist-info → dalia_dif-0.0.17.dist-info}/WHEEL +1 -1
- {dalia_dif-0.0.16.dist-info → dalia_dif-0.0.17.dist-info}/entry_points.txt +0 -0
- {dalia_dif-0.0.16.dist-info → dalia_dif-0.0.17.dist-info}/licenses/LICENSE +0 -0
dalia_dif/cli.py
CHANGED
|
@@ -17,8 +17,9 @@ def main() -> None:
|
|
|
17
17
|
|
|
18
18
|
@main.command()
|
|
19
19
|
@click.option("--dif-version", type=click.Choice(["1.3"]), default="1.3")
|
|
20
|
+
@click.option("--ignore-missing-description", is_flag=True)
|
|
20
21
|
@click.argument("location")
|
|
21
|
-
def validate(location: str, dif_version: str) -> None:
|
|
22
|
+
def validate(location: str, dif_version: str, ignore_missing_description: bool) -> None:
|
|
22
23
|
"""Validate a local/remote file or local folder of DIF-encoded CSVs."""
|
|
23
24
|
from dalia_dif.dif13 import read_dif13
|
|
24
25
|
|
|
@@ -31,7 +32,11 @@ def validate(location: str, dif_version: str) -> None:
|
|
|
31
32
|
for path in p.glob("*.csv"):
|
|
32
33
|
click.secho(f"\n> {path.relative_to(p)}", fg="green")
|
|
33
34
|
errors: list[str] = []
|
|
34
|
-
read_dif13(
|
|
35
|
+
read_dif13(
|
|
36
|
+
path,
|
|
37
|
+
error_accumulator=errors,
|
|
38
|
+
ignore_missing_description=ignore_missing_description,
|
|
39
|
+
)
|
|
35
40
|
if errors:
|
|
36
41
|
fail = True
|
|
37
42
|
for error in errors:
|
dalia_dif/dif13/reader.py
CHANGED
|
@@ -101,6 +101,7 @@ def read_dif13(
|
|
|
101
101
|
*,
|
|
102
102
|
error_accumulator: list[str] | None = None,
|
|
103
103
|
converter: curies.Converter | None = None,
|
|
104
|
+
ignore_missing_description: bool = False,
|
|
104
105
|
) -> list[EducationalResourceDIF13]:
|
|
105
106
|
"""Parse DALIA records."""
|
|
106
107
|
if isinstance(path, str) and (path.startswith("http://") or path.startswith("https://")):
|
|
@@ -132,7 +133,12 @@ def read_dif13(
|
|
|
132
133
|
for idx, record in enumerate(reader, start=2)
|
|
133
134
|
if (
|
|
134
135
|
oer := parse_dif13_row(
|
|
135
|
-
file_name,
|
|
136
|
+
file_name,
|
|
137
|
+
idx,
|
|
138
|
+
record,
|
|
139
|
+
error_accumulator=error_accumulator,
|
|
140
|
+
converter=converter,
|
|
141
|
+
ignore_missing_description=ignore_missing_description,
|
|
136
142
|
)
|
|
137
143
|
)
|
|
138
144
|
is not None
|
|
@@ -157,6 +163,7 @@ def parse_dif13_row( # noqa:C901
|
|
|
157
163
|
future: bool = False,
|
|
158
164
|
error_accumulator: list[str] | None = None,
|
|
159
165
|
converter: curies.Converter | None = None,
|
|
166
|
+
ignore_missing_description: bool = False,
|
|
160
167
|
) -> EducationalResourceDIF13 | None:
|
|
161
168
|
"""Convert a row in a DALIA curation file to a resource, or return none if unable."""
|
|
162
169
|
if isinstance(file_name, Path):
|
|
@@ -193,7 +200,12 @@ def parse_dif13_row( # noqa:C901
|
|
|
193
200
|
|
|
194
201
|
description = row.pop("Description").strip()
|
|
195
202
|
if not description:
|
|
196
|
-
_log(
|
|
203
|
+
_log(
|
|
204
|
+
file_name,
|
|
205
|
+
idx,
|
|
206
|
+
"no description given",
|
|
207
|
+
error_accumulator=None if ignore_missing_description else error_accumulator,
|
|
208
|
+
)
|
|
197
209
|
return None
|
|
198
210
|
|
|
199
211
|
try:
|
dalia_dif/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dalia_dif
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.17
|
|
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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
dalia_dif/.DS_Store,sha256=MtnD5ThzFbk9R7gZVWNniR_qnre6YMJscVWWkkQW8AM,6148
|
|
2
2
|
dalia_dif/__init__.py,sha256=uyO7jo0cu-99M2a87I7XeOH6c9ZPqRH46YgTdfXLOWg,66
|
|
3
3
|
dalia_dif/__main__.py,sha256=dlPNI11KSS49DY4SoTA1l8gQZr6iR9N1JJsySTjicUg,126
|
|
4
|
-
dalia_dif/cli.py,sha256=
|
|
4
|
+
dalia_dif/cli.py,sha256=zIKecW5aCvUrwyeW6k3ZXbb33Jl3X1d-9tZBsRpBLoU,3163
|
|
5
5
|
dalia_dif/dif13/__init__.py,sha256=tMaSW0hhnuO_Mt8CM_d0cTT6j_FSTGFY99crUawWa4w,457
|
|
6
6
|
dalia_dif/dif13/community/__init__.py,sha256=y8RnUSR1-d0oU02ZJA6z1hmDIJlUTJ66Yb51JGcp0JE,1051
|
|
7
7
|
dalia_dif/dif13/community/dalia_communities.csv,sha256=Tcpo310kOtn1zNMKu183GjqcM8XlsubGrLSvbvotJxI,6191
|
|
@@ -17,7 +17,7 @@ dalia_dif/dif13/model.py,sha256=GIfzAnT0Blh7Qe-wk3w_lxZld-B4VbfH2ahyaDdpuR4,6935
|
|
|
17
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=
|
|
20
|
+
dalia_dif/dif13/reader.py,sha256=g7ZtDSrUBhlKNYyvB39auAdWQHndGf6pZGJa3jFpWes,17200
|
|
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=
|
|
35
|
-
dalia_dif-0.0.
|
|
36
|
-
dalia_dif-0.0.
|
|
37
|
-
dalia_dif-0.0.
|
|
38
|
-
dalia_dif-0.0.
|
|
39
|
-
dalia_dif-0.0.
|
|
34
|
+
dalia_dif/version.py,sha256=aAPqI66QtdgdBvrGfuSXNCjIUCx6siw8G6_BPaSwT7w,962
|
|
35
|
+
dalia_dif-0.0.17.dist-info/licenses/LICENSE,sha256=S-DsND478R_VQyGmtXbVYW67fRiJj3QfY8UXIJ4zvLI,1076
|
|
36
|
+
dalia_dif-0.0.17.dist-info/WHEEL,sha256=XjEbIc5-wIORjWaafhI6vBtlxDBp7S9KiujWF1EM7Ak,79
|
|
37
|
+
dalia_dif-0.0.17.dist-info/entry_points.txt,sha256=GmBz8JVyUD6m4v2QIxa7gm3sHIVNjTl5KTPP7L3FCGI,50
|
|
38
|
+
dalia_dif-0.0.17.dist-info/METADATA,sha256=JwAwFe9RTi_fMDtlWApattEpFAihCPtSqcG20tF-rKg,17760
|
|
39
|
+
dalia_dif-0.0.17.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|