Programmatic Markdown report generation for Python.
Project description
MkForge
Programmatic Markdown report generation for Python.
MkForge is a small Python toolkit for building structured, reproducible Markdown reports from code.
It provides composable report primitives such as sections, paragraphs, tables, figures, metadata, checksums, and renderers so automation scripts can produce readable Markdown artifacts without hand-written string assembly.
Use Cases
- Quality gate reports
- CI and release summaries
- Code metrics reports
- Dependency audit reports
- Generated technical appendices
- Reproducible Markdown artifacts for documentation pipelines
Scope
MkForge focuses on generating Markdown documents from structured Python data.
It is not:
- a Markdown project compiler;
- a static site generator;
- a CI runner;
- a replacement for documentation tools such as MkDocs.
Those tools can use MkForge as their reporting layer.
Installation
uv sync
Development
make check
make check runs formatting, Ruff, Flake8, docstring checks, Mypy, code
metrics, security checks, tests, and 100% coverage validation.
For CI-style non-mutating checks:
make ci
For package validation before publishing:
make check-dist
Temporary outputs are created under work/ and removed at the end of each
quality or packaging execution. The directory is kept in the repository with
work/.gitkeep.
Example
from mkforge import Chapter, Paragraph, Report, Section, Table
report = Report(
title="Quality Report",
metadata={"title": "Quality Report", "tags": ["quality", "ci"]},
toc=True,
).add(
Chapter("Summary").add(
Section("Checks").add(
Paragraph("All checks passed."),
Table.from_columns(
{
"Check": ("format", "lint", "tests"),
"Status": ("pass", "pass", "pass"),
},
),
),
),
)
markdown = report.render()
Markdown Verification
from mkforge import verify_markdown
report = verify_markdown("# Title\n\n| A | B |\n| --- | --- |\n")
Verification covers pure Markdown and GitHub Flavored Markdown conformance in a single pass. Custom rule callables can be appended for one verification call without mutating the built-in policy.
Markdown Validation
from mkforge import (
validate_markdown_chapters,
validate_markdown_headings,
validate_markdown_images,
validate_markdown_yaml,
)
ok = (
validate_markdown_yaml(markdown, {"draft": False})
and validate_markdown_chapters(markdown, ("Summary", "Details"))
and validate_markdown_headings(markdown, ((2, "Summary"), (3, "Checks")))
and validate_markdown_images(markdown, base_path="docs/report.md")
)
Validation answers project-specific boolean questions: expected YAML
frontmatter, required H2 chapters in order, heading level/title sequences, and
local or HTTP(S) image existence. Use strict=True for exact YAML keys or exact
heading and chapter sequences.
Runnable demos:
uv run python demo_report.py
uv run python demo_verif.py
uv run python demo_validation.py
Relationship With Scribpy
MkForge is intended to be independent from Scribpy.
mkforgegenerates Markdown reports from Python data.scribpyassembles and builds Markdown documentation projects.uvforgeinitializes and runs quality gates for Python packages usinguv.
Scribpy and uvforge may depend on MkForge for generated reports, but MkForge should not depend on either of them.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkforge-0.1.0.tar.gz.
File metadata
- Download URL: mkforge-0.1.0.tar.gz
- Upload date:
- Size: 186.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b119a2320d4f6724b3bea9108077f2b0ad34b18c2353659089716dc64785be3d
|
|
| MD5 |
32efc26544f56374e3e84ebec3504578
|
|
| BLAKE2b-256 |
a67389ab39fd057b8b518b9ef9641fa3e372cce9e5cbb01a0f17a8533a272d71
|
Provenance
The following attestation bundles were made for mkforge-0.1.0.tar.gz:
Publisher:
publish.yml on antoinebarre/mkforge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkforge-0.1.0.tar.gz -
Subject digest:
b119a2320d4f6724b3bea9108077f2b0ad34b18c2353659089716dc64785be3d - Sigstore transparency entry: 1740745645
- Sigstore integration time:
-
Permalink:
antoinebarre/mkforge@00d16b84d6661df9f81f933e660e3af951fa7f46 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/antoinebarre
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@00d16b84d6661df9f81f933e660e3af951fa7f46 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mkforge-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mkforge-0.1.0-py3-none-any.whl
- Upload date:
- Size: 75.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
638dcabf45c07f706df2618441e7e7b349590bf516c701a88f569c3d8608a687
|
|
| MD5 |
173d5e94715203c1d399f7c3222bcb76
|
|
| BLAKE2b-256 |
19901eff8b8f00284a83f9f9d32c2ce36a2ea0ae6b1a1a0a51a8978631186c30
|
Provenance
The following attestation bundles were made for mkforge-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on antoinebarre/mkforge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkforge-0.1.0-py3-none-any.whl -
Subject digest:
638dcabf45c07f706df2618441e7e7b349590bf516c701a88f569c3d8608a687 - Sigstore transparency entry: 1740745675
- Sigstore integration time:
-
Permalink:
antoinebarre/mkforge@00d16b84d6661df9f81f933e660e3af951fa7f46 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/antoinebarre
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@00d16b84d6661df9f81f933e660e3af951fa7f46 -
Trigger Event:
push
-
Statement type: