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.4.tar.gz (150.1 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.4-py3-none-any.whl (83.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: specmd-0.3.4.tar.gz
  • Upload date:
  • Size: 150.1 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.4.tar.gz
Algorithm Hash digest
SHA256 f5e1d10f0a215fa12918e2399cff568baaacc04ab098766a86ff6ca55d10ce5a
MD5 1e29c8ba20018cf229c372aac1d72323
BLAKE2b-256 dbe48ad9c979b73b59f8a00f2d86c94ec15da5e6ad478ad6d73b0e2218e6ee01

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: specmd-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 83.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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7c3729787ed0ffa8aaa6f1d784ed71a5a3780f09c7ab544af088835c48549733
MD5 34e1cf9c12758e03c22d70d7ca3f3f99
BLAKE2b-256 58b5171fcf864bdec8eed31a3a9c7268d7b350ab554eb44d3cff0d61bf6e7500

See more details on using hashes here.

Provenance

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