Linked Markdown Python
Python implementation of Linked Markdown, packaged for PyPI.
Status: All 26 conformance tests passing.
API
from linked_markdown.extract import extract
from linked_markdown.errors import (
LinkedMarkdownError,
LMD_NO_FRONTMATTER,
LMD_INVALID_FRONTMATTER,
)
result = extract(markdown)
# => ExtractResult(front_matter="...", body="...", attrs={...})
extract(content: str) -> ExtractResult[dict]
Parses frontmatter from a Linked Markdown document. Supports YAML (---, ---yaml, = yaml =), JSON (---, ---json, = json =), and TOML (---toml, +++, = toml =) formats.
- Strips UTF-8 BOM and normalizes CRLF to LF before parsing.
- Returns
front_matterwith a trailing newline for non-empty frontmatter. front_matteris""for empty frontmatter (---\n---).bodyhas leading newlines stripped.
LinkedMarkdownError
Thrown for all error conditions. Has a .code property:
| Code | When |
|---|---|
LMD_NO_FRONTMATTER |
No frontmatter delimiters found |
LMD_INVALID_FRONTMATTER |
Unknown marker, unparseable content, non-object attrs, or no closing delimiter |
try:
extract(markdown)
except LinkedMarkdownError as e:
if e.code == LMD_NO_FRONTMATTER:
...
Development
git submodule update --init --recursive
uv sync
uv run pytest
Metadata
Release files for linked-markdown 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| linked_markdown-0.1.0.tar.gz | 2.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| linked_markdown-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.1 kB
Release files / linked_markdown-0.1.0.tar.gz
| Download URL | linked_markdown-0.1.0.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53d866230794c0be468fb287fcad9f606c01fd6f881249f80f8da14aeff56f97
|
|
BLAKE2b-256 checksum How to use checksums |
18f0551b8c0642d17ba9921442d47161d4936a1614cc6be8372241e717404089
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 6, 2026.
Transparency logRelease files / linked_markdown-0.1.0-py3-none-any.whl
| Download URL | linked_markdown-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b0c7464038ffa61b92dbbf4e1e27bced18c39cd68e05611ed6dfa57b9cbebeb8
|
|
BLAKE2b-256 checksum How to use checksums |
7a72d98295f3b056916aa0b7e4cae474e3945835fa6cc87c164fffcbf24f5f9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 6, 2026.
Transparency log