Integrating tom_som_python_v0
tom_som_python_v0 is the typed TomSpecs object-model facade for Python. It depends on tom_som_python_runtime. Both are versioned to the TomSpecs
model version (currently 1.3.2) — pin to that version so your document reads and writes match the model the facade was generated from.
Quick start
Install tom_som_python_v0 (pip install tom_som_python_v0), then:
import tom_som_python_v0 as m
from tom_som_runtime import SpecDocument
# A typed Solution Blueprint over a fresh document.
doc = SpecDocument()
blueprint = m.D00SolutionBlueprint(doc)
blueprint.content = "A platform that unifies our fragmented order systems."
blueprint.currentLandscape.content = (
"Three legacy systems with no shared customer record."
)
print(blueprint.content)
Dependency routes
From PyPI
Install the facade (it pulls in tom_som_python_runtime):
pip install tom_som_python_v0
or pin it in your pyproject.toml / requirements.txt:
tom_som_python_v0>=1.3.2
Git dependency
Install directly from source control (the facade lives in a sub-directory of the mono-repo):
pip install "tom_som_python_v0 @ git+https://github.com/al-the-bear/tom_ai_build.git#subdirectory=tom_som_python_v0"
Path / editable (monorepo / vendored)
When the SOM projects sit alongside your code, install both the facade and the runtime editable:
pip install -e ../tom_som_python_runtime
pip install -e ../tom_som_python_v0
For a no-install checkout the facade also records the runtime location under [tool.tom_som] runtime-path
in its pyproject.toml; add that path to PYTHONPATH so import tom_som_runtime
resolves.
Shipped data files (meta-data + DocSpecs schemas)
The distribution carries the lossless object-model meta-data (spec_model.meta.json) and the DocSpecs schemas as data packages inside the wheel. Resolve them through the generated resolution module — it works both from a source checkout and from an installed wheel:
from tom_som_python_v0_data import spec_model_meta_path, schemas_root
meta_file = spec_model_meta_path() # …/spec_model.meta.json
schema_dir = schemas_root() # one subfolder per document root
Pinning the version
Both tom_som_python_runtime and tom_som_python_v0 carry version 1.3.2, taken from the TomSpecs model version. When you upgrade the model, regenerate and move to the new matching version so the facade and your stored documents stay in step.
Building from source
Regenerate the facade and build the PEP 517 dists from the workspace:
dart run tom_specs_clitool/bin/generate_som.dart
cd tom_som_python_v0 && python -m build
This writes a wheel and an sdist under dist/.
Further documentation
| Document | Covers |
|---|---|
| README.md | What this package is, its document roots, and how to use them. |
| doc/tutorial.md |
A Python walkthrough end to end — install, open a document, read and edit a section, validate it, and serialize to
*.docspecs.yaml
and Markdown.
|
| examples/README.md | The runnable samples. |
| tom_specs_model/doc/som_multiplatform_spec_model.md |
The SOM authority: the model, the formats, and
SOM §17
— the packaging rules this guide implements.
|
| tom_specs_model/doc/index.md | The catalogue of every TomSpecs subject-matter document. |
| tom_som_python_runtime | The generic runtime this facade depends on. |