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.3.tar.gz (144.8 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.3-py3-none-any.whl (81.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: specmd-0.3.3.tar.gz
  • Upload date:
  • Size: 144.8 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.3.tar.gz
Algorithm Hash digest
SHA256 3ddb176ee743c630e1615c1730dec0d6b30a7811aac4c57d09f8749517f098db
MD5 66387666b480d3f8af6408703bbea798
BLAKE2b-256 1e4097cf0dcd512d9755ace0446c64decb28c5cafa7920e5872e7c99b597af55

See more details on using hashes here.

Provenance

The following attestation bundles were made for specmd-0.3.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: specmd-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 81.1 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 77c2dc73dac19239744ee6b770bc3938e1f83113e9084a3d7acd13ebd2dde6f5
MD5 1e7f7240dd6825c9ab807591c0be9efe
BLAKE2b-256 3f9830215ac49382c0c1797efd2cab70fa111a5bd569c64513931a90a4979939

See more details on using hashes here.

Provenance

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