marklassian-py
A lightweight Python library that converts Markdown to the Atlassian Document Format (ADF). Built for easy integration with Atlassian products like Jira and Confluence.
This is a Python port of the excellent marklassian JavaScript library by @jamsinclair.
Features
- Convert Markdown to ADF with a single function call
- Support for common Markdown syntax including GFM task lists
- Minimal dependencies (only mistune)
- Full type hints for IDE support
- Python 3.10+
Installation
pip install marklassian
Or with uv:
uv add marklassian
Usage
from marklassian import markdown_to_adf
markdown = "# Hello World\n\nThis is **bold** and *italic* text."
adf = markdown_to_adf(markdown)
The result is a dictionary that can be serialized to JSON:
import json
print(json.dumps(adf, indent=2))
Supported Markdown Features
- Headings (H1-H6)
- Paragraphs and line breaks
- Emphasis (bold, italic, strikethrough)
- Links and images
- Inline code and code blocks with language support
- Ordered and unordered lists with nesting
- Blockquotes
- Horizontal rules
- Tables
- Task lists (GitHub Flavored Markdown)
API Reference
markdown_to_adf(markdown: str, *, jira_mentions: bool = False) -> AdfDocument
Converts a Markdown string to an ADF document object.
Types
class AdfMark(TypedDict, total=False):
type: Required[str]
attrs: dict[str, Any]
class AdfNode(TypedDict, total=False):
type: Required[str]
attrs: dict[str, Any]
content: list[AdfNode]
marks: list[AdfMark]
text: str
class AdfDocument(TypedDict):
version: Literal[1]
type: Literal["doc"]
content: list[AdfNode]
Jira account mentions
Pass jira_mentions=True to convert Jira wiki mentions into ADF mention nodes:
markdown_to_adf("Hi [~accountId:557057:user-id]", jira_mentions=True)
This option is disabled by default. Code and escaped mention syntax remain unchanged.
Caveats
This library aims to provide a lightweight and mostly accurate conversion from Markdown to ADF.
For complex Markdown documents or strict ADF conformance requirements, consider using the official Atlassian libraries. Note that those are heavier dependencies.
References
Credits
This library is a Python port of marklassian by Jamie Sinclair. All credit for the original implementation and conversion logic goes to them.
License
MIT - see LICENSE for details.
Metadata
Release files for marklassian 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 | |
|---|---|---|---|
| marklassian-0.3.0.tar.gz | 107.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| marklassian-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 115.8 kB
Release files / marklassian-0.3.0.tar.gz
| Download URL | marklassian-0.3.0.tar.gz |
|---|---|
| Size | 107.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
486158e6f738910259e8b930a370de66cfe66ad6d0d2583354b2f4c5590bd937
|
|
BLAKE2b-256 checksum How to use checksums |
7e2d8e69819ae52179627a60e6d4daefaf1e2128a33ac291fee2b24fa1f52999
|
| 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 Sep 3, 2026.
Transparency logRelease files / marklassian-0.3.0-py3-none-any.whl
| Download URL | marklassian-0.3.0-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
937f2d60cdc9cdec0a6d05c083fbcd2de4c5986a8798c973d056f33d1ab37c32
|
|
BLAKE2b-256 checksum How to use checksums |
e6a891e06be906a8e35676acc3758e98eb35b0f0c5f15ec9d3b847da84264e9c
|
| 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 Sep 3, 2026.
Transparency log