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.0.tar.gz (142.7 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.0-py3-none-any.whl (79.2 kB view details)

Uploaded Python 3

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

Hashes for specmd-0.3.0.tar.gz
Algorithm Hash digest
SHA256 4e924e2d33c3525aac7d835b5c7ace31b7587c49d583d2378047f2db939b81ba
MD5 b811449cb38f0f73cbb54d6c2ca54951
BLAKE2b-256 79a3d69660033fd0aa3a7642ec696062e5d29b251738b6cb73038daf7f5ae05c

See more details on using hashes here.

Provenance

The following attestation bundles were made for specmd-0.3.0.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.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

Hashes for specmd-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46580a6f69ec9a42fce38d43e38c5bd48cce4c1bb24082072835d7be2e9dca2e
MD5 3d6ffa45e3d93e9fb1f4b3d1cf78277c
BLAKE2b-256 02e3ea7c0333d4773def7f4e9ccf85ddedb5fe92b2f0597da58b62c510d1621a

See more details on using hashes here.

Provenance

The following attestation bundles were made for specmd-0.3.0-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