dapla-toolbelt-metadata 0.2.1__py3-none-any.whl → 0.9.11__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 dapla-toolbelt-metadata might be problematic. Click here for more details.
- dapla_metadata/__init__.py +11 -1
- dapla_metadata/_shared/__init__.py +1 -0
- dapla_metadata/_shared/config.py +109 -0
- dapla_metadata/_shared/enums.py +27 -0
- dapla_metadata/_shared/py.typed +0 -0
- dapla_metadata/dapla/__init__.py +4 -0
- dapla_metadata/dapla/user_info.py +138 -0
- dapla_metadata/datasets/__init__.py +1 -1
- dapla_metadata/datasets/_merge.py +333 -0
- dapla_metadata/datasets/code_list.py +5 -6
- dapla_metadata/datasets/compatibility/__init__.py +10 -0
- dapla_metadata/datasets/compatibility/_handlers.py +363 -0
- dapla_metadata/datasets/compatibility/_utils.py +259 -0
- dapla_metadata/datasets/compatibility/model_backwards_compatibility.py +135 -0
- dapla_metadata/datasets/core.py +136 -182
- dapla_metadata/datasets/dapla_dataset_path_info.py +145 -19
- dapla_metadata/datasets/dataset_parser.py +41 -28
- dapla_metadata/datasets/model_validation.py +29 -20
- dapla_metadata/datasets/statistic_subject_mapping.py +5 -1
- dapla_metadata/datasets/utility/constants.py +22 -15
- dapla_metadata/datasets/utility/enums.py +8 -20
- dapla_metadata/datasets/utility/urn.py +234 -0
- dapla_metadata/datasets/utility/utils.py +183 -111
- dapla_metadata/standards/__init__.py +4 -0
- dapla_metadata/standards/name_validator.py +250 -0
- dapla_metadata/standards/standard_validators.py +98 -0
- dapla_metadata/standards/utils/__init__.py +1 -0
- dapla_metadata/standards/utils/constants.py +49 -0
- dapla_metadata/variable_definitions/__init__.py +11 -0
- dapla_metadata/variable_definitions/_generated/.openapi-generator/FILES +20 -0
- dapla_metadata/variable_definitions/_generated/.openapi-generator/VERSION +1 -0
- dapla_metadata/variable_definitions/_generated/.openapi-generator-ignore +6 -0
- dapla_metadata/variable_definitions/_generated/README.md +148 -0
- dapla_metadata/variable_definitions/_generated/__init__.py +0 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/__init__.py +47 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api/__init__.py +8 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api/data_migration_api.py +766 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api/draft_variable_definitions_api.py +888 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api/patches_api.py +888 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api/validity_periods_api.py +583 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api/variable_definitions_api.py +613 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api_client.py +779 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api_response.py +27 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/configuration.py +474 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/CompleteResponse.md +51 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/Contact.md +30 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/DataMigrationApi.md +90 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/Draft.md +42 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/DraftVariableDefinitionsApi.md +259 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/LanguageStringType.md +31 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/Owner.md +31 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/Patch.md +43 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/PatchesApi.md +249 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/PublicApi.md +218 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/SupportedLanguages.md +15 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/UpdateDraft.md +44 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/ValidityPeriod.md +42 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/ValidityPeriodsApi.md +236 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/VariableDefinitionsApi.md +304 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/VariableStatus.md +17 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/exceptions.py +193 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/__init__.py +31 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/complete_response.py +260 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/contact.py +94 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/draft.py +228 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/get_vardok_vardef_mapping_by_id200_response.py +158 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/language_string_type.py +101 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/owner.py +87 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/patch.py +244 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/problem.py +118 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/update_draft.py +274 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/validity_period.py +225 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/vardok_id_response.py +81 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/vardok_vardef_id_pair_response.py +84 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/variable_status.py +33 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/py.typed +0 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/rest.py +249 -0
- dapla_metadata/variable_definitions/_utils/__init__.py +1 -0
- dapla_metadata/variable_definitions/_utils/_client.py +32 -0
- dapla_metadata/variable_definitions/_utils/config.py +54 -0
- dapla_metadata/variable_definitions/_utils/constants.py +80 -0
- dapla_metadata/variable_definitions/_utils/files.py +309 -0
- dapla_metadata/variable_definitions/_utils/template_files.py +99 -0
- dapla_metadata/variable_definitions/_utils/variable_definition_files.py +143 -0
- dapla_metadata/variable_definitions/exceptions.py +255 -0
- dapla_metadata/variable_definitions/vardef.py +372 -0
- dapla_metadata/variable_definitions/vardok_id.py +48 -0
- dapla_metadata/variable_definitions/vardok_vardef_id_pair.py +47 -0
- dapla_metadata/variable_definitions/variable_definition.py +422 -0
- {dapla_toolbelt_metadata-0.2.1.dist-info → dapla_toolbelt_metadata-0.9.11.dist-info}/METADATA +34 -36
- dapla_toolbelt_metadata-0.9.11.dist-info/RECORD +97 -0
- {dapla_toolbelt_metadata-0.2.1.dist-info → dapla_toolbelt_metadata-0.9.11.dist-info}/WHEEL +1 -1
- dapla_metadata/datasets/config.py +0 -80
- dapla_metadata/datasets/model_backwards_compatibility.py +0 -520
- dapla_metadata/datasets/user_info.py +0 -88
- dapla_toolbelt_metadata-0.2.1.dist-info/RECORD +0 -22
- {dapla_toolbelt_metadata-0.2.1.dist-info → dapla_toolbelt_metadata-0.9.11.dist-info/licenses}/LICENSE +0 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import logging
|
|
3
|
+
import os
|
|
4
|
+
import re
|
|
5
|
+
from collections.abc import AsyncGenerator
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
from dapla_metadata.datasets.dapla_dataset_path_info import DaplaDatasetPathInfo
|
|
9
|
+
from dapla_metadata.datasets.dataset_parser import SUPPORTED_DATASET_FILE_SUFFIXES
|
|
10
|
+
from dapla_metadata.standards.utils.constants import FILE_DOES_NOT_EXIST
|
|
11
|
+
from dapla_metadata.standards.utils.constants import FILE_IGNORED
|
|
12
|
+
from dapla_metadata.standards.utils.constants import IGNORED_FOLDERS
|
|
13
|
+
from dapla_metadata.standards.utils.constants import INVALID_SYMBOLS
|
|
14
|
+
from dapla_metadata.standards.utils.constants import MISSING_DATA_STATE
|
|
15
|
+
from dapla_metadata.standards.utils.constants import MISSING_DATASET_SHORT_NAME
|
|
16
|
+
from dapla_metadata.standards.utils.constants import MISSING_PERIOD
|
|
17
|
+
from dapla_metadata.standards.utils.constants import MISSING_SHORT_NAME
|
|
18
|
+
from dapla_metadata.standards.utils.constants import MISSING_VERSION
|
|
19
|
+
from dapla_metadata.standards.utils.constants import NAME_STANDARD_SUCCESS
|
|
20
|
+
from dapla_metadata.standards.utils.constants import NAME_STANDARD_VIOLATION
|
|
21
|
+
from dapla_metadata.standards.utils.constants import PATH_IGNORED
|
|
22
|
+
from dapla_metadata.standards.utils.constants import SSB_NAMING_STANDARD_REPORT
|
|
23
|
+
from dapla_metadata.standards.utils.constants import SSB_NAMING_STANDARD_REPORT_FILES
|
|
24
|
+
from dapla_metadata.standards.utils.constants import (
|
|
25
|
+
SSB_NAMING_STANDARD_REPORT_RESULT_AVERAGE,
|
|
26
|
+
)
|
|
27
|
+
from dapla_metadata.standards.utils.constants import (
|
|
28
|
+
SSB_NAMING_STANDARD_REPORT_RESULT_BEST,
|
|
29
|
+
)
|
|
30
|
+
from dapla_metadata.standards.utils.constants import (
|
|
31
|
+
SSB_NAMING_STANDARD_REPORT_RESULT_GOOD,
|
|
32
|
+
)
|
|
33
|
+
from dapla_metadata.standards.utils.constants import (
|
|
34
|
+
SSB_NAMING_STANDARD_REPORT_RESULT_LOW,
|
|
35
|
+
)
|
|
36
|
+
from dapla_metadata.standards.utils.constants import (
|
|
37
|
+
SSB_NAMING_STANDARD_REPORT_RESULT_NO_SCORE,
|
|
38
|
+
)
|
|
39
|
+
from dapla_metadata.standards.utils.constants import SSB_NAMING_STANDARD_REPORT_SUCCESS
|
|
40
|
+
from dapla_metadata.standards.utils.constants import (
|
|
41
|
+
SSB_NAMING_STANDARD_REPORT_SUCCESS_RATE,
|
|
42
|
+
)
|
|
43
|
+
from dapla_metadata.standards.utils.constants import (
|
|
44
|
+
SSB_NAMING_STANDARD_REPORT_VIOLATIONS,
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
logger = logging.getLogger(__name__)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class ValidationResult:
|
|
51
|
+
"""Result object for name standard validation."""
|
|
52
|
+
|
|
53
|
+
def __init__(
|
|
54
|
+
self,
|
|
55
|
+
success: bool,
|
|
56
|
+
file_path: str,
|
|
57
|
+
) -> None:
|
|
58
|
+
"""Initialize the validatation result."""
|
|
59
|
+
self.success = success
|
|
60
|
+
self.file_path = file_path
|
|
61
|
+
self.messages: list[str] = []
|
|
62
|
+
self.violations: list[str] = []
|
|
63
|
+
|
|
64
|
+
def add_message(self, message: str) -> None:
|
|
65
|
+
"""Add message to list."""
|
|
66
|
+
if message not in self.messages:
|
|
67
|
+
self.messages.append(message)
|
|
68
|
+
|
|
69
|
+
def add_violation(self, violation: str) -> None:
|
|
70
|
+
"""Add violation to list."""
|
|
71
|
+
if violation not in self.violations:
|
|
72
|
+
self.violations.append(violation)
|
|
73
|
+
if self.success:
|
|
74
|
+
self.success = False
|
|
75
|
+
|
|
76
|
+
def __repr__(self) -> str:
|
|
77
|
+
"""Representation for debugging."""
|
|
78
|
+
return f"ValidationResult(success={self.success}, file_path={self.file_path}, messages={self.messages}, violations={self.violations})"
|
|
79
|
+
|
|
80
|
+
def to_dict(self) -> dict:
|
|
81
|
+
"""Return result as a dictionary."""
|
|
82
|
+
return {
|
|
83
|
+
"success": self.success,
|
|
84
|
+
"file_path": self.file_path,
|
|
85
|
+
"messages": self.messages,
|
|
86
|
+
"violations": self.violations,
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class NamingStandardReport:
|
|
91
|
+
"""Report object for name standard validation."""
|
|
92
|
+
|
|
93
|
+
def __init__(self, validation_results: list[ValidationResult]) -> None:
|
|
94
|
+
"""Initialize the naming standard report."""
|
|
95
|
+
self.validation_results = validation_results
|
|
96
|
+
self.num_files_validated = len(validation_results)
|
|
97
|
+
self.num_success = len(
|
|
98
|
+
[result for result in validation_results if result.success is True],
|
|
99
|
+
)
|
|
100
|
+
self.num_failures = len(
|
|
101
|
+
[result for result in validation_results if result.success is False],
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
def generate_report(self) -> str:
|
|
105
|
+
"""Format the report as a string."""
|
|
106
|
+
return (
|
|
107
|
+
f"{SSB_NAMING_STANDARD_REPORT}\n"
|
|
108
|
+
f"=============================\n"
|
|
109
|
+
f"{self.evaluate_result()}"
|
|
110
|
+
f"{SSB_NAMING_STANDARD_REPORT_SUCCESS_RATE}: {self.success_rate():.2f}%\n"
|
|
111
|
+
f"{SSB_NAMING_STANDARD_REPORT_FILES}: {self.num_files_validated}\n"
|
|
112
|
+
f"{SSB_NAMING_STANDARD_REPORT_SUCCESS}: {self.num_success}\n"
|
|
113
|
+
f"{SSB_NAMING_STANDARD_REPORT_VIOLATIONS}s: {self.num_failures}\n"
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
def success_rate(self) -> int | float | None:
|
|
117
|
+
"""Calculate the success rate as a percentage.
|
|
118
|
+
|
|
119
|
+
Returns:
|
|
120
|
+
int | float | None: The success rate as a percentage, or None if
|
|
121
|
+
no files were validated.
|
|
122
|
+
"""
|
|
123
|
+
if self.num_files_validated == 0:
|
|
124
|
+
return None
|
|
125
|
+
return self.num_success / self.num_files_validated * 100
|
|
126
|
+
|
|
127
|
+
def evaluate_result(self) -> str:
|
|
128
|
+
"""Returns an appropriate message based on the success rate."""
|
|
129
|
+
rate = self.success_rate()
|
|
130
|
+
if rate is not None:
|
|
131
|
+
if 95 <= rate <= 100:
|
|
132
|
+
return SSB_NAMING_STANDARD_REPORT_RESULT_BEST
|
|
133
|
+
if 70 < rate < 95:
|
|
134
|
+
return SSB_NAMING_STANDARD_REPORT_RESULT_GOOD
|
|
135
|
+
if 40 <= rate <= 70:
|
|
136
|
+
return SSB_NAMING_STANDARD_REPORT_RESULT_AVERAGE
|
|
137
|
+
if rate < 40:
|
|
138
|
+
return SSB_NAMING_STANDARD_REPORT_RESULT_LOW
|
|
139
|
+
return SSB_NAMING_STANDARD_REPORT_RESULT_NO_SCORE
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def _has_invalid_symbols(path: os.PathLike[str]) -> bool:
|
|
143
|
+
"""Return True if string contains illegal symbols.
|
|
144
|
+
|
|
145
|
+
Examples:
|
|
146
|
+
>>> _has_invalid_symbols("åregang-øre")
|
|
147
|
+
True
|
|
148
|
+
|
|
149
|
+
>>> _has_invalid_symbols("Azor89")
|
|
150
|
+
False
|
|
151
|
+
|
|
152
|
+
>>> _has_invalid_symbols("ssbÆ-dapla-example-data-produkt-prod/ledstill/oppdrag/skjema_p2018_p2020_v1")
|
|
153
|
+
True
|
|
154
|
+
|
|
155
|
+
>>> _has_invalid_symbols("ssb-dapla-example-data-produkt-prod/ledstill/oppdrag/skjema_p2018_p2020_v1")
|
|
156
|
+
False
|
|
157
|
+
|
|
158
|
+
>>> _has_invalid_symbols("ssb-dapla-example-data-produkt-prod/ledstill/inndata/skjema_p2018_p202_v1/aar=2018/data.parquet")
|
|
159
|
+
False
|
|
160
|
+
"""
|
|
161
|
+
# TODO @mmwinther: The = symbol is allowed to avoid failures on subdirectories of partioned parquet datasets.
|
|
162
|
+
# DPMETA-824
|
|
163
|
+
return bool(re.search(r"[^a-zA-Z0-9\./:_\-=]", str(path).strip()))
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
def _check_violations(
|
|
167
|
+
file: Path,
|
|
168
|
+
) -> list[str]:
|
|
169
|
+
"""Check for missing attributes and invalid symbols."""
|
|
170
|
+
path_info = DaplaDatasetPathInfo(file)
|
|
171
|
+
checks = {
|
|
172
|
+
MISSING_SHORT_NAME: path_info.statistic_short_name,
|
|
173
|
+
MISSING_DATA_STATE: path_info.dataset_state,
|
|
174
|
+
MISSING_PERIOD: path_info.contains_data_from,
|
|
175
|
+
MISSING_DATASET_SHORT_NAME: path_info.dataset_short_name,
|
|
176
|
+
MISSING_VERSION: path_info.dataset_version,
|
|
177
|
+
INVALID_SYMBOLS: not _has_invalid_symbols(file),
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return [message for message, value in checks.items() if not value]
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
async def _validate_file(
|
|
184
|
+
file: Path,
|
|
185
|
+
check_file_exists: bool = False,
|
|
186
|
+
) -> ValidationResult:
|
|
187
|
+
"""Check for naming standard violations.
|
|
188
|
+
|
|
189
|
+
Returns:
|
|
190
|
+
A ValidationResult object containing messages and violations
|
|
191
|
+
"""
|
|
192
|
+
logger.info("Validating file: %s", file)
|
|
193
|
+
if file.suffix not in SUPPORTED_DATASET_FILE_SUFFIXES:
|
|
194
|
+
logger.info("Skipping validation on non-dataset file: %s", file)
|
|
195
|
+
return await _ignored_file_type_result(file)
|
|
196
|
+
|
|
197
|
+
result = ValidationResult(success=True, file_path=str(file))
|
|
198
|
+
|
|
199
|
+
if check_file_exists and not file.exists():
|
|
200
|
+
result.add_message(
|
|
201
|
+
FILE_DOES_NOT_EXIST,
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
result.violations = await asyncio.get_running_loop().run_in_executor(
|
|
205
|
+
None,
|
|
206
|
+
lambda: _check_violations(file),
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
if result.violations:
|
|
210
|
+
result.success = False
|
|
211
|
+
result.add_message(NAME_STANDARD_VIOLATION)
|
|
212
|
+
else:
|
|
213
|
+
result.success = True
|
|
214
|
+
result.add_message(
|
|
215
|
+
NAME_STANDARD_SUCCESS,
|
|
216
|
+
)
|
|
217
|
+
return result
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
async def _ignored_folder_result(file: Path) -> ValidationResult:
|
|
221
|
+
r = ValidationResult(success=True, file_path=str(file))
|
|
222
|
+
r.add_message(PATH_IGNORED)
|
|
223
|
+
return r
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
async def _ignored_file_type_result(file: Path) -> ValidationResult:
|
|
227
|
+
r = ValidationResult(success=True, file_path=str(file))
|
|
228
|
+
r.add_message(FILE_IGNORED)
|
|
229
|
+
return r
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
async def validate_directory(
|
|
233
|
+
path: Path,
|
|
234
|
+
) -> AsyncGenerator[AsyncGenerator | asyncio.Task]:
|
|
235
|
+
"""Validate a file or recursively validate all files in a directory."""
|
|
236
|
+
if set(path.parts).intersection(IGNORED_FOLDERS):
|
|
237
|
+
logger.info("File path ignored: %s", path)
|
|
238
|
+
yield asyncio.create_task(_ignored_folder_result(path))
|
|
239
|
+
elif path.suffix:
|
|
240
|
+
yield asyncio.create_task(_validate_file(path, check_file_exists=True))
|
|
241
|
+
else:
|
|
242
|
+
for obj in await asyncio.get_running_loop().run_in_executor(
|
|
243
|
+
None,
|
|
244
|
+
lambda: path.glob("*"),
|
|
245
|
+
):
|
|
246
|
+
if obj.suffix:
|
|
247
|
+
yield asyncio.create_task(_validate_file(obj), name=obj.name)
|
|
248
|
+
else:
|
|
249
|
+
logger.debug("Recursing into: %s", obj)
|
|
250
|
+
yield validate_directory(obj)
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import logging
|
|
3
|
+
import os
|
|
4
|
+
import time
|
|
5
|
+
from collections.abc import AsyncGenerator
|
|
6
|
+
|
|
7
|
+
from dapla_metadata.datasets.utility.utils import normalize_path
|
|
8
|
+
from dapla_metadata.standards.name_validator import NamingStandardReport
|
|
9
|
+
from dapla_metadata.standards.name_validator import ValidationResult
|
|
10
|
+
from dapla_metadata.standards.name_validator import validate_directory
|
|
11
|
+
|
|
12
|
+
logger = logging.getLogger(__name__)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
async def check_naming_standard(
|
|
16
|
+
file_path: str | os.PathLike[str],
|
|
17
|
+
) -> list[ValidationResult]:
|
|
18
|
+
"""Check whether a given path follows the SSB naming standard.
|
|
19
|
+
|
|
20
|
+
This function checks whether the provided `file_path` and subdirectories thereof comply
|
|
21
|
+
with the naming standard. Currently we only examine '.parquet' files. Other files are ignored.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
file_path: The path to a bucket, directory, or specific file to validate.
|
|
25
|
+
This can be in the following forms:
|
|
26
|
+
- A bucket URL in the form 'gs://ssb-dapla-felles-data-produkt-test'
|
|
27
|
+
- An absolute path to a mounted bucket in the form '/buckets/produkt'
|
|
28
|
+
- Any subdirectory or file thereof
|
|
29
|
+
We also accept paths which don't yet exist so that you can test if a path will comply.
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
list[ValidationResult]: A list of validation results,
|
|
33
|
+
including success status, checked file path, messages, and any detected violations.
|
|
34
|
+
|
|
35
|
+
Examples:
|
|
36
|
+
>>> check_naming_standard("/data/example_file.parquet").success
|
|
37
|
+
False
|
|
38
|
+
|
|
39
|
+
>>> check_naming_standard("/buckets/produkt/datadoc/utdata/person_data_p2021_v2.parquet").success
|
|
40
|
+
True
|
|
41
|
+
"""
|
|
42
|
+
results = []
|
|
43
|
+
|
|
44
|
+
# Begin validation.
|
|
45
|
+
# For each file this returns a task which we can wait on to complete.
|
|
46
|
+
# For each directory this returns another AsyncGenerator which must be unpacked below
|
|
47
|
+
tasks = [t async for t in validate_directory(normalize_path(str(file_path)))] # type:ignore [arg-type]
|
|
48
|
+
|
|
49
|
+
# 5 minute timeout for safety
|
|
50
|
+
start_time = time.time()
|
|
51
|
+
while time.time() < start_time + (5 * 60):
|
|
52
|
+
for item in tasks:
|
|
53
|
+
if isinstance(item, AsyncGenerator):
|
|
54
|
+
# Drill down into lower directories to get the validation tasks from them
|
|
55
|
+
tasks.remove(item)
|
|
56
|
+
new_tasks = [t async for t in item]
|
|
57
|
+
logger.debug("New Tasks: %s %s", len(new_tasks), new_tasks)
|
|
58
|
+
tasks.extend(
|
|
59
|
+
new_tasks,
|
|
60
|
+
)
|
|
61
|
+
elif isinstance(item, asyncio.Task):
|
|
62
|
+
if item.done():
|
|
63
|
+
logger.info("Validated %s", item.get_name())
|
|
64
|
+
tasks.remove(item)
|
|
65
|
+
results.append(item.result())
|
|
66
|
+
|
|
67
|
+
logger.debug("Tasks: %s %s", len(tasks), tasks)
|
|
68
|
+
logger.debug("Results: %s", len(results))
|
|
69
|
+
|
|
70
|
+
if len(tasks) == 0:
|
|
71
|
+
logger.info("Completed validation")
|
|
72
|
+
break
|
|
73
|
+
|
|
74
|
+
# Allow time for other processing to be performed
|
|
75
|
+
await asyncio.sleep(0.001)
|
|
76
|
+
|
|
77
|
+
return results
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def generate_validation_report(
|
|
81
|
+
validation_results: list[ValidationResult],
|
|
82
|
+
) -> NamingStandardReport:
|
|
83
|
+
"""Generate and print a formatted naming standard validation report.
|
|
84
|
+
|
|
85
|
+
This function takes a list of `ValidationResult` objects, creates a
|
|
86
|
+
`NamingStandardReport` instance, and prints the generated report.
|
|
87
|
+
|
|
88
|
+
Args:
|
|
89
|
+
validation_results: A list of ValidationResult objects that
|
|
90
|
+
contain the outcomes of the name standard checks.
|
|
91
|
+
|
|
92
|
+
Returns:
|
|
93
|
+
NamingStandardReport: An instance of `NamingStandardReport` containing
|
|
94
|
+
the validation results.
|
|
95
|
+
"""
|
|
96
|
+
report = NamingStandardReport(validation_results=validation_results)
|
|
97
|
+
print(report.generate_report()) # noqa: T201
|
|
98
|
+
return report
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Utils for validating ssb standards."""
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"""Constants used in validate ssb name standard."""
|
|
2
|
+
|
|
3
|
+
from dapla_metadata.datasets.dataset_parser import SUPPORTED_DATASET_FILE_SUFFIXES
|
|
4
|
+
|
|
5
|
+
SUCCESS = "Suksess"
|
|
6
|
+
|
|
7
|
+
NAME_STANDARD_SUCCESS = "Filene dine er i samsvar med SSB-navnestandarden"
|
|
8
|
+
|
|
9
|
+
NAME_STANDARD_VIOLATION = "Det er oppdaget brudd på SSB-navnestandard:"
|
|
10
|
+
|
|
11
|
+
MISSING_BUCKET_NAME = "Filnavn mangler bøttenavn ref: https://manual.dapla.ssb.no/statistikkere/navnestandard.html#obligatoriske-mapper"
|
|
12
|
+
MISSING_VERSION = "Filnavn mangler versjon, hvis ikke filen er nyeste versjon kan dette være brudd på navnestandarden ref: https://manual.dapla.ssb.no/statistikkere/navnestandard.html#versjonering-av-datasett"
|
|
13
|
+
MISSING_PERIOD = "Filnavn mangler gyldighetsperiode ref: https://manual.dapla.ssb.no/statistikkere/navnestandard.html#filnavn"
|
|
14
|
+
MISSING_SHORT_NAME = "Kortnavn for statistikk mangler ref: https://manual.dapla.ssb.no/statistikkere/navnestandard.html#obligatoriske-mapper"
|
|
15
|
+
MISSING_DATA_STATE = "Mappe for datatilstand mangler ref: https://manual.dapla.ssb.no/statistikkere/navnestandard.html#obligatoriske-mapper"
|
|
16
|
+
MISSING_DATASET_SHORT_NAME = "Filnavn mangler datasett kortnavn ref: https://manual.dapla.ssb.no/statistikkere/navnestandard.html#filnavn"
|
|
17
|
+
|
|
18
|
+
INVALID_SYMBOLS = "Filnavn inneholder ulovlige tegn ref: https://manual.dapla.ssb.no/statistikkere/navnestandard.html#filnavn"
|
|
19
|
+
|
|
20
|
+
PATH_IGNORED = "Ignorert, mappen er ikke underlagt krav til navnestandard."
|
|
21
|
+
FILE_IGNORED = f"Ignorert, kun datasett med {', '.join(SUPPORTED_DATASET_FILE_SUFFIXES.keys())} filendelser valideres foreløpig."
|
|
22
|
+
|
|
23
|
+
FILE_DOES_NOT_EXIST = "Filen eksisterer ikke. Validerer uansett."
|
|
24
|
+
|
|
25
|
+
BUCKET_NAME_UNKNOWN = "Kan ikke validere bøttenavn"
|
|
26
|
+
|
|
27
|
+
SSB_NAMING_STANDARD_REPORT = "SSB navnestandard rapport"
|
|
28
|
+
SSB_NAMING_STANDARD_REPORT_SUCCESS_RATE = "Suksess rate"
|
|
29
|
+
SSB_NAMING_STANDARD_REPORT_RESULT_BEST = "🚀 Fantastisk! 🎉\n"
|
|
30
|
+
SSB_NAMING_STANDARD_REPORT_RESULT_GOOD = (
|
|
31
|
+
"✅ Bra jobba! Fortsatt litt rom for forbedring. 😊\n"
|
|
32
|
+
)
|
|
33
|
+
SSB_NAMING_STANDARD_REPORT_RESULT_AVERAGE = (
|
|
34
|
+
"⚠️ Ikke verst! Men det er noen feil å fikse. 🔧\n"
|
|
35
|
+
)
|
|
36
|
+
SSB_NAMING_STANDARD_REPORT_RESULT_LOW = "❌ Mye å forbedre! Ta en grundig sjekk. 🛠️\n"
|
|
37
|
+
SSB_NAMING_STANDARD_REPORT_RESULT_NO_SCORE = "👀 Ingen filer ble validert\n"
|
|
38
|
+
SSB_NAMING_STANDARD_REPORT_FILES = "Antall filer validert"
|
|
39
|
+
SSB_NAMING_STANDARD_REPORT_SUCCESS = "Antall filer som følger SSB navnestandard"
|
|
40
|
+
SSB_NAMING_STANDARD_REPORT_VIOLATIONS = "Antall filer som bryter SSB navnestandard"
|
|
41
|
+
|
|
42
|
+
IGNORED_FOLDERS = [
|
|
43
|
+
"temp",
|
|
44
|
+
"oppdrag",
|
|
45
|
+
"konfigurasjon",
|
|
46
|
+
"logg",
|
|
47
|
+
"tidsserier",
|
|
48
|
+
"migrert",
|
|
49
|
+
]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""Client for working with Variable Definitions at Statistics Norway."""
|
|
2
|
+
|
|
3
|
+
from ._generated.vardef_client import models
|
|
4
|
+
from ._generated.vardef_client.exceptions import * # noqa: F403
|
|
5
|
+
from ._utils.constants import DEFAULT_DATE
|
|
6
|
+
from ._utils.constants import GENERATED_CONTACT
|
|
7
|
+
from .exceptions import VardefClientError
|
|
8
|
+
from .exceptions import VardefFileError
|
|
9
|
+
from .exceptions import VariableNotFoundError
|
|
10
|
+
from .vardef import Vardef
|
|
11
|
+
from .variable_definition import VariableDefinition
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
vardef_client/api/__init__.py
|
|
2
|
+
vardef_client/api/data_migration_api.py
|
|
3
|
+
vardef_client/api/draft_variable_definitions_api.py
|
|
4
|
+
vardef_client/api/patches_api.py
|
|
5
|
+
vardef_client/api/validity_periods_api.py
|
|
6
|
+
vardef_client/api/variable_definitions_api.py
|
|
7
|
+
vardef_client/models/__init__.py
|
|
8
|
+
vardef_client/models/complete_response.py
|
|
9
|
+
vardef_client/models/contact.py
|
|
10
|
+
vardef_client/models/draft.py
|
|
11
|
+
vardef_client/models/get_vardok_vardef_mapping_by_id200_response.py
|
|
12
|
+
vardef_client/models/language_string_type.py
|
|
13
|
+
vardef_client/models/owner.py
|
|
14
|
+
vardef_client/models/patch.py
|
|
15
|
+
vardef_client/models/problem.py
|
|
16
|
+
vardef_client/models/update_draft.py
|
|
17
|
+
vardef_client/models/validity_period.py
|
|
18
|
+
vardef_client/models/vardok_id_response.py
|
|
19
|
+
vardef_client/models/vardok_vardef_id_pair_response.py
|
|
20
|
+
vardef_client/models/variable_status.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7.11.0
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# vardef-client
|
|
2
|
+
|
|
3
|
+
No description provided (generated by Openapi Generator <https://github.com/openapitools/openapi-generator>)
|
|
4
|
+
|
|
5
|
+
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
|
6
|
+
|
|
7
|
+
- API version: 0.1
|
|
8
|
+
- Package version: 1.0.0
|
|
9
|
+
- Generator version: 7.9.0
|
|
10
|
+
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
|
|
11
|
+
|
|
12
|
+
## Requirements
|
|
13
|
+
|
|
14
|
+
Python 3.7+
|
|
15
|
+
|
|
16
|
+
## Installation & Usage
|
|
17
|
+
|
|
18
|
+
### pip install
|
|
19
|
+
|
|
20
|
+
If the python package is hosted on a repository, you can install directly using:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
pip install git+https://github.com/statisticsnorway/dapla-toolbelt-metadata.git
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/statisticsnorway/dapla-toolbelt-metadata.git`)
|
|
27
|
+
|
|
28
|
+
Then import the package:
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
import vardef_client
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Setuptools
|
|
35
|
+
|
|
36
|
+
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
python setup.py install --user
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
(or `sudo python setup.py install` to install the package for all users)
|
|
43
|
+
|
|
44
|
+
Then import the package:
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
import vardef_client
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Tests
|
|
51
|
+
|
|
52
|
+
Execute `pytest` to run the tests.
|
|
53
|
+
|
|
54
|
+
## Getting Started
|
|
55
|
+
|
|
56
|
+
Please follow the [installation procedure](#installation--usage) and then run the following:
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
|
|
60
|
+
import vardef_client
|
|
61
|
+
from vardef_client.rest import ApiException
|
|
62
|
+
from pprint import pprint
|
|
63
|
+
|
|
64
|
+
# Defining the host is optional and defaults to https://metadata.intern.test.ssb.no
|
|
65
|
+
# See configuration.py for a list of all supported configuration parameters.
|
|
66
|
+
configuration = vardef_client.Configuration(
|
|
67
|
+
host = "https://metadata.intern.test.ssb.no"
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
# The client must configure the authentication and authorization parameters
|
|
71
|
+
# in accordance with the API server security policy.
|
|
72
|
+
# Examples for each auth method are provided below, use the example that
|
|
73
|
+
# satisfies your auth use case.
|
|
74
|
+
|
|
75
|
+
# Configure Bearer authorization (JWT): Keycloak token
|
|
76
|
+
configuration = vardef_client.Configuration(
|
|
77
|
+
access_token = os.environ["BEARER_TOKEN"]
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
# Enter a context with an instance of the API client
|
|
82
|
+
with vardef_client.ApiClient(configuration) as api_client:
|
|
83
|
+
# Create an instance of the API class
|
|
84
|
+
api_instance = vardef_client.DataMigrationApi(api_client)
|
|
85
|
+
vardok_id = '1607' # str | The ID of the definition in Vardok.
|
|
86
|
+
active_group = 'dapla-felles-developers' # str | The group which the user currently represents.
|
|
87
|
+
|
|
88
|
+
try:
|
|
89
|
+
# Create a variable definition from a VarDok variable definition.
|
|
90
|
+
api_response = api_instance.create_variable_definition_from_var_dok(vardok_id, active_group)
|
|
91
|
+
print("The response of DataMigrationApi->create_variable_definition_from_var_dok:\n")
|
|
92
|
+
pprint(api_response)
|
|
93
|
+
except ApiException as e:
|
|
94
|
+
print("Exception when calling DataMigrationApi->create_variable_definition_from_var_dok: %s\n" % e)
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Documentation for API Endpoints
|
|
99
|
+
|
|
100
|
+
All URIs are relative to *<https://metadata.intern.test.ssb.no>*
|
|
101
|
+
|
|
102
|
+
Class | Method | HTTP request | Description
|
|
103
|
+
------------ | ------------- | ------------- | -------------
|
|
104
|
+
*DataMigrationApi* | [**create_variable_definition_from_var_dok**](vardef_client/docs/DataMigrationApi.md#create_variable_definition_from_var_dok) | **POST** /vardok-migration/{vardok-id} | Create a variable definition from a VarDok variable definition.
|
|
105
|
+
*DraftVariableDefinitionsApi* | [**create_variable_definition**](vardef_client/docs/DraftVariableDefinitionsApi.md#create_variable_definition) | **POST** /variable-definitions | Create a variable definition.
|
|
106
|
+
*DraftVariableDefinitionsApi* | [**delete_variable_definition_by_id**](vardef_client/docs/DraftVariableDefinitionsApi.md#delete_variable_definition_by_id) | **DELETE** /variable-definitions/{variable-definition-id} | Delete a variable definition.
|
|
107
|
+
*DraftVariableDefinitionsApi* | [**update_variable_definition_by_id**](vardef_client/docs/DraftVariableDefinitionsApi.md#update_variable_definition_by_id) | **PATCH** /variable-definitions/{variable-definition-id} | Update a variable definition.
|
|
108
|
+
*PatchesApi* | [**create_patch**](vardef_client/docs/PatchesApi.md#create_patch) | **POST** /variable-definitions/{variable-definition-id}/patches | Create a new patch for a variable definition.
|
|
109
|
+
*PatchesApi* | [**get_all_patches**](vardef_client/docs/PatchesApi.md#get_all_patches) | **GET** /variable-definitions/{variable-definition-id}/patches | List all patches for the given variable definition.
|
|
110
|
+
*PatchesApi* | [**get_one_patch**](vardef_client/docs/PatchesApi.md#get_one_patch) | **GET** /variable-definitions/{variable-definition-id}/patches/{patch-id} | Get one concrete patch for the given variable definition.
|
|
111
|
+
*PublicApi* | [**get_public_variable_definition_by_id**](vardef_client/docs/PublicApi.md#get_public_variable_definition_by_id) | **GET** /public/variable-definitions/{variable-definition-id} | Get one variable definition.
|
|
112
|
+
*PublicApi* | [**list_public_validity_periods**](vardef_client/docs/PublicApi.md#list_public_validity_periods) | **GET** /public/variable-definitions/{variable-definition-id}/validity-periods | List all validity periods.
|
|
113
|
+
*PublicApi* | [**list_public_variable_definitions**](vardef_client/docs/PublicApi.md#list_public_variable_definitions) | **GET** /public/variable-definitions | List all variable definitions.
|
|
114
|
+
*ValidityPeriodsApi* | [**create_validity_period**](vardef_client/docs/ValidityPeriodsApi.md#create_validity_period) | **POST** /variable-definitions/{variable-definition-id}/validity-periods | Create a new validity period for a variable definition.
|
|
115
|
+
*ValidityPeriodsApi* | [**list_public_validity_periods_0**](vardef_client/docs/ValidityPeriodsApi.md#list_public_validity_periods_0) | **GET** /public/variable-definitions/{variable-definition-id}/validity-periods | List all validity periods.
|
|
116
|
+
*ValidityPeriodsApi* | [**list_validity_periods**](vardef_client/docs/ValidityPeriodsApi.md#list_validity_periods) | **GET** /variable-definitions/{variable-definition-id}/validity-periods | List all validity periods.
|
|
117
|
+
*VariableDefinitionsApi* | [**get_public_variable_definition_by_id_0**](vardef_client/docs/VariableDefinitionsApi.md#get_public_variable_definition_by_id_0) | **GET** /public/variable-definitions/{variable-definition-id} | Get one variable definition.
|
|
118
|
+
*VariableDefinitionsApi* | [**get_variable_definition_by_id**](vardef_client/docs/VariableDefinitionsApi.md#get_variable_definition_by_id) | **GET** /variable-definitions/{variable-definition-id} | Get one variable definition.
|
|
119
|
+
*VariableDefinitionsApi* | [**list_public_variable_definitions_0**](vardef_client/docs/VariableDefinitionsApi.md#list_public_variable_definitions_0) | **GET** /public/variable-definitions | List all variable definitions.
|
|
120
|
+
*VariableDefinitionsApi* | [**list_variable_definitions**](vardef_client/docs/VariableDefinitionsApi.md#list_variable_definitions) | **GET** /variable-definitions | List all variable definitions.
|
|
121
|
+
|
|
122
|
+
## Documentation For Models
|
|
123
|
+
|
|
124
|
+
- [CompleteResponse](vardef_client/docs/CompleteResponse.md)
|
|
125
|
+
- [Contact](vardef_client/docs/Contact.md)
|
|
126
|
+
- [Draft](vardef_client/docs/Draft.md)
|
|
127
|
+
- [LanguageStringType](vardef_client/docs/LanguageStringType.md)
|
|
128
|
+
- [Owner](vardef_client/docs/Owner.md)
|
|
129
|
+
- [Patch](vardef_client/docs/Patch.md)
|
|
130
|
+
- [SupportedLanguages](vardef_client/docs/SupportedLanguages.md)
|
|
131
|
+
- [UpdateDraft](vardef_client/docs/UpdateDraft.md)
|
|
132
|
+
- [ValidityPeriod](vardef_client/docs/ValidityPeriod.md)
|
|
133
|
+
- [VariableStatus](vardef_client/docs/VariableStatus.md)
|
|
134
|
+
|
|
135
|
+
<a id="documentation-for-authorization"></a>
|
|
136
|
+
|
|
137
|
+
## Documentation For Authorization
|
|
138
|
+
|
|
139
|
+
Authentication schemes defined for the API:
|
|
140
|
+
<a id="Keycloak token"></a>
|
|
141
|
+
|
|
142
|
+
### Keycloak token
|
|
143
|
+
|
|
144
|
+
- **Type**: Bearer authentication (JWT)
|
|
145
|
+
|
|
146
|
+
## Author
|
|
147
|
+
|
|
148
|
+
<metadata@ssb.no>
|
|
File without changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
Variable Definitions
|
|
7
|
+
|
|
8
|
+
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the `active_group` query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are `DRAFT`, `PUBLISHED_INTERNAL` and `PUBLISHED_EXTERNAL`. #### Draft When a Variable Definition is created it is assigned the status `DRAFT`. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to `PUBLISHED_INTERNAL` or `PUBLISHED_EXTERNAL` with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to `PUBLISHED_EXTERNAL` by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a `valid_until` date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a `date_of_validity` when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a `valid_from` date and optionally a `valid_until` date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
|
|
9
|
+
|
|
10
|
+
The version of the OpenAPI document: 0.1
|
|
11
|
+
Contact: metadata@ssb.no
|
|
12
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
13
|
+
|
|
14
|
+
Do not edit the class manually.
|
|
15
|
+
""" # noqa: E501
|
|
16
|
+
|
|
17
|
+
__version__ = "1.0.0"
|
|
18
|
+
|
|
19
|
+
# import apis into sdk package
|
|
20
|
+
from .api.data_migration_api import DataMigrationApi
|
|
21
|
+
from .api.draft_variable_definitions_api import DraftVariableDefinitionsApi
|
|
22
|
+
from .api.patches_api import PatchesApi
|
|
23
|
+
from .api.validity_periods_api import ValidityPeriodsApi
|
|
24
|
+
from .api.variable_definitions_api import VariableDefinitionsApi
|
|
25
|
+
|
|
26
|
+
# import ApiClient
|
|
27
|
+
from .api_response import ApiResponse
|
|
28
|
+
from .api_client import ApiClient
|
|
29
|
+
from .configuration import Configuration
|
|
30
|
+
from .exceptions import OpenApiException
|
|
31
|
+
from .exceptions import ApiTypeError
|
|
32
|
+
from .exceptions import ApiValueError
|
|
33
|
+
from .exceptions import ApiKeyError
|
|
34
|
+
from .exceptions import ApiAttributeError
|
|
35
|
+
from .exceptions import ApiException
|
|
36
|
+
|
|
37
|
+
# import models into sdk package
|
|
38
|
+
from .models.complete_response import CompleteResponse
|
|
39
|
+
from .models.contact import Contact
|
|
40
|
+
from .models.draft import Draft
|
|
41
|
+
from .models.language_string_type import LanguageStringType
|
|
42
|
+
from .models.owner import Owner
|
|
43
|
+
from .models.patch import Patch
|
|
44
|
+
from .models.problem import Problem
|
|
45
|
+
from .models.update_draft import UpdateDraft
|
|
46
|
+
from .models.validity_period import ValidityPeriod
|
|
47
|
+
from .models.variable_status import VariableStatus
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# flake8: noqa
|
|
2
|
+
|
|
3
|
+
# import apis into api package
|
|
4
|
+
from ..api.data_migration_api import DataMigrationApi
|
|
5
|
+
from ..api.draft_variable_definitions_api import DraftVariableDefinitionsApi
|
|
6
|
+
from ..api.patches_api import PatchesApi
|
|
7
|
+
from ..api.validity_periods_api import ValidityPeriodsApi
|
|
8
|
+
from ..api.variable_definitions_api import VariableDefinitionsApi
|