ruml-schema 1.0.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.
- ruml_schema/__init__.py +45 -0
- ruml_schema/ruml-ext.schema.json +2298 -0
- ruml_schema/ruml-result.schema.json +624 -0
- ruml_schema/ruml.schema.json +3088 -0
- ruml_schema-1.0.0.dist-info/METADATA +33 -0
- ruml_schema-1.0.0.dist-info/RECORD +8 -0
- ruml_schema-1.0.0.dist-info/WHEEL +4 -0
- ruml_schema-1.0.0.dist-info/licenses/LICENSE +73 -0
ruml_schema/__init__.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Rulemapping Group GmbH
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
"""RUML JSON Schemas — draft 2020-12 schemas for .ruml, .ruml-result and .ruml-ext documents."""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import json
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from typing import Any
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"RUML_SCHEMA_PATH",
|
|
13
|
+
"RUML_RESULT_SCHEMA_PATH",
|
|
14
|
+
"RUML_EXT_SCHEMA_PATH",
|
|
15
|
+
"load_ruml_schema",
|
|
16
|
+
"load_ruml_result_schema",
|
|
17
|
+
"load_ruml_ext_schema",
|
|
18
|
+
"spec_version",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
_HERE = Path(__file__).parent
|
|
22
|
+
|
|
23
|
+
RUML_SCHEMA_PATH = _HERE / "ruml.schema.json"
|
|
24
|
+
RUML_RESULT_SCHEMA_PATH = _HERE / "ruml-result.schema.json"
|
|
25
|
+
RUML_EXT_SCHEMA_PATH = _HERE / "ruml-ext.schema.json"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def load_ruml_schema() -> dict[str, Any]:
|
|
29
|
+
"""The schema for `.ruml` documents."""
|
|
30
|
+
return json.loads(RUML_SCHEMA_PATH.read_text(encoding="utf-8"))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def load_ruml_result_schema() -> dict[str, Any]:
|
|
34
|
+
"""The schema for `.ruml-result` documents."""
|
|
35
|
+
return json.loads(RUML_RESULT_SCHEMA_PATH.read_text(encoding="utf-8"))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def load_ruml_ext_schema() -> dict[str, Any]:
|
|
39
|
+
"""The schema for `.ruml-ext` documents."""
|
|
40
|
+
return json.loads(RUML_EXT_SCHEMA_PATH.read_text(encoding="utf-8"))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def spec_version() -> str:
|
|
44
|
+
"""The RUML spec version the schemas describe, e.g. `"0.1"`."""
|
|
45
|
+
return load_ruml_schema()["x-ruml-spec-version"]
|