parse-md
Bounded, source-preserving Markdown parsing and safe typed HTML rendering. Python 3.14+, with no runtime dependencies. Extracted from Pretty Notebook; see provenance.
python -m pip install parse-md
from parse_md import EXTENDED, RendererContext, parse, render
document = parse('# Heading\n\n**Hello**.\n')
assert document.to_markdown() == '# Heading\n\n**Hello**.\n'
assert '<strong>Hello</strong>' in document.to_html()
result = render('| A | B |\n| --- | --- |\n| one | two |\n', dialect=EXTENDED)
assert '<table>' in result.html
The default CommonMark profile preserves original slices, code-point source
spans and bounded parsing. The opt-in extended profile adds generic document
tables, tasks, footnotes, attributes, TOC, strike/highlight, wiki/image syntax and
diagram metadata. Unknown syntax remains literal source. HTML is escaped by
default; RendererContext(trust='trusted') explicitly permits raw HTML and is
not sanitization.
Application callbacks resolve wiki/image destinations, filter tags, decorate links or render explicitly selected node types. The engine imports no notebook models, graph, routes, templates, icons, HTTP client or filesystem state. The caller owns its application policy and any callback-produced HTML.
See the API contract for immutable dialect identities, limits, callbacks and extraction/adoption boundaries. Headless spreadsheet tables remain separate values; any adapter is optional. Terminal layout belongs to Escape Colors and HTML-tree processing to Astree.
Development and distribution qualification:
uv sync --locked
uv run --frozen python -m pytest
uv run --frozen python scripts/check_distribution.py --output-dir /tmp/parse-md-candidate
The implementation retains its MIT notices. The complete 652-example CommonMark
0.31.2 fixture corpus retains its separate CC BY-SA 4.0 attribution in
tests/fixtures/markdown/NOTICE.md.
release.yaml uses the pypi environment and verifies tag/version/main before
publication through Trusted Publishing.
Metadata
Release files for parse-md 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 | Provenance | Actions |
|---|---|---|---|---|
| parse_md-0.1.0.tar.gz | 58.2 kB | With provenance | Details for parse_md-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| parse_md-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for parse_md-0.1.0-py3-none-any.whl |
Total release size: 85.6 kB
Release files / parse_md-0.1.0.tar.gz
| Download URL | parse_md-0.1.0.tar.gz |
|---|---|
| Size | 58.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b83f44b7bee34b777af332a785d58d34722daa294c1d01823d204bcb24f076be
|
|
BLAKE2b-256 checksum How to use checksums |
f995311592ec5d3ed29720a283a1a6dd876871122589163dfbb20da07462c671
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Nov 17, 2026.
Transparency logRelease files / parse_md-0.1.0-py3-none-any.whl
| Download URL | parse_md-0.1.0-py3-none-any.whl |
|---|---|
| Size | 27.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bd4d70d2d11120e8ac819e91cc789689d3644e3b7da5f26d9be30f2a20125321
|
|
BLAKE2b-256 checksum How to use checksums |
5ab7e8de6563dea1200d8aa17486f38fd438bf8ac99e92156b85ad08899165a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Nov 17, 2026.
Transparency logSecurity for parse-md 0.1.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
Both files in this release have been uploaded with provenance metadata.
Attestation for parse_md-0.1.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 Nov 17, 2026.
Transparency logA 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.