ose-core 0.3.0__py3-none-any.whl → 0.3.1__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.
- ose/__init__.py +7 -0
- ose/model/ExcelOntology.py +1 -1
- ose/model/Result.py +9 -0
- {ose_core-0.3.0.dist-info → ose_core-0.3.1.dist-info}/METADATA +1 -1
- {ose_core-0.3.0.dist-info → ose_core-0.3.1.dist-info}/RECORD +7 -7
- {ose_core-0.3.0.dist-info → ose_core-0.3.1.dist-info}/WHEEL +1 -1
- {ose_core-0.3.0.dist-info → ose_core-0.3.1.dist-info}/top_level.txt +0 -0
ose/__init__.py
CHANGED
|
@@ -5,5 +5,12 @@ This package contains the business logic, models, and services
|
|
|
5
5
|
for the OntoSpreadEd ontology spreadsheet editor.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
+
from importlib.metadata import version, PackageNotFoundError
|
|
9
|
+
|
|
10
|
+
try:
|
|
11
|
+
__version__ = version("ose-core")
|
|
12
|
+
except PackageNotFoundError:
|
|
13
|
+
__version__ = "unknown"
|
|
14
|
+
|
|
8
15
|
# Re-export commonly used classes
|
|
9
16
|
from .model import * # noqa: F401, F403
|
ose/model/ExcelOntology.py
CHANGED
|
@@ -137,7 +137,7 @@ class ExcelOntology:
|
|
|
137
137
|
def find_term_label(self, id: str) -> Optional[str]:
|
|
138
138
|
return next((t.label for t in (self._terms + self.imported_terms()) if t.id == id), None)
|
|
139
139
|
|
|
140
|
-
def term_by_id(self, id: str) -> Optional[Term]:
|
|
140
|
+
def term_by_id(self, id: str | None) -> Optional[Term]:
|
|
141
141
|
return next(iter(t for t in (self.terms()) if t.id == id), None)
|
|
142
142
|
|
|
143
143
|
def _term_by_id(self, id: str) -> Optional[UnresolvedTerm]:
|
ose/model/Result.py
CHANGED
|
@@ -47,3 +47,12 @@ class Result(Generic[A]):
|
|
|
47
47
|
|
|
48
48
|
def has_errors(self) -> bool:
|
|
49
49
|
return len(self.errors) > 0
|
|
50
|
+
|
|
51
|
+
def ok_or_raise(self) -> A:
|
|
52
|
+
if self.has_errors():
|
|
53
|
+
raise Exception(f"Result has errors: {self.errors}")
|
|
54
|
+
|
|
55
|
+
if not self.ok():
|
|
56
|
+
raise Exception(f"Result has no value: {self.errors}")
|
|
57
|
+
|
|
58
|
+
return self.value
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
ose/__init__.py,sha256=
|
|
1
|
+
ose/__init__.py,sha256=R4ybE2_5FanMrKgCtsTtwCRNynPLFMaHoVBI8yzpJyw,402
|
|
2
2
|
ose/constants.py,sha256=UFktPxVhwrKpSB8wnHjpX6lMhEcctgBzOwGcghOtvQE,88
|
|
3
3
|
ose/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
ose/commands/CLICommandContext.py,sha256=w52GS6hqBRh6MupX-l41PHruPSFmNmkLNIg7bvlg5iE,1616
|
|
@@ -28,12 +28,12 @@ ose/index/create_index.py,sha256=WBiaA2YctOZDdN-iMClMiS6vakfAcAj909JWYHZk1lQ,310
|
|
|
28
28
|
ose/index/schema.py,sha256=2l0h4fy1m-OXc_LIKX7kZHcgBE2a6CvQXSzIkBfZCV8,366
|
|
29
29
|
ose/model/ColumnMapping.py,sha256=DyWnEo872QNittLSFkhWswOmkhc5l8CjXoNmqencS7I,9180
|
|
30
30
|
ose/model/Diff.py,sha256=SIr5TsQtpdKvm44pOnTPmx1B-PCDFlauYO5__ssedFQ,1851
|
|
31
|
-
ose/model/ExcelOntology.py,sha256=
|
|
31
|
+
ose/model/ExcelOntology.py,sha256=73hubLJa8lTGmdR3NRZ3KCYRzvmDft8rpeae-NeW29I,46462
|
|
32
32
|
ose/model/Plugin.py,sha256=a7gNmwbo6NxXF8iD1QJA4IUClkgpByDMPfL_4VLWhTs,1193
|
|
33
33
|
ose/model/Relation.py,sha256=wpCowTq_ypODkUHz1GCyAEF1iKF_RFkycQBhrdl_ruU,3027
|
|
34
34
|
ose/model/ReleaseScript.py,sha256=wlWqa1AfcfuQ4OGtaNTs8A72rDKu3RJ5mMIsIGB1K-0,3152
|
|
35
35
|
ose/model/RepositoryConfiguration.py,sha256=WgUhzAWJjJm59oiCsjryGiVkSfDSiPxI6AT-Bc0o5as,1030
|
|
36
|
-
ose/model/Result.py,sha256=
|
|
36
|
+
ose/model/Result.py,sha256=i-DolUQePFUNkdrZpY-Ja3ywMv1pQBYrse70w5jtHrI,1869
|
|
37
37
|
ose/model/Schema.py,sha256=yxIL0XOBPxIHunf7eE2OZtJWuR5HpCWYTcO-qqn7FwY,5246
|
|
38
38
|
ose/model/Script.py,sha256=WPy2St8RqV28UqGwnXZ0IXSDO7LWomeXyoLwKqCnvF4,1316
|
|
39
39
|
ose/model/ScriptArgument.py,sha256=WqSewUlX_yftS5TMoc4PKMiuCO2CoDP5ZjGkt9PRQmg,231
|
|
@@ -64,7 +64,7 @@ ose/services/validation.py,sha256=mX13B1MXLJjYQKYlNEUZZdp5NUhsmvafnyUjY4ThXuQ,41
|
|
|
64
64
|
ose/utils/__init__.py,sha256=KhtiHuTaXFSgcxdiu4_t3fdFDYAk0MRAjAyMUfKhKyg,424
|
|
65
65
|
ose/utils/github.py,sha256=F1iLtsRZ6K9uwZHOkJIXeE_dYluEuWnh7TFjwfNy10Y,5549
|
|
66
66
|
ose/utils/strings.py,sha256=FQYmVM0BYEWr7v75Xo4aEbJ8UH2ZfKbEkvlYRZYL0qg,1121
|
|
67
|
-
ose_core-0.3.
|
|
68
|
-
ose_core-0.3.
|
|
69
|
-
ose_core-0.3.
|
|
70
|
-
ose_core-0.3.
|
|
67
|
+
ose_core-0.3.1.dist-info/METADATA,sha256=CPwOesoOtsUj2CajwWjYFkD9N-6BTpV5MUm5qmkFkXw,701
|
|
68
|
+
ose_core-0.3.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
69
|
+
ose_core-0.3.1.dist-info/top_level.txt,sha256=lGLXZhNj751T-U5rANtbOWJjQUBRQP7tjGeVlg9Xb1s,4
|
|
70
|
+
ose_core-0.3.1.dist-info/RECORD,,
|
|
File without changes
|