esgvoc 0.3.0__py3-none-any.whl → 0.4.0__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 esgvoc might be problematic. Click here for more details.
- esgvoc/__init__.py +1 -1
- esgvoc/api/__init__.py +95 -60
- esgvoc/api/project_specs.py +3 -2
- esgvoc/api/projects.py +671 -406
- esgvoc/api/py.typed +0 -0
- esgvoc/api/report.py +12 -8
- esgvoc/api/search.py +141 -98
- esgvoc/api/universe.py +353 -157
- esgvoc/apps/drs/constants.py +1 -1
- esgvoc/apps/drs/generator.py +51 -69
- esgvoc/apps/drs/report.py +60 -15
- esgvoc/apps/drs/validator.py +60 -71
- esgvoc/apps/py.typed +0 -0
- esgvoc/cli/drs.py +3 -2
- esgvoc/cli/get.py +9 -6
- esgvoc/core/constants.py +1 -1
- esgvoc/core/db/__init__.py +2 -4
- esgvoc/core/db/connection.py +5 -3
- esgvoc/core/db/models/project.py +50 -8
- esgvoc/core/db/models/universe.py +48 -9
- esgvoc/core/db/project_ingestion.py +60 -46
- esgvoc/core/db/universe_ingestion.py +55 -27
- esgvoc/core/exceptions.py +33 -0
- {esgvoc-0.3.0.dist-info → esgvoc-0.4.0.dist-info}/METADATA +1 -1
- {esgvoc-0.3.0.dist-info → esgvoc-0.4.0.dist-info}/RECORD +28 -26
- esgvoc/api/_utils.py +0 -53
- {esgvoc-0.3.0.dist-info → esgvoc-0.4.0.dist-info}/WHEEL +0 -0
- {esgvoc-0.3.0.dist-info → esgvoc-0.4.0.dist-info}/entry_points.txt +0 -0
- {esgvoc-0.3.0.dist-info → esgvoc-0.4.0.dist-info}/licenses/LICENSE.txt +0 -0
esgvoc/__init__.py
CHANGED
esgvoc/api/__init__.py
CHANGED
|
@@ -1,62 +1,97 @@
|
|
|
1
|
-
from esgvoc.api.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
from esgvoc.api.project_specs import (
|
|
2
|
+
DrsCollection,
|
|
3
|
+
DrsConstant,
|
|
4
|
+
DrsPart,
|
|
5
|
+
DrsPartKind,
|
|
6
|
+
DrsSpecification,
|
|
7
|
+
DrsType,
|
|
8
|
+
ProjectSpecs,
|
|
9
|
+
)
|
|
5
10
|
from esgvoc.api.projects import (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
find_collections_in_project,
|
|
12
|
+
find_items_in_project,
|
|
13
|
+
find_terms_in_all_projects,
|
|
14
|
+
find_terms_in_collection,
|
|
15
|
+
find_terms_in_project,
|
|
16
|
+
get_all_collections_in_project,
|
|
17
|
+
get_all_projects,
|
|
18
|
+
get_all_terms_in_all_projects,
|
|
19
|
+
get_all_terms_in_collection,
|
|
20
|
+
get_all_terms_in_project,
|
|
21
|
+
get_collection_from_data_descriptor_in_all_projects,
|
|
22
|
+
get_collection_from_data_descriptor_in_project,
|
|
23
|
+
get_collection_in_project,
|
|
24
|
+
get_project,
|
|
25
|
+
get_term_in_collection,
|
|
26
|
+
get_term_in_project,
|
|
27
|
+
valid_term,
|
|
28
|
+
valid_term_in_all_projects,
|
|
29
|
+
valid_term_in_collection,
|
|
30
|
+
valid_term_in_project,
|
|
31
|
+
)
|
|
32
|
+
from esgvoc.api.report import (
|
|
33
|
+
ProjectTermError,
|
|
34
|
+
UniverseTermError,
|
|
35
|
+
ValidationError,
|
|
36
|
+
ValidationErrorVisitor,
|
|
37
|
+
ValidationReport,
|
|
38
|
+
)
|
|
39
|
+
from esgvoc.api.search import MatchingTerm
|
|
40
|
+
from esgvoc.api.universe import (
|
|
41
|
+
find_data_descriptors_in_universe,
|
|
42
|
+
find_items_in_universe,
|
|
43
|
+
find_terms_in_data_descriptor,
|
|
44
|
+
find_terms_in_universe,
|
|
45
|
+
get_all_data_descriptors_in_universe,
|
|
46
|
+
get_all_terms_in_data_descriptor,
|
|
47
|
+
get_all_terms_in_universe,
|
|
48
|
+
get_data_descriptor_in_universe,
|
|
49
|
+
get_term_in_data_descriptor,
|
|
50
|
+
get_term_in_universe,
|
|
51
|
+
)
|
|
24
52
|
|
|
25
|
-
__all__ = [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
__all__ = [
|
|
54
|
+
"DrsCollection",
|
|
55
|
+
"DrsConstant",
|
|
56
|
+
"DrsPart",
|
|
57
|
+
"DrsPartKind",
|
|
58
|
+
"DrsSpecification",
|
|
59
|
+
"DrsType",
|
|
60
|
+
"find_collections_in_project",
|
|
61
|
+
"find_data_descriptors_in_universe",
|
|
62
|
+
"find_items_in_project",
|
|
63
|
+
"find_items_in_universe",
|
|
64
|
+
"find_terms_in_all_projects",
|
|
65
|
+
"find_terms_in_collection",
|
|
66
|
+
"find_terms_in_data_descriptor",
|
|
67
|
+
"find_terms_in_project",
|
|
68
|
+
"find_terms_in_universe",
|
|
69
|
+
"get_all_collections_in_project",
|
|
70
|
+
"get_all_data_descriptors_in_universe",
|
|
71
|
+
"get_all_projects",
|
|
72
|
+
"get_all_terms_in_all_projects",
|
|
73
|
+
"get_all_terms_in_collection",
|
|
74
|
+
"get_all_terms_in_data_descriptor",
|
|
75
|
+
"get_all_terms_in_project",
|
|
76
|
+
"get_all_terms_in_universe",
|
|
77
|
+
"get_collection_from_data_descriptor_in_all_projects",
|
|
78
|
+
"get_collection_from_data_descriptor_in_project",
|
|
79
|
+
"get_collection_in_project",
|
|
80
|
+
"get_data_descriptor_in_universe",
|
|
81
|
+
"get_project",
|
|
82
|
+
"get_term_in_collection",
|
|
83
|
+
"get_term_in_data_descriptor",
|
|
84
|
+
"get_term_in_project",
|
|
85
|
+
"get_term_in_universe",
|
|
86
|
+
"MatchingTerm",
|
|
87
|
+
"ProjectSpecs",
|
|
88
|
+
"ProjectTermError",
|
|
89
|
+
"UniverseTermError",
|
|
90
|
+
"valid_term",
|
|
91
|
+
"valid_term_in_all_projects",
|
|
92
|
+
"valid_term_in_collection",
|
|
93
|
+
"valid_term_in_project",
|
|
94
|
+
"ValidationError",
|
|
95
|
+
"ValidationErrorVisitor",
|
|
96
|
+
"ValidationReport"
|
|
97
|
+
]
|
esgvoc/api/project_specs.py
CHANGED
|
@@ -64,11 +64,12 @@ class DrsSpecification(BaseModel):
|
|
|
64
64
|
"""The type of the specification."""
|
|
65
65
|
separator: str
|
|
66
66
|
"""The textual separator string or character."""
|
|
67
|
-
properties: dict|None = None
|
|
67
|
+
properties: dict | None = None
|
|
68
68
|
"""The other specifications (e.g., file name extension for file name DRS specification)."""
|
|
69
69
|
parts: list[DrsPart]
|
|
70
70
|
"""The parts of the DRS specification."""
|
|
71
71
|
|
|
72
|
+
|
|
72
73
|
class ProjectSpecs(BaseModel):
|
|
73
74
|
"""
|
|
74
75
|
A project specifications.
|
|
@@ -79,4 +80,4 @@ class ProjectSpecs(BaseModel):
|
|
|
79
80
|
"""The description of the project."""
|
|
80
81
|
drs_specs: list[DrsSpecification]
|
|
81
82
|
"""The DRS specifications of the project (directory, file name and dataset id."""
|
|
82
|
-
model_config = ConfigDict(extra
|
|
83
|
+
model_config = ConfigDict(extra="allow")
|