ssot-codegen 0.2.4__tar.gz

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.
@@ -0,0 +1,36 @@
1
+ Metadata-Version: 2.4
2
+ Name: ssot-codegen
3
+ Version: 0.2.4
4
+ Summary: Generators for SSOT contract, CLI, and TUI artifacts.
5
+ Author-email: Jacob Stewart <jacob@swarmauri.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/groupsum/ssot-registry
8
+ Project-URL: Repository, https://github.com/groupsum/ssot-registry
9
+ Project-URL: Issues, https://github.com/groupsum/ssot-registry/issues
10
+ Keywords: ssot,codegen,generators,contracts
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Code Generators
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Requires-Python: <3.14,>=3.10
24
+ Description-Content-Type: text/markdown
25
+ Requires-Dist: ssot-contracts==0.2.4
26
+ Requires-Dist: ssot-views==0.2.4
27
+ Requires-Dist: tomli>=2.0.1; python_version < "3.11"
28
+
29
+ # ssot-codegen
30
+
31
+ SSOT generators for:
32
+
33
+ - Python contract artifacts
34
+ - CLI metadata
35
+ - TUI metadata
36
+ - future TypeScript/npm parity outputs
@@ -0,0 +1,8 @@
1
+ # ssot-codegen
2
+
3
+ SSOT generators for:
4
+
5
+ - Python contract artifacts
6
+ - CLI metadata
7
+ - TUI metadata
8
+ - future TypeScript/npm parity outputs
@@ -0,0 +1,46 @@
1
+ [build-system]
2
+ requires = ["setuptools>=69", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "ssot-codegen"
7
+ version = "0.2.4"
8
+ description = "Generators for SSOT contract, CLI, and TUI artifacts."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10,<3.14"
11
+ license = "Apache-2.0"
12
+ authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
13
+ dependencies = [
14
+ "ssot-contracts==0.2.4",
15
+ "ssot-views==0.2.4",
16
+ "tomli>=2.0.1; python_version < '3.11'",
17
+ ]
18
+ keywords = ["ssot", "codegen", "generators", "contracts"]
19
+ classifiers = [
20
+ "Development Status :: 3 - Alpha",
21
+ "Environment :: Console",
22
+ "Intended Audience :: Developers",
23
+ "Operating System :: OS Independent",
24
+ "Programming Language :: Python :: 3",
25
+ "Programming Language :: Python :: 3 :: Only",
26
+ "Programming Language :: Python :: 3.10",
27
+ "Programming Language :: Python :: 3.11",
28
+ "Programming Language :: Python :: 3.12",
29
+ "Programming Language :: Python :: 3.13",
30
+ "Topic :: Software Development :: Code Generators",
31
+ "Topic :: Software Development :: Libraries :: Python Modules",
32
+ ]
33
+
34
+ [project.scripts]
35
+ ssot-codegen = "ssot_codegen.main:main"
36
+
37
+ [project.urls]
38
+ Homepage = "https://github.com/groupsum/ssot-registry"
39
+ Repository = "https://github.com/groupsum/ssot-registry"
40
+ Issues = "https://github.com/groupsum/ssot-registry/issues"
41
+
42
+ [tool.setuptools]
43
+ package-dir = {"" = "src"}
44
+
45
+ [tool.setuptools.packages.find]
46
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ from .generator import generate_python_artifacts
2
+
3
+ __all__ = ["generate_python_artifacts"]
@@ -0,0 +1,58 @@
1
+ from __future__ import annotations
2
+
3
+ import json
4
+ from pathlib import Path
5
+
6
+ from ssot_contracts import CONTRACT_DATA, load_document_manifest
7
+
8
+
9
+ def generate_python_artifacts(output_root: str | Path) -> list[Path]:
10
+ target_root = Path(output_root)
11
+ target_root.mkdir(parents=True, exist_ok=True)
12
+ json_outputs = {
13
+ "contracts.index.json": {
14
+ "schema_version": CONTRACT_DATA["schema_version"],
15
+ "adr_manifest_ids": [entry["id"] for entry in load_document_manifest("adr")],
16
+ "spec_manifest_ids": [entry["id"] for entry in load_document_manifest("spec")],
17
+ },
18
+ "cli.metadata.json": {
19
+ "output_formats": CONTRACT_DATA["output_formats"],
20
+ "entity_sections": CONTRACT_DATA["entity_sections"],
21
+ },
22
+ "tui.metadata.json": {
23
+ "entity_sections": CONTRACT_DATA["entity_sections"],
24
+ },
25
+ }
26
+ python_outputs = {
27
+ "enums.py": (
28
+ "SCHEMA_VERSION = "
29
+ + repr(CONTRACT_DATA["schema_version"])
30
+ + "\nENTITY_PREFIXES = "
31
+ + repr(CONTRACT_DATA["entity_prefixes"])
32
+ + "\nGRAPH_NODE_KIND = "
33
+ + repr(CONTRACT_DATA["graph_node_kind"])
34
+ + "\n"
35
+ ),
36
+ "cli_metadata.py": (
37
+ "OUTPUT_FORMATS = "
38
+ + repr(tuple(CONTRACT_DATA["output_formats"]))
39
+ + "\nCLI_COMMAND_LABELS = "
40
+ + repr(tuple(section["key"] for section in CONTRACT_DATA["entity_sections"]))
41
+ + "\n"
42
+ ),
43
+ "tui_metadata.py": (
44
+ "ENTITY_SECTIONS = "
45
+ + repr(tuple((section["key"], section["label"]) for section in CONTRACT_DATA["entity_sections"]))
46
+ + "\n"
47
+ ),
48
+ }
49
+ written: list[Path] = []
50
+ for name, payload in json_outputs.items():
51
+ path = target_root / name
52
+ path.write_text(json.dumps(payload, indent=2) + "\n", encoding="utf-8")
53
+ written.append(path)
54
+ for name, text in python_outputs.items():
55
+ path = target_root / name
56
+ path.write_text(text, encoding="utf-8")
57
+ written.append(path)
58
+ return written
@@ -0,0 +1,20 @@
1
+ from __future__ import annotations
2
+
3
+ import argparse
4
+ from pathlib import Path
5
+
6
+ from .generator import generate_python_artifacts
7
+
8
+
9
+ def main(argv: list[str] | None = None) -> int:
10
+ parser = argparse.ArgumentParser(description="Generate SSOT Python-side contract metadata artifacts.")
11
+ parser.add_argument(
12
+ "--output-root",
13
+ default=str(Path.cwd() / ".tmp_codegen"),
14
+ help="Directory where generated JSON artifacts should be written.",
15
+ )
16
+ args = parser.parse_args(argv)
17
+ written = generate_python_artifacts(args.output_root)
18
+ for path in written:
19
+ print(path.as_posix())
20
+ return 0
@@ -0,0 +1,36 @@
1
+ Metadata-Version: 2.4
2
+ Name: ssot-codegen
3
+ Version: 0.2.4
4
+ Summary: Generators for SSOT contract, CLI, and TUI artifacts.
5
+ Author-email: Jacob Stewart <jacob@swarmauri.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/groupsum/ssot-registry
8
+ Project-URL: Repository, https://github.com/groupsum/ssot-registry
9
+ Project-URL: Issues, https://github.com/groupsum/ssot-registry/issues
10
+ Keywords: ssot,codegen,generators,contracts
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Code Generators
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Requires-Python: <3.14,>=3.10
24
+ Description-Content-Type: text/markdown
25
+ Requires-Dist: ssot-contracts==0.2.4
26
+ Requires-Dist: ssot-views==0.2.4
27
+ Requires-Dist: tomli>=2.0.1; python_version < "3.11"
28
+
29
+ # ssot-codegen
30
+
31
+ SSOT generators for:
32
+
33
+ - Python contract artifacts
34
+ - CLI metadata
35
+ - TUI metadata
36
+ - future TypeScript/npm parity outputs
@@ -0,0 +1,11 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/ssot_codegen/__init__.py
4
+ src/ssot_codegen/generator.py
5
+ src/ssot_codegen/main.py
6
+ src/ssot_codegen.egg-info/PKG-INFO
7
+ src/ssot_codegen.egg-info/SOURCES.txt
8
+ src/ssot_codegen.egg-info/dependency_links.txt
9
+ src/ssot_codegen.egg-info/entry_points.txt
10
+ src/ssot_codegen.egg-info/requires.txt
11
+ src/ssot_codegen.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ ssot-codegen = ssot_codegen.main:main
@@ -0,0 +1,5 @@
1
+ ssot-contracts==0.2.4
2
+ ssot-views==0.2.4
3
+
4
+ [:python_version < "3.11"]
5
+ tomli>=2.0.1
@@ -0,0 +1 @@
1
+ ssot_codegen