Skip to main content

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

PyPI - Version GitHub License DOI

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

specmd-0.3.1.tar.gz (143.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

specmd-0.3.1-py3-none-any.whl (79.7 kB view details)

Uploaded Python 3

File details

Details for the file specmd-0.3.1.tar.gz.

File metadata

  • Download URL: specmd-0.3.1.tar.gz
  • Upload date:
  • Size: 143.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for specmd-0.3.1.tar.gz
Algorithm Hash digest
SHA256 a227c19420bd0abe237ff8db6dbd9d4e975a44a9532596d5799ece044d0f6475
MD5 4dacc6435dc5c75c4b6a0ef5706fd316
BLAKE2b-256 febe31a0c766aa70d3e5bd6cc338f989dcb5c6d627b0de82010e702d903143b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for specmd-0.3.1.tar.gz:

Publisher: pypi-publish.yml on bact/specmd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file specmd-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: specmd-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 79.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for specmd-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7427f21dd532b8a861e1dac7810fc48fbf942645fa0509dc0ac3516002571463
MD5 9662097ae6968028c8cb837bcae2470d
BLAKE2b-256 6b874719983f511d94ca1243a08af3fe3ef62070654d6dfbf5e97ca474ec74b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for specmd-0.3.1-py3-none-any.whl:

Publisher: pypi-publish.yml on bact/specmd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page