Parse Markdown model definitions into RDF, diagrams, and docs.
Project description
SPDX-FileCopyrightText: 2026 Arthit Suriyawongkul SPDX-FileType: DOCUMENTATION SPDX-License-Identifier: CC0-1.0
SpecMD
Convert Markdown model definitions to RDF ontologies and specification documents.
Features
SpecMD reads and validates a complete model directory, then generates one or more outputs:
| Format | Description |
|---|---|
jsondump |
JSON dump of the parsed model |
mkdocs |
MkDocs source files for website generation |
plantuml |
PlantUML diagram source |
rdf |
OWL+SHACL ontology and JSON-LD context |
tex |
TeX source for printable specification |
singlefile |
Single Markdown file (suitable for conversion to Word, PDF, etc.) |
webpages |
Per-IRI web pages (not yet implemented) |
A few SpecMD syntax additions capture validation rules that spec-parser can only express as prose -- type scoping, conditional cardinality, relationship endpoint typing, numeric ranges, fixed values, and profile conformance -- and compile them to SHACL automatically. See docs/constraints-spec.md for the rule catalogue and docs/design.md for the SHACL mapping.
Installation
pip install specmd
All Python dependencies are installed automatically. The tex format
additionally requires pandoc; all other formats need no
external tools.
Quick start
# Validate a model directory
specmd validate path/to/model
# Generate all formats into ./out
specmd generate path/to/model --output ./out
# Generate specific formats only
specmd generate path/to/model --formats rdf,mkdocs --output ./out
See the command-line reference for every command and option.
Configuration
An optional specmd.yml file at the model root controls parsing and generation
(base URI, namespace order, ontology metadata, vocabulary defaults, output
naming, and profile conformance). A worked example is in
docs/specmd.yml.example; the full reference is in
docs/format.md.
Model files are linter-friendly: they survive a markdownlint --fix pass, and
IRI metadata such as id: accepts both a bare URL and the autolink form
(id: <https://…>).
Documentation
| Document | Contents |
|---|---|
| docs/cli.md | Command-line reference (validate, generate, migrate, export) |
| docs/format.md | Markdown input format and specmd.yml configuration |
| docs/constraints-spec.md | Constraint and profile-conformance syntax → SHACL |
| docs/design.md | RDF/OWL/SHACL design decisions and rationale |
| docs/translation.md | Multilingual / translation support |
| docs/spec-parser-compatibility.md | Drop-in workflow shim and output differences |
| docs/testing.md | Running the test suite and optional-dependency tests |
Compatibility
SpecMD targets compatibility with spdx/spec-parser workflows and accepts the
original Markdown format via automatic migration (specmd migrate, or the
main.py drop-in shim). Generated output is not byte-for-byte identical --
existing SHACL validation results are preserved, but RDF/OWL consumers should
review the differences. See
docs/spec-parser-compatibility.md.
This project is not an official SPDX project.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file specmd-0.3.0.tar.gz.
File metadata
- Download URL: specmd-0.3.0.tar.gz
- Upload date:
- Size: 142.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e924e2d33c3525aac7d835b5c7ace31b7587c49d583d2378047f2db939b81ba
|
|
| MD5 |
b811449cb38f0f73cbb54d6c2ca54951
|
|
| BLAKE2b-256 |
79a3d69660033fd0aa3a7642ec696062e5d29b251738b6cb73038daf7f5ae05c
|
Provenance
The following attestation bundles were made for specmd-0.3.0.tar.gz:
Publisher:
pypi-publish.yml on bact/specmd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
specmd-0.3.0.tar.gz -
Subject digest:
4e924e2d33c3525aac7d835b5c7ace31b7587c49d583d2378047f2db939b81ba - Sigstore transparency entry: 1902519319
- Sigstore integration time:
-
Permalink:
bact/specmd@09c3b03dfb6db835587afc2a145efd40fb383ab9 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/bact
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@09c3b03dfb6db835587afc2a145efd40fb383ab9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file specmd-0.3.0-py3-none-any.whl.
File metadata
- Download URL: specmd-0.3.0-py3-none-any.whl
- Upload date:
- Size: 79.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46580a6f69ec9a42fce38d43e38c5bd48cce4c1bb24082072835d7be2e9dca2e
|
|
| MD5 |
3d6ffa45e3d93e9fb1f4b3d1cf78277c
|
|
| BLAKE2b-256 |
02e3ea7c0333d4773def7f4e9ccf85ddedb5fe92b2f0597da58b62c510d1621a
|
Provenance
The following attestation bundles were made for specmd-0.3.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on bact/specmd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
specmd-0.3.0-py3-none-any.whl -
Subject digest:
46580a6f69ec9a42fce38d43e38c5bd48cce4c1bb24082072835d7be2e9dca2e - Sigstore transparency entry: 1902519476
- Sigstore integration time:
-
Permalink:
bact/specmd@09c3b03dfb6db835587afc2a145efd40fb383ab9 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/bact
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@09c3b03dfb6db835587afc2a145efd40fb383ab9 -
Trigger Event:
release
-
Statement type: