markdoc-py
Python port of Markdoc, a Markdown-based authoring framework with custom tags and annotations.
Documentation: https://osks.github.io/markdoc-py/markdocpy.html
Status
This project is under active development. Core parsing, transforming, and HTML rendering are implemented, with fixture-based tests and JS parity fixtures.
JS parity notes
The Python port intentionally tracks JS Markdoc behavior, but some differences can exist while parity work is in progress. To see what is currently covered and any known gaps:
spec-parity.mdexplains the parity scope and lists tracked gaps.tests/spec/manifest.jsonmarks known JS mismatches withxfail_js.tests/test_spec_parity.pyenforces parity against committed JS outputs.
Requirements
- Python 3.13+
- Node.js (only needed for JS parity fixture generation)
Install (dev)
make env
Quick start
import markdocpy as Markdoc
source = \"\"\"
# Hello
{% note title=\"A\" %}
Body
{% /note %}
\"\"\"
ast = Markdoc.parse(source)
content = Markdoc.transform(ast, {\"tags\": {\"note\": {\"render\": \"note\", \"attributes\": {\"title\": {}}}}})
html = Markdoc.renderers.html(content)
API
ast = Markdoc.parse(source)
content = Markdoc.transform(ast, config)
errors = Markdoc.validate(ast, config)
html = Markdoc.renderers.html(content)
Tests
make test
Lint / format
make lint
make lint-fix
make format
Docs
make docs
Fixtures
Python fixtures:
make fixtures
JS parity fixtures (requires Markdoc build):
cd markdoc
npm install
npm run build
cd pymarkdoc
make fixtures-js
Project layout
markdocpy/
ast/
parser/
renderer/
schema/
transform/
validator/
tests/
fixtures/
js/
Metadata
Release files for markdoc-py 0.3.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 | |
|---|---|---|---|---|
| markdoc_py-0.3.0.tar.gz | 53.5 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| markdoc_py-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 78.5 kB
Release files / markdoc_py-0.3.0.tar.gz
| Download URL | markdoc_py-0.3.0.tar.gz |
|---|---|
| Size | 53.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e414a96a2d82ce16bbcbfab376a5f61cbab523caa353abe3e34172923e25fd97
|
|
BLAKE2b-256 checksum How to use checksums |
0e0b19223436db234adeb4f17eb88afe39d10dda18f4eb34b5c0349490b6fad6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Jan 25, 2026.
Transparency logRelease files / markdoc_py-0.3.0-py3-none-any.whl
| Download URL | markdoc_py-0.3.0-py3-none-any.whl |
|---|---|
| Size | 25.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f68b7a5cf4d926b38979f4efd671a565722b92366e0551929d6e0ea5c5d77222
|
|
BLAKE2b-256 checksum How to use checksums |
ee63ac8ffa89530cd0b5231776a95e6f7f2b597f40808a39c88cc2ce4d48be24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Jan 25, 2026.
Transparency logSecurity for markdoc-py 0.3.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.
Attestation for markdoc_py-0.3.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 Jan 25, 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.