Skip to main content

reqmd-io

Build reqmd-import/v1 exchange bundles from Python.

This library only emits the JSON exchange format — it contains no Markdown or YAML logic. reqmd-import is the single renderer that turns a bundle into reqmd documents (schema.yaml + .md), so an importer written in Python cannot drift from the Go renderer.

Install

pip install reqmd-io

Or from the repo root:

pip install ./python

Use

from reqmd_io import Bundle, Document, Requirement

doc = Document(id_prefix="DOORS-", dir="brakes", level="stakeholder-requirements",
               title="Brakes Module", external=True,
               properties={"priority": {"type": "string", "enum": ["High", "Low"]}})

doc.add(Requirement(native_id="17", title="Brake request",
                    body="The pedal shall request braking.",
                    attrs={"priority": "High"}))
doc.add(Requirement(native_id="42", title="Brake pressure", parent="17",
                    native_trace=["17"], trace=["SYS-001"],
                    attrs={"priority": "Low"}))

Bundle([doc]).write("brakes.json")
reqmd-import brakes.json -o spec/00-doors/
reqmd check spec/

Key points:

  • native_id is the source tool's own stable ID (a DOORS object number, a codeBeamer item ID). The reqmd ID becomes <id_prefix><native_id>, so re-imports never churn IDs and hand-authored trace: links keep resolving. It must not contain whitespace (an Item 42 key is rejected: nothing could ever trace: to the ID it produces).
  • trace holds fully-qualified reqmd IDs. native_trace holds native IDs of other items in the same bundle and is rewritten to that item's full ID.
  • attrs take strings, numbers, booleans, or flat lists of those. A string stays a string even when it looks like a number or null, so pass a real number or boolean when you mean one. Names may only contain letters, digits, _, - and .. The built-ins status and trace are reserved (there are dedicated fields).
  • body is Markdown and may contain headings (they become info items), but not a fence whose info string is attr directly under a heading — that pair would become a requirement of its own.
  • properties declares the attr-block JSON Schema; regenerating with a new attr means adding it there.

A complete, runnable importer is in examples/csv_import.py — one generic reader for DOORS and codeBeamer CSV exports.

Test

cd python && python -m unittest discover -s tests

Releasing

reqmd-io versions independently of the reqmd binaries: bump it only for a new feature or an exchange-format change, not for every reqmd release. The version in pyproject.toml is the single source of truth.

# 1. bump the version in pyproject.toml (PyPI never allows a reuse)
# 2. land it on main, then tag with the py-v prefix (NOT the bare v prefix):
git tag py-v0.1.0 && git push origin py-v0.1.0

The py-v* tag triggers .github/workflows/publish-python.yml, which runs the tests, builds the sdist and wheel, runs twine check, and fails if the tag and the packaged version disagree. Publishing uses PyPI Trusted Publishing, so no API token secret is stored.

To rehearse before a real release, build locally and upload to TestPyPI:

cd python
python -m build && twine check dist/*
twine upload -r testpypi dist/*

First-time setup (once, on PyPI): add a pending publisher for the project reqmd-io with owner dVoo, repository reqmd, workflow publish-python.yml, and environment pypi.

Metadata

Release files for reqmd-io 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reqmd-io 0.2.0
File Size Uploaded Provenance Actions
reqmd_io-0.2.0.tar.gz 17.6 kB With provenance Details for reqmd_io-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for reqmd-io 0.2.0
File Interpreter ABI Platform Actions
reqmd_io-0.2.0-py3-none-any.whl Python 3 none any Details for reqmd_io-0.2.0-py3-none-any.whl

Total release size: 34.6 kB

Release files / reqmd_io-0.2.0.tar.gz

Download URL reqmd_io-0.2.0.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d204886c1f2e2a6463e857acfd975b0ba4f28b4da502b75a17c5d9d89000ff1b
BLAKE2b-256 checksum
How to use checksums
a6a729dca9c5695dd18873791bb23c11eed19c09aaa651db5eec8db9fa24659e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / reqmd_io-0.2.0-py3-none-any.whl

Download URL reqmd_io-0.2.0-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ffe94aee56dc0d82828caf20aee34cce8f297c45ebb9863c419dfadd33a2261
BLAKE2b-256 checksum
How to use checksums
91e5c6f242e6b530eaff8ebccf88e060419e73814b987ed3dc5d12229788d673
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for reqmd-io 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for reqmd_io-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page